ccxt 4.2.35__py2.py3-none-any.whl → 4.2.37__py2.py3-none-any.whl
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.
- ccxt/__init__.py +1 -1
- ccxt/abstract/bitfinex2.py +122 -122
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/base/exchange.py +1 -1
- ccxt/async_support/binance.py +347 -107
- ccxt/async_support/bitfinex.py +21 -0
- ccxt/async_support/bitfinex2.py +122 -122
- ccxt/async_support/bitget.py +23 -32
- ccxt/async_support/bithumb.py +14 -0
- ccxt/async_support/bitmex.py +22 -3
- ccxt/async_support/bybit.py +11 -4
- ccxt/async_support/woo.py +60 -35
- ccxt/base/exchange.py +1 -1
- ccxt/binance.py +347 -107
- ccxt/bitfinex.py +21 -0
- ccxt/bitfinex2.py +122 -122
- ccxt/bitget.py +23 -32
- ccxt/bithumb.py +14 -0
- ccxt/bitmex.py +22 -3
- ccxt/bybit.py +11 -4
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/binance.py +2 -2
- ccxt/pro/gemini.py +165 -3
- ccxt/test/test_async.py +8 -6
- ccxt/test/test_sync.py +8 -6
- ccxt/woo.py +60 -35
- {ccxt-4.2.35.dist-info → ccxt-4.2.37.dist-info}/METADATA +6 -6
- {ccxt-4.2.35.dist-info → ccxt-4.2.37.dist-info}/RECORD +30 -30
- {ccxt-4.2.35.dist-info → ccxt-4.2.37.dist-info}/WHEEL +0 -0
- {ccxt-4.2.35.dist-info → ccxt-4.2.37.dist-info}/top_level.txt +0 -0
ccxt/bitfinex.py
CHANGED
@@ -483,6 +483,7 @@ class bitfinex(Exchange, ImplicitAPI):
|
|
483
483
|
def fetch_trading_fees(self, params={}):
|
484
484
|
"""
|
485
485
|
fetch the trading fees for multiple markets
|
486
|
+
:see: https://docs.bitfinex.com/v1/reference/rest-auth-summary
|
486
487
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
487
488
|
:returns dict: a dictionary of `fee structures <https://docs.ccxt.com/#/?id=fee-structure>` indexed by market symbols
|
488
489
|
"""
|
@@ -559,6 +560,8 @@ class bitfinex(Exchange, ImplicitAPI):
|
|
559
560
|
def fetch_markets(self, params={}):
|
560
561
|
"""
|
561
562
|
retrieves data on all markets for bitfinex
|
563
|
+
:see: https://docs.bitfinex.com/v1/reference/rest-public-symbols
|
564
|
+
:see: https://docs.bitfinex.com/v1/reference/rest-public-symbol-details
|
562
565
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
563
566
|
:returns dict[]: an array of objects representing market data
|
564
567
|
"""
|
@@ -676,6 +679,7 @@ class bitfinex(Exchange, ImplicitAPI):
|
|
676
679
|
def fetch_balance(self, params={}) -> Balances:
|
677
680
|
"""
|
678
681
|
query for balance and get the amount of funds available for trading or funds locked in orders
|
682
|
+
:see: https://docs.bitfinex.com/v1/reference/rest-auth-wallet-balances
|
679
683
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
680
684
|
:returns dict: a `balance structure <https://docs.ccxt.com/#/?id=balance-structure>`
|
681
685
|
"""
|
@@ -727,6 +731,7 @@ class bitfinex(Exchange, ImplicitAPI):
|
|
727
731
|
def transfer(self, code: str, amount: float, fromAccount, toAccount, params={}) -> TransferEntry:
|
728
732
|
"""
|
729
733
|
transfer currency internally between wallets on the same account
|
734
|
+
:see: https://docs.bitfinex.com/v1/reference/rest-auth-transfer-between-wallets
|
730
735
|
:param str code: unified currency code
|
731
736
|
:param float amount: amount to transfer
|
732
737
|
:param str fromAccount: account to transfer from
|
@@ -807,6 +812,7 @@ class bitfinex(Exchange, ImplicitAPI):
|
|
807
812
|
def fetch_order_book(self, symbol: str, limit: Int = None, params={}) -> OrderBook:
|
808
813
|
"""
|
809
814
|
fetches information on open orders with bid(buy) and ask(sell) prices, volumes and other data
|
815
|
+
:see: https://docs.bitfinex.com/v1/reference/rest-public-orderbook
|
810
816
|
:param str symbol: unified symbol of the market to fetch the order book for
|
811
817
|
:param int [limit]: the maximum amount of order book entries to return
|
812
818
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -843,6 +849,7 @@ class bitfinex(Exchange, ImplicitAPI):
|
|
843
849
|
def fetch_ticker(self, symbol: str, params={}) -> Ticker:
|
844
850
|
"""
|
845
851
|
fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
852
|
+
:see: https://docs.bitfinex.com/v1/reference/rest-public-ticker
|
846
853
|
:param str symbol: unified symbol of the market to fetch the ticker for
|
847
854
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
848
855
|
:returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
|
@@ -956,6 +963,7 @@ class bitfinex(Exchange, ImplicitAPI):
|
|
956
963
|
def fetch_trades(self, symbol: str, since: Int = None, limit: Int = 50, params={}) -> List[Trade]:
|
957
964
|
"""
|
958
965
|
get the list of most recent trades for a particular symbol
|
966
|
+
:see: https://docs.bitfinex.com/v1/reference/rest-public-trades
|
959
967
|
:param str symbol: unified symbol of the market to fetch trades for
|
960
968
|
:param int [since]: timestamp in ms of the earliest trade to fetch
|
961
969
|
:param int [limit]: the maximum amount of trades to fetch
|
@@ -988,6 +996,7 @@ class bitfinex(Exchange, ImplicitAPI):
|
|
988
996
|
def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
989
997
|
"""
|
990
998
|
fetch all trades made by the user
|
999
|
+
:see: https://docs.bitfinex.com/v1/reference/rest-auth-past-trades
|
991
1000
|
:param str symbol: unified market symbol
|
992
1001
|
:param int [since]: the earliest time in ms to fetch trades for
|
993
1002
|
:param int [limit]: the maximum number of trades structures to retrieve
|
@@ -1011,6 +1020,7 @@ class bitfinex(Exchange, ImplicitAPI):
|
|
1011
1020
|
def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
|
1012
1021
|
"""
|
1013
1022
|
create a trade order
|
1023
|
+
:see: https://docs.bitfinex.com/v1/reference/rest-auth-new-order
|
1014
1024
|
:param str symbol: unified symbol of the market to create an order in
|
1015
1025
|
:param str type: 'market' or 'limit'
|
1016
1026
|
:param str side: 'buy' or 'sell'
|
@@ -1067,6 +1077,7 @@ class bitfinex(Exchange, ImplicitAPI):
|
|
1067
1077
|
def cancel_order(self, id: str, symbol: Str = None, params={}):
|
1068
1078
|
"""
|
1069
1079
|
cancels an open order
|
1080
|
+
:see: https://docs.bitfinex.com/v1/reference/rest-auth-cancel-order
|
1070
1081
|
:param str id: order id
|
1071
1082
|
:param str symbol: not used by bitfinex cancelOrder()
|
1072
1083
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -1081,6 +1092,7 @@ class bitfinex(Exchange, ImplicitAPI):
|
|
1081
1092
|
def cancel_all_orders(self, symbol: Str = None, params={}):
|
1082
1093
|
"""
|
1083
1094
|
cancel all open orders
|
1095
|
+
:see: https://docs.bitfinex.com/v1/reference/rest-auth-cancel-all-orders
|
1084
1096
|
:param str symbol: unified market symbol, only orders in the market of self symbol are cancelled when symbol is not None
|
1085
1097
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1086
1098
|
:returns dict: response from exchange
|
@@ -1159,6 +1171,7 @@ class bitfinex(Exchange, ImplicitAPI):
|
|
1159
1171
|
def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
1160
1172
|
"""
|
1161
1173
|
fetch all unfilled currently open orders
|
1174
|
+
:see: https://docs.bitfinex.com/v1/reference/rest-auth-active-orders
|
1162
1175
|
:param str symbol: unified market symbol
|
1163
1176
|
:param int [since]: the earliest time in ms to fetch open orders for
|
1164
1177
|
:param int [limit]: the maximum number of open orders structures to retrieve
|
@@ -1178,6 +1191,7 @@ class bitfinex(Exchange, ImplicitAPI):
|
|
1178
1191
|
def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
1179
1192
|
"""
|
1180
1193
|
fetches information on multiple closed orders made by the user
|
1194
|
+
:see: https://docs.bitfinex.com/v1/reference/rest-auth-orders-history
|
1181
1195
|
:param str symbol: unified market symbol of the market orders were made in
|
1182
1196
|
:param int [since]: the earliest time in ms to fetch orders for
|
1183
1197
|
:param int [limit]: the maximum number of order structures to retrieve
|
@@ -1199,6 +1213,7 @@ class bitfinex(Exchange, ImplicitAPI):
|
|
1199
1213
|
def fetch_order(self, id: str, symbol: Str = None, params={}):
|
1200
1214
|
"""
|
1201
1215
|
fetches information on an order made by the user
|
1216
|
+
:see: https://docs.bitfinex.com/v1/reference/rest-auth-order-status
|
1202
1217
|
:param str symbol: not used by bitfinex fetchOrder
|
1203
1218
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1204
1219
|
:returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
@@ -1233,6 +1248,7 @@ class bitfinex(Exchange, ImplicitAPI):
|
|
1233
1248
|
def fetch_ohlcv(self, symbol: str, timeframe='1m', since: Int = None, limit: Int = None, params={}) -> List[list]:
|
1234
1249
|
"""
|
1235
1250
|
fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
1251
|
+
:see: https://docs.bitfinex.com/reference/rest-public-candles#aggregate-funding-currency-candles
|
1236
1252
|
:param str symbol: unified symbol of the market to fetch OHLCV data for
|
1237
1253
|
:param str timeframe: the length of time each candle represents
|
1238
1254
|
:param int [since]: timestamp in ms of the earliest candle to fetch
|
@@ -1272,6 +1288,7 @@ class bitfinex(Exchange, ImplicitAPI):
|
|
1272
1288
|
def create_deposit_address(self, code: str, params={}):
|
1273
1289
|
"""
|
1274
1290
|
create a currency deposit address
|
1291
|
+
:see: https://docs.bitfinex.com/v1/reference/rest-auth-deposit
|
1275
1292
|
:param str code: unified currency code of the currency for the deposit address
|
1276
1293
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1277
1294
|
:returns dict: an `address structure <https://docs.ccxt.com/#/?id=address-structure>`
|
@@ -1285,6 +1302,7 @@ class bitfinex(Exchange, ImplicitAPI):
|
|
1285
1302
|
def fetch_deposit_address(self, code: str, params={}):
|
1286
1303
|
"""
|
1287
1304
|
fetch the deposit address for a currency associated with self account
|
1305
|
+
:see: https://docs.bitfinex.com/v1/reference/rest-auth-deposit
|
1288
1306
|
:param str code: unified currency code
|
1289
1307
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1290
1308
|
:returns dict: an `address structure <https://docs.ccxt.com/#/?id=address-structure>`
|
@@ -1315,6 +1333,7 @@ class bitfinex(Exchange, ImplicitAPI):
|
|
1315
1333
|
def fetch_deposits_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
1316
1334
|
"""
|
1317
1335
|
fetch history of deposits and withdrawals
|
1336
|
+
:see: https://docs.bitfinex.com/v1/reference/rest-auth-deposit-withdrawal-history
|
1318
1337
|
:param str code: unified currency code for the currency of the deposit/withdrawals
|
1319
1338
|
:param int [since]: timestamp in ms of the earliest deposit/withdrawal, default is None
|
1320
1339
|
:param int [limit]: max number of deposit/withdrawals to return, default is None
|
@@ -1444,6 +1463,7 @@ class bitfinex(Exchange, ImplicitAPI):
|
|
1444
1463
|
def withdraw(self, code: str, amount: float, address, tag=None, params={}):
|
1445
1464
|
"""
|
1446
1465
|
make a withdrawal
|
1466
|
+
:see: https://docs.bitfinex.com/v1/reference/rest-auth-withdrawal
|
1447
1467
|
:param str code: unified currency code
|
1448
1468
|
:param float amount: the amount to withdraw
|
1449
1469
|
:param str address: the address to withdraw to
|
@@ -1489,6 +1509,7 @@ class bitfinex(Exchange, ImplicitAPI):
|
|
1489
1509
|
def fetch_positions(self, symbols: Strings = None, params={}):
|
1490
1510
|
"""
|
1491
1511
|
fetch all open positions
|
1512
|
+
:see: https://docs.bitfinex.com/v1/reference/rest-auth-active-positions
|
1492
1513
|
:param str[]|None symbols: list of unified market symbols
|
1493
1514
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1494
1515
|
:returns dict[]: a list of `position structure <https://docs.ccxt.com/#/?id=position-structure>`
|
ccxt/bitfinex2.py
CHANGED
@@ -153,149 +153,149 @@ class bitfinex2(Exchange, ImplicitAPI):
|
|
153
153
|
'api': {
|
154
154
|
'public': {
|
155
155
|
'get': {
|
156
|
-
'conf/{config}': 2.
|
157
|
-
'conf/pub:{action}:{object}': 2.
|
158
|
-
'conf/pub:{action}:{object}:{detail}': 2.
|
159
|
-
'conf/pub:map:{object}': 2.
|
160
|
-
'conf/pub:map:{object}:{detail}': 2.
|
161
|
-
'conf/pub:map:currency:{detail}': 2.
|
162
|
-
'conf/pub:map:currency:sym': 2.
|
163
|
-
'conf/pub:map:currency:label': 2.
|
164
|
-
'conf/pub:map:currency:unit': 2.
|
165
|
-
'conf/pub:map:currency:undl': 2.
|
166
|
-
'conf/pub:map:currency:pool': 2.
|
167
|
-
'conf/pub:map:currency:explorer': 2.
|
168
|
-
'conf/pub:map:currency:tx:fee': 2.
|
169
|
-
'conf/pub:map:tx:method': 2.
|
170
|
-
'conf/pub:list:{object}': 2.
|
171
|
-
'conf/pub:list:{object}:{detail}': 2.
|
172
|
-
'conf/pub:list:currency': 2.
|
173
|
-
'conf/pub:list:pair:exchange': 2.
|
174
|
-
'conf/pub:list:pair:margin': 2.
|
175
|
-
'conf/pub:list:pair:futures': 2.
|
176
|
-
'conf/pub:list:competitions': 2.
|
177
|
-
'conf/pub:info:{object}': 2.
|
178
|
-
'conf/pub:info:{object}:{detail}': 2.
|
179
|
-
'conf/pub:info:pair': 2.
|
180
|
-
'conf/pub:info:pair:futures': 2.
|
181
|
-
'conf/pub:info:tx:status': 2.
|
182
|
-
'conf/pub:fees': 2.
|
156
|
+
'conf/{config}': 2.7, # 90 requests a minute, 90/60 = 1.5, 1000 / (250 * 2.66) = 1.503, use 2.7 instead of 2.66 to ensure rateLimitExceeded is not triggered
|
157
|
+
'conf/pub:{action}:{object}': 2.7,
|
158
|
+
'conf/pub:{action}:{object}:{detail}': 2.7,
|
159
|
+
'conf/pub:map:{object}': 2.7,
|
160
|
+
'conf/pub:map:{object}:{detail}': 2.7,
|
161
|
+
'conf/pub:map:currency:{detail}': 2.7,
|
162
|
+
'conf/pub:map:currency:sym': 2.7, # maps symbols to their API symbols, BAB > BCH
|
163
|
+
'conf/pub:map:currency:label': 2.7, # verbose friendly names, BNT > Bancor
|
164
|
+
'conf/pub:map:currency:unit': 2.7, # maps symbols to unit of measure where applicable
|
165
|
+
'conf/pub:map:currency:undl': 2.7, # maps derivatives symbols to their underlying currency
|
166
|
+
'conf/pub:map:currency:pool': 2.7, # maps symbols to underlying network/protocol they operate on
|
167
|
+
'conf/pub:map:currency:explorer': 2.7, # maps symbols to their recognised block explorer URLs
|
168
|
+
'conf/pub:map:currency:tx:fee': 2.7, # maps currencies to their withdrawal fees https://github.com/ccxt/ccxt/issues/7745
|
169
|
+
'conf/pub:map:tx:method': 2.7,
|
170
|
+
'conf/pub:list:{object}': 2.7,
|
171
|
+
'conf/pub:list:{object}:{detail}': 2.7,
|
172
|
+
'conf/pub:list:currency': 2.7,
|
173
|
+
'conf/pub:list:pair:exchange': 2.7,
|
174
|
+
'conf/pub:list:pair:margin': 2.7,
|
175
|
+
'conf/pub:list:pair:futures': 2.7,
|
176
|
+
'conf/pub:list:competitions': 2.7,
|
177
|
+
'conf/pub:info:{object}': 2.7,
|
178
|
+
'conf/pub:info:{object}:{detail}': 2.7,
|
179
|
+
'conf/pub:info:pair': 2.7,
|
180
|
+
'conf/pub:info:pair:futures': 2.7,
|
181
|
+
'conf/pub:info:tx:status': 2.7, # [deposit, withdrawal] statuses 1 = active, 0 = maintenance
|
182
|
+
'conf/pub:fees': 2.7,
|
183
183
|
'platform/status': 8, # 30 requests per minute = 0.5 requests per second =>( 1000ms / rateLimit ) / 0.5 = 8
|
184
|
-
'tickers': 2.
|
185
|
-
'ticker/{symbol}': 2.
|
186
|
-
'tickers/hist': 2.
|
187
|
-
'trades/{symbol}/hist': 2.
|
184
|
+
'tickers': 2.7, # 90 requests a minute = 1.5 requests per second =>( 1000 / rateLimit ) / 1.5 = 2.666666666
|
185
|
+
'ticker/{symbol}': 2.7,
|
186
|
+
'tickers/hist': 2.7,
|
187
|
+
'trades/{symbol}/hist': 2.7,
|
188
188
|
'book/{symbol}/{precision}': 1, # 240 requests a minute
|
189
189
|
'book/{symbol}/P0': 1,
|
190
190
|
'book/{symbol}/P1': 1,
|
191
191
|
'book/{symbol}/P2': 1,
|
192
192
|
'book/{symbol}/P3': 1,
|
193
193
|
'book/{symbol}/R0': 1,
|
194
|
-
'stats1/{key}:{size}:{symbol}:{side}/{section}': 2.
|
195
|
-
'stats1/{key}:{size}:{symbol}:{side}/last': 2.
|
196
|
-
'stats1/{key}:{size}:{symbol}:{side}/hist': 2.
|
197
|
-
'stats1/{key}:{size}:{symbol}/{section}': 2.
|
198
|
-
'stats1/{key}:{size}:{symbol}/last': 2.
|
199
|
-
'stats1/{key}:{size}:{symbol}/hist': 2.
|
200
|
-
'stats1/{key}:{size}:{symbol}:long/last': 2.
|
201
|
-
'stats1/{key}:{size}:{symbol}:long/hist': 2.
|
202
|
-
'stats1/{key}:{size}:{symbol}:short/last': 2.
|
203
|
-
'stats1/{key}:{size}:{symbol}:short/hist': 2.
|
204
|
-
'candles/trade:{timeframe}:{symbol}:{period}/{section}': 2.
|
205
|
-
'candles/trade:{timeframe}:{symbol}/{section}': 2.
|
206
|
-
'candles/trade:{timeframe}:{symbol}/last': 2.
|
207
|
-
'candles/trade:{timeframe}:{symbol}/hist': 2.
|
208
|
-
'status/{type}': 2.
|
209
|
-
'status/deriv': 2.
|
210
|
-
'status/deriv/{symbol}/hist': 2.
|
194
|
+
'stats1/{key}:{size}:{symbol}:{side}/{section}': 2.7,
|
195
|
+
'stats1/{key}:{size}:{symbol}:{side}/last': 2.7,
|
196
|
+
'stats1/{key}:{size}:{symbol}:{side}/hist': 2.7,
|
197
|
+
'stats1/{key}:{size}:{symbol}/{section}': 2.7,
|
198
|
+
'stats1/{key}:{size}:{symbol}/last': 2.7,
|
199
|
+
'stats1/{key}:{size}:{symbol}/hist': 2.7,
|
200
|
+
'stats1/{key}:{size}:{symbol}:long/last': 2.7,
|
201
|
+
'stats1/{key}:{size}:{symbol}:long/hist': 2.7,
|
202
|
+
'stats1/{key}:{size}:{symbol}:short/last': 2.7,
|
203
|
+
'stats1/{key}:{size}:{symbol}:short/hist': 2.7,
|
204
|
+
'candles/trade:{timeframe}:{symbol}:{period}/{section}': 2.7,
|
205
|
+
'candles/trade:{timeframe}:{symbol}/{section}': 2.7,
|
206
|
+
'candles/trade:{timeframe}:{symbol}/last': 2.7,
|
207
|
+
'candles/trade:{timeframe}:{symbol}/hist': 2.7,
|
208
|
+
'status/{type}': 2.7,
|
209
|
+
'status/deriv': 2.7,
|
210
|
+
'status/deriv/{symbol}/hist': 2.7,
|
211
211
|
'liquidations/hist': 80, # 3 requests a minute = 0.05 requests a second =>( 1000ms / rateLimit ) / 0.05 = 80
|
212
|
-
'rankings/{key}:{timeframe}:{symbol}/{section}': 2.
|
213
|
-
'rankings/{key}:{timeframe}:{symbol}/hist': 2.
|
214
|
-
'pulse/hist': 2.
|
215
|
-
'pulse/profile/{nickname}': 2.
|
212
|
+
'rankings/{key}:{timeframe}:{symbol}/{section}': 2.7,
|
213
|
+
'rankings/{key}:{timeframe}:{symbol}/hist': 2.7,
|
214
|
+
'pulse/hist': 2.7,
|
215
|
+
'pulse/profile/{nickname}': 2.7,
|
216
216
|
'funding/stats/{symbol}/hist': 10, # ratelimit not in docs
|
217
217
|
},
|
218
218
|
'post': {
|
219
|
-
'calc/trade/avg': 2.
|
220
|
-
'calc/fx': 2.
|
219
|
+
'calc/trade/avg': 2.7,
|
220
|
+
'calc/fx': 2.7,
|
221
221
|
},
|
222
222
|
},
|
223
223
|
'private': {
|
224
224
|
'post': {
|
225
225
|
# 'auth/r/orders/{symbol}/new', # outdated
|
226
226
|
# 'auth/r/stats/perf:{timeframe}/hist', # outdated
|
227
|
-
'auth/r/wallets': 2.
|
228
|
-
'auth/r/wallets/hist': 2.
|
229
|
-
'auth/r/orders': 2.
|
230
|
-
'auth/r/orders/{symbol}': 2.
|
231
|
-
'auth/w/order/submit': 2.
|
232
|
-
'auth/w/order/update': 2.
|
233
|
-
'auth/w/order/cancel': 2.
|
234
|
-
'auth/w/order/multi': 2.
|
235
|
-
'auth/w/order/cancel/multi': 2.
|
236
|
-
'auth/r/orders/{symbol}/hist': 2.
|
237
|
-
'auth/r/orders/hist': 2.
|
238
|
-
'auth/r/order/{symbol}:{id}/trades': 2.
|
239
|
-
'auth/r/trades/{symbol}/hist': 2.
|
240
|
-
'auth/r/trades/hist': 2.
|
241
|
-
'auth/r/ledgers/{currency}/hist': 2.
|
242
|
-
'auth/r/ledgers/hist': 2.
|
243
|
-
'auth/r/info/margin/{key}': 2.
|
244
|
-
'auth/r/info/margin/base': 2.
|
245
|
-
'auth/r/info/margin/sym_all': 2.
|
246
|
-
'auth/r/positions': 2.
|
247
|
-
'auth/w/position/claim': 2.
|
248
|
-
'auth/w/position/increase:': 2.
|
249
|
-
'auth/r/position/increase/info': 2.
|
250
|
-
'auth/r/positions/hist': 2.
|
251
|
-
'auth/r/positions/audit': 2.
|
252
|
-
'auth/r/positions/snap': 2.
|
253
|
-
'auth/w/deriv/collateral/set': 2.
|
254
|
-
'auth/w/deriv/collateral/limits': 2.
|
255
|
-
'auth/r/funding/offers': 2.
|
256
|
-
'auth/r/funding/offers/{symbol}': 2.
|
257
|
-
'auth/w/funding/offer/submit': 2.
|
258
|
-
'auth/w/funding/offer/cancel': 2.
|
259
|
-
'auth/w/funding/offer/cancel/all': 2.
|
260
|
-
'auth/w/funding/close': 2.
|
261
|
-
'auth/w/funding/auto': 2.
|
262
|
-
'auth/w/funding/keep': 2.
|
263
|
-
'auth/r/funding/offers/{symbol}/hist': 2.
|
264
|
-
'auth/r/funding/offers/hist': 2.
|
265
|
-
'auth/r/funding/loans': 2.
|
266
|
-
'auth/r/funding/loans/hist': 2.
|
267
|
-
'auth/r/funding/loans/{symbol}': 2.
|
268
|
-
'auth/r/funding/loans/{symbol}/hist': 2.
|
269
|
-
'auth/r/funding/credits': 2.
|
270
|
-
'auth/r/funding/credits/hist': 2.
|
271
|
-
'auth/r/funding/credits/{symbol}': 2.
|
272
|
-
'auth/r/funding/credits/{symbol}/hist': 2.
|
273
|
-
'auth/r/funding/trades/{symbol}/hist': 2.
|
274
|
-
'auth/r/funding/trades/hist': 2.
|
275
|
-
'auth/r/info/funding/{key}': 2.
|
276
|
-
'auth/r/info/user': 2.
|
277
|
-
'auth/r/summary': 2.
|
278
|
-
'auth/r/logins/hist': 2.
|
279
|
-
'auth/r/permissions': 2.
|
280
|
-
'auth/w/token': 2.
|
281
|
-
'auth/r/audit/hist': 2.
|
282
|
-
'auth/w/transfer': 2.
|
227
|
+
'auth/r/wallets': 2.7,
|
228
|
+
'auth/r/wallets/hist': 2.7,
|
229
|
+
'auth/r/orders': 2.7,
|
230
|
+
'auth/r/orders/{symbol}': 2.7,
|
231
|
+
'auth/w/order/submit': 2.7,
|
232
|
+
'auth/w/order/update': 2.7,
|
233
|
+
'auth/w/order/cancel': 2.7,
|
234
|
+
'auth/w/order/multi': 2.7,
|
235
|
+
'auth/w/order/cancel/multi': 2.7,
|
236
|
+
'auth/r/orders/{symbol}/hist': 2.7,
|
237
|
+
'auth/r/orders/hist': 2.7,
|
238
|
+
'auth/r/order/{symbol}:{id}/trades': 2.7,
|
239
|
+
'auth/r/trades/{symbol}/hist': 2.7,
|
240
|
+
'auth/r/trades/hist': 2.7,
|
241
|
+
'auth/r/ledgers/{currency}/hist': 2.7,
|
242
|
+
'auth/r/ledgers/hist': 2.7,
|
243
|
+
'auth/r/info/margin/{key}': 2.7,
|
244
|
+
'auth/r/info/margin/base': 2.7,
|
245
|
+
'auth/r/info/margin/sym_all': 2.7,
|
246
|
+
'auth/r/positions': 2.7,
|
247
|
+
'auth/w/position/claim': 2.7,
|
248
|
+
'auth/w/position/increase:': 2.7,
|
249
|
+
'auth/r/position/increase/info': 2.7,
|
250
|
+
'auth/r/positions/hist': 2.7,
|
251
|
+
'auth/r/positions/audit': 2.7,
|
252
|
+
'auth/r/positions/snap': 2.7,
|
253
|
+
'auth/w/deriv/collateral/set': 2.7,
|
254
|
+
'auth/w/deriv/collateral/limits': 2.7,
|
255
|
+
'auth/r/funding/offers': 2.7,
|
256
|
+
'auth/r/funding/offers/{symbol}': 2.7,
|
257
|
+
'auth/w/funding/offer/submit': 2.7,
|
258
|
+
'auth/w/funding/offer/cancel': 2.7,
|
259
|
+
'auth/w/funding/offer/cancel/all': 2.7,
|
260
|
+
'auth/w/funding/close': 2.7,
|
261
|
+
'auth/w/funding/auto': 2.7,
|
262
|
+
'auth/w/funding/keep': 2.7,
|
263
|
+
'auth/r/funding/offers/{symbol}/hist': 2.7,
|
264
|
+
'auth/r/funding/offers/hist': 2.7,
|
265
|
+
'auth/r/funding/loans': 2.7,
|
266
|
+
'auth/r/funding/loans/hist': 2.7,
|
267
|
+
'auth/r/funding/loans/{symbol}': 2.7,
|
268
|
+
'auth/r/funding/loans/{symbol}/hist': 2.7,
|
269
|
+
'auth/r/funding/credits': 2.7,
|
270
|
+
'auth/r/funding/credits/hist': 2.7,
|
271
|
+
'auth/r/funding/credits/{symbol}': 2.7,
|
272
|
+
'auth/r/funding/credits/{symbol}/hist': 2.7,
|
273
|
+
'auth/r/funding/trades/{symbol}/hist': 2.7,
|
274
|
+
'auth/r/funding/trades/hist': 2.7,
|
275
|
+
'auth/r/info/funding/{key}': 2.7,
|
276
|
+
'auth/r/info/user': 2.7,
|
277
|
+
'auth/r/summary': 2.7,
|
278
|
+
'auth/r/logins/hist': 2.7,
|
279
|
+
'auth/r/permissions': 2.7,
|
280
|
+
'auth/w/token': 2.7,
|
281
|
+
'auth/r/audit/hist': 2.7,
|
282
|
+
'auth/w/transfer': 2.7, # ratelimit not in docs...
|
283
283
|
'auth/w/deposit/address': 24, # 10 requests a minute = 0.166 requests per second =>( 1000ms / rateLimit ) / 0.166 = 24
|
284
284
|
'auth/w/deposit/invoice': 24, # ratelimit not in docs
|
285
285
|
'auth/w/withdraw': 24, # ratelimit not in docs
|
286
|
-
'auth/r/movements/{currency}/hist': 2.
|
287
|
-
'auth/r/movements/hist': 2.
|
288
|
-
'auth/r/alerts': 5.
|
289
|
-
'auth/w/alert/set': 2.
|
290
|
-
'auth/w/alert/price:{symbol}:{price}/del': 2.
|
291
|
-
'auth/w/alert/{type}:{symbol}:{price}/del': 2.
|
292
|
-
'auth/calc/order/avail': 2.
|
293
|
-
'auth/w/settings/set': 2.
|
294
|
-
'auth/r/settings': 2.
|
295
|
-
'auth/w/settings/del': 2.
|
296
|
-
'auth/r/pulse/hist': 2.
|
286
|
+
'auth/r/movements/{currency}/hist': 2.7,
|
287
|
+
'auth/r/movements/hist': 2.7,
|
288
|
+
'auth/r/alerts': 5.34, # 45 requests a minute = 0.75 requests per second =>( 1000ms / rateLimit ) / 0.749 => 5.34
|
289
|
+
'auth/w/alert/set': 2.7,
|
290
|
+
'auth/w/alert/price:{symbol}:{price}/del': 2.7,
|
291
|
+
'auth/w/alert/{type}:{symbol}:{price}/del': 2.7,
|
292
|
+
'auth/calc/order/avail': 2.7,
|
293
|
+
'auth/w/settings/set': 2.7,
|
294
|
+
'auth/r/settings': 2.7,
|
295
|
+
'auth/w/settings/del': 2.7,
|
296
|
+
'auth/r/pulse/hist': 2.7,
|
297
297
|
'auth/w/pulse/add': 16, # 15 requests a minute = 0.25 requests per second =>( 1000ms / rateLimit ) / 0.25 => 16
|
298
|
-
'auth/w/pulse/del': 2.
|
298
|
+
'auth/w/pulse/del': 2.7,
|
299
299
|
},
|
300
300
|
},
|
301
301
|
},
|
ccxt/bitget.py
CHANGED
@@ -3160,6 +3160,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
3160
3160
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
3161
3161
|
:param int [params.until]: timestamp in ms of the latest candle to fetch
|
3162
3162
|
:param boolean [params.paginate]: default False, when True will automatically paginate by calling self endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
3163
|
+
:param str [params.price]: *swap only* "mark"(to fetch mark price candles) or "index"(to fetch index price candles)
|
3163
3164
|
:returns int[][]: A list of candles ordered, open, high, low, close, volume
|
3164
3165
|
"""
|
3165
3166
|
self.load_markets()
|
@@ -3185,52 +3186,42 @@ class bitget(Exchange, ImplicitAPI):
|
|
3185
3186
|
params = self.omit(params, ['until', 'till'])
|
3186
3187
|
if limit is not None:
|
3187
3188
|
request['limit'] = limit
|
3188
|
-
|
3189
|
-
|
3190
|
-
|
3191
|
-
|
3192
|
-
|
3193
|
-
|
3194
|
-
|
3195
|
-
|
3196
|
-
|
3197
|
-
|
3189
|
+
if since is not None:
|
3190
|
+
request['startTime'] = since
|
3191
|
+
if since is not None:
|
3192
|
+
if limit is None:
|
3193
|
+
limit = 100 # exchange default
|
3194
|
+
duration = self.parse_timeframe(timeframe) * 1000
|
3195
|
+
request['endTime'] = self.sum(since, duration * (limit + 1)) - 1 # limit + 1)) - 1 is needed for when since is not the exact timestamp of a candle
|
3196
|
+
elif until is not None:
|
3197
|
+
request['endTime'] = until
|
3198
|
+
else:
|
3199
|
+
request['endTime'] = self.milliseconds()
|
3198
3200
|
response = None
|
3201
|
+
thirtyOneDaysAgo = self.milliseconds() - 2678400000
|
3199
3202
|
if market['spot']:
|
3200
|
-
if
|
3201
|
-
response = self.publicSpotGetV2SpotMarketCandles(self.extend(request, params))
|
3202
|
-
elif method == 'publicSpotGetV2SpotMarketHistoryCandles':
|
3203
|
-
if since is not None:
|
3204
|
-
if limit is None:
|
3205
|
-
limit = 100 # exchange default
|
3206
|
-
duration = self.parse_timeframe(timeframe) * 1000
|
3207
|
-
request['endTime'] = self.sum(since, duration * limit)
|
3208
|
-
elif until is not None:
|
3209
|
-
request['endTime'] = until
|
3210
|
-
else:
|
3211
|
-
request['endTime'] = self.milliseconds()
|
3203
|
+
if (since is not None) and (since < thirtyOneDaysAgo):
|
3212
3204
|
response = self.publicSpotGetV2SpotMarketHistoryCandles(self.extend(request, params))
|
3205
|
+
else:
|
3206
|
+
response = self.publicSpotGetV2SpotMarketCandles(self.extend(request, params))
|
3213
3207
|
else:
|
3214
|
-
swapOptions = self.safe_value(options, 'swap', {})
|
3215
|
-
defaultSwapMethod = self.safe_string(swapOptions, 'method', 'publicMixGetV2MixMarketCandles')
|
3216
|
-
swapMethod = self.safe_string(params, 'method', defaultSwapMethod)
|
3217
3208
|
priceType = self.safe_string(params, 'price')
|
3218
|
-
params = self.omit(params, ['
|
3209
|
+
params = self.omit(params, ['price'])
|
3219
3210
|
productType = None
|
3220
3211
|
productType, params = self.handle_product_type_and_params(market, params)
|
3221
3212
|
request['productType'] = productType
|
3222
|
-
if
|
3213
|
+
if priceType == 'mark':
|
3223
3214
|
response = self.publicMixGetV2MixMarketHistoryMarkCandles(self.extend(request, params))
|
3224
|
-
elif
|
3215
|
+
elif priceType == 'index':
|
3225
3216
|
response = self.publicMixGetV2MixMarketHistoryIndexCandles(self.extend(request, params))
|
3226
|
-
elif
|
3227
|
-
response = self.publicMixGetV2MixMarketCandles(self.extend(request, params))
|
3228
|
-
elif swapMethod == 'publicMixGetV2MixMarketHistoryCandles':
|
3217
|
+
elif (since is not None) and (since < thirtyOneDaysAgo):
|
3229
3218
|
response = self.publicMixGetV2MixMarketHistoryCandles(self.extend(request, params))
|
3219
|
+
else:
|
3220
|
+
response = self.publicMixGetV2MixMarketCandles(self.extend(request, params))
|
3230
3221
|
if response == '':
|
3231
3222
|
return [] # happens when a new token is listed
|
3232
3223
|
# [["1645911960000","39406","39407","39374.5","39379","35.526","1399132.341"]]
|
3233
|
-
data = self.
|
3224
|
+
data = self.safe_list(response, 'data', response)
|
3234
3225
|
return self.parse_ohlcvs(data, market, timeframe, since, limit)
|
3235
3226
|
|
3236
3227
|
def fetch_balance(self, params={}) -> Balances:
|
ccxt/bithumb.py
CHANGED
@@ -197,6 +197,7 @@ class bithumb(Exchange, ImplicitAPI):
|
|
197
197
|
def fetch_markets(self, params={}):
|
198
198
|
"""
|
199
199
|
retrieves data on all markets for bithumb
|
200
|
+
: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
|
200
201
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
201
202
|
:returns dict[]: an array of objects representing market data
|
202
203
|
"""
|
@@ -291,6 +292,7 @@ class bithumb(Exchange, ImplicitAPI):
|
|
291
292
|
def fetch_balance(self, params={}) -> Balances:
|
292
293
|
"""
|
293
294
|
query for balance and get the amount of funds available for trading or funds locked in orders
|
295
|
+
:see: https://apidocs.bithumb.com/reference/%EB%B3%B4%EC%9C%A0%EC%9E%90%EC%82%B0-%EC%A1%B0%ED%9A%8C
|
294
296
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
295
297
|
:returns dict: a `balance structure <https://docs.ccxt.com/#/?id=balance-structure>`
|
296
298
|
"""
|
@@ -304,6 +306,7 @@ class bithumb(Exchange, ImplicitAPI):
|
|
304
306
|
def fetch_order_book(self, symbol: str, limit: Int = None, params={}) -> OrderBook:
|
305
307
|
"""
|
306
308
|
fetches information on open orders with bid(buy) and ask(sell) prices, volumes and other data
|
309
|
+
:see: https://apidocs.bithumb.com/reference/%ED%98%B8%EA%B0%80-%EC%A0%95%EB%B3%B4-%EC%A1%B0%ED%9A%8C
|
307
310
|
:param str symbol: unified symbol of the market to fetch the order book for
|
308
311
|
:param int [limit]: the maximum amount of order book entries to return
|
309
312
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -393,6 +396,7 @@ class bithumb(Exchange, ImplicitAPI):
|
|
393
396
|
def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
|
394
397
|
"""
|
395
398
|
fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
399
|
+
: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
|
396
400
|
:param str[]|None symbols: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
397
401
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
398
402
|
:returns dict: a dictionary of `ticker structures <https://docs.ccxt.com/#/?id=ticker-structure>`
|
@@ -446,6 +450,7 @@ class bithumb(Exchange, ImplicitAPI):
|
|
446
450
|
def fetch_ticker(self, symbol: str, params={}) -> Ticker:
|
447
451
|
"""
|
448
452
|
fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
453
|
+
: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
|
449
454
|
:param str symbol: unified symbol of the market to fetch the ticker for
|
450
455
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
451
456
|
:returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
|
@@ -502,6 +507,7 @@ class bithumb(Exchange, ImplicitAPI):
|
|
502
507
|
def fetch_ohlcv(self, symbol: str, timeframe='1m', since: Int = None, limit: Int = None, params={}) -> List[list]:
|
503
508
|
"""
|
504
509
|
fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
510
|
+
:see: https://apidocs.bithumb.com/reference/candlestick-rest-api
|
505
511
|
:param str symbol: unified symbol of the market to fetch OHLCV data for
|
506
512
|
:param str timeframe: the length of time each candle represents
|
507
513
|
:param int [since]: timestamp in ms of the earliest candle to fetch
|
@@ -618,6 +624,7 @@ class bithumb(Exchange, ImplicitAPI):
|
|
618
624
|
def fetch_trades(self, symbol: str, since: Int = None, limit: Int = None, params={}) -> List[Trade]:
|
619
625
|
"""
|
620
626
|
get the list of most recent trades for a particular symbol
|
627
|
+
:see: https://apidocs.bithumb.com/reference/%EC%B5%9C%EA%B7%BC-%EC%B2%B4%EA%B2%B0-%EB%82%B4%EC%97%AD
|
621
628
|
:param str symbol: unified symbol of the market to fetch trades for
|
622
629
|
:param int [since]: timestamp in ms of the earliest trade to fetch
|
623
630
|
:param int [limit]: the maximum amount of trades to fetch
|
@@ -653,6 +660,9 @@ class bithumb(Exchange, ImplicitAPI):
|
|
653
660
|
def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
|
654
661
|
"""
|
655
662
|
create a trade order
|
663
|
+
: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
|
664
|
+
: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
|
665
|
+
: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
|
656
666
|
:param str symbol: unified symbol of the market to create an order in
|
657
667
|
:param str type: 'market' or 'limit'
|
658
668
|
:param str side: 'buy' or 'sell'
|
@@ -689,6 +699,7 @@ class bithumb(Exchange, ImplicitAPI):
|
|
689
699
|
def fetch_order(self, id: str, symbol: Str = None, params={}):
|
690
700
|
"""
|
691
701
|
fetches information on an order made by the user
|
702
|
+
: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
|
692
703
|
:param str symbol: unified symbol of the market the order was made in
|
693
704
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
694
705
|
:returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
@@ -838,6 +849,7 @@ class bithumb(Exchange, ImplicitAPI):
|
|
838
849
|
def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
839
850
|
"""
|
840
851
|
fetch all unfilled currently open orders
|
852
|
+
: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
|
841
853
|
:param str symbol: unified market symbol
|
842
854
|
:param int [since]: the earliest time in ms to fetch open orders for
|
843
855
|
:param int [limit]: the maximum number of open order structures to retrieve
|
@@ -881,6 +893,7 @@ class bithumb(Exchange, ImplicitAPI):
|
|
881
893
|
def cancel_order(self, id: str, symbol: Str = None, params={}):
|
882
894
|
"""
|
883
895
|
cancels an open order
|
896
|
+
:see: https://apidocs.bithumb.com/reference/%EC%A3%BC%EB%AC%B8-%EC%B7%A8%EC%86%8C%ED%95%98%EA%B8%B0
|
884
897
|
:param str id: order id
|
885
898
|
:param str symbol: unified symbol of the market the order was made in
|
886
899
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -912,6 +925,7 @@ class bithumb(Exchange, ImplicitAPI):
|
|
912
925
|
def withdraw(self, code: str, amount: float, address, tag=None, params={}):
|
913
926
|
"""
|
914
927
|
make a withdrawal
|
928
|
+
: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
|
915
929
|
:param str code: unified currency code
|
916
930
|
:param float amount: the amount to withdraw
|
917
931
|
:param str address: the address to withdraw to
|