ccxt 4.4.45__py2.py3-none-any.whl → 4.4.47__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/binance.py +1 -0
- ccxt/abstract/binancecoinm.py +1 -0
- ccxt/abstract/binanceus.py +1 -0
- ccxt/abstract/binanceusdm.py +1 -0
- ccxt/abstract/bybit.py +1 -0
- ccxt/ace.py +58 -0
- ccxt/alpaca.py +80 -0
- ccxt/ascendex.py +110 -3
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/ace.py +58 -0
- ccxt/async_support/alpaca.py +80 -0
- ccxt/async_support/ascendex.py +110 -3
- ccxt/async_support/base/exchange.py +1 -1
- ccxt/async_support/bigone.py +113 -4
- ccxt/async_support/binance.py +4 -5
- ccxt/async_support/binanceus.py +10 -0
- ccxt/async_support/bingx.py +1 -2
- ccxt/async_support/bit2c.py +56 -0
- ccxt/async_support/bitbank.py +58 -0
- ccxt/async_support/bitbns.py +60 -0
- ccxt/async_support/bitfinex.py +2 -3
- ccxt/async_support/bitfinex1.py +8 -0
- ccxt/async_support/bitflyer.py +71 -0
- ccxt/async_support/bitget.py +103 -40
- ccxt/async_support/bithumb.py +54 -0
- ccxt/async_support/bitmex.py +1 -2
- ccxt/async_support/bitopro.py +74 -0
- ccxt/async_support/bitrue.py +97 -17
- ccxt/async_support/bitso.py +59 -0
- ccxt/async_support/bitteam.py +73 -0
- ccxt/async_support/bitvavo.py +70 -2
- ccxt/async_support/bl3p.py +42 -0
- ccxt/async_support/blockchaincom.py +66 -2
- ccxt/async_support/blofin.py +87 -1
- ccxt/async_support/btcalpha.py +73 -0
- ccxt/async_support/btcbox.py +58 -0
- ccxt/async_support/btcmarkets.py +73 -0
- ccxt/async_support/btcturk.py +61 -0
- ccxt/async_support/bybit.py +87 -39
- ccxt/async_support/cex.py +57 -0
- ccxt/async_support/coinbase.py +1 -1
- ccxt/async_support/coinbaseexchange.py +76 -0
- ccxt/async_support/coinex.py +1 -2
- ccxt/async_support/delta.py +10 -6
- ccxt/async_support/gate.py +3 -4
- ccxt/async_support/hashkey.py +1 -2
- ccxt/async_support/hollaex.py +1 -1
- ccxt/async_support/htx.py +2 -4
- ccxt/async_support/hyperliquid.py +6 -7
- ccxt/async_support/krakenfutures.py +2 -0
- ccxt/async_support/lbank.py +1 -2
- ccxt/async_support/mexc.py +1 -0
- ccxt/async_support/okx.py +13 -9
- ccxt/async_support/onetrading.py +18 -3
- ccxt/async_support/oxfun.py +1 -2
- ccxt/async_support/whitebit.py +2 -2
- ccxt/async_support/woo.py +1 -2
- ccxt/async_support/woofipro.py +1 -2
- ccxt/base/errors.py +6 -0
- ccxt/base/exchange.py +16 -14
- ccxt/bigone.py +113 -4
- ccxt/binance.py +4 -5
- ccxt/binanceus.py +10 -0
- ccxt/bingx.py +1 -2
- ccxt/bit2c.py +56 -0
- ccxt/bitbank.py +58 -0
- ccxt/bitbns.py +60 -0
- ccxt/bitfinex.py +2 -3
- ccxt/bitfinex1.py +8 -0
- ccxt/bitflyer.py +71 -0
- ccxt/bitget.py +103 -40
- ccxt/bithumb.py +54 -0
- ccxt/bitmex.py +1 -2
- ccxt/bitopro.py +74 -0
- ccxt/bitrue.py +97 -17
- ccxt/bitso.py +59 -0
- ccxt/bitteam.py +73 -0
- ccxt/bitvavo.py +70 -2
- ccxt/bl3p.py +42 -0
- ccxt/blockchaincom.py +66 -2
- ccxt/blofin.py +87 -1
- ccxt/btcalpha.py +73 -0
- ccxt/btcbox.py +58 -0
- ccxt/btcmarkets.py +73 -0
- ccxt/btcturk.py +61 -0
- ccxt/bybit.py +87 -39
- ccxt/cex.py +57 -0
- ccxt/coinbase.py +1 -1
- ccxt/coinbaseexchange.py +76 -0
- ccxt/coinex.py +1 -2
- ccxt/delta.py +10 -6
- ccxt/gate.py +3 -4
- ccxt/hashkey.py +1 -2
- ccxt/hollaex.py +1 -1
- ccxt/htx.py +2 -4
- ccxt/hyperliquid.py +6 -7
- ccxt/krakenfutures.py +2 -0
- ccxt/lbank.py +1 -2
- ccxt/mexc.py +1 -0
- ccxt/okx.py +13 -9
- ccxt/onetrading.py +18 -3
- ccxt/oxfun.py +1 -2
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/bingx.py +3 -5
- ccxt/pro/bitget.py +2 -4
- ccxt/pro/coinex.py +1 -1
- ccxt/pro/xt.py +1 -1
- ccxt/test/tests_async.py +2 -0
- ccxt/test/tests_sync.py +2 -0
- ccxt/whitebit.py +2 -2
- ccxt/woo.py +1 -2
- ccxt/woofipro.py +1 -2
- {ccxt-4.4.45.dist-info → ccxt-4.4.47.dist-info}/METADATA +4 -5
- {ccxt-4.4.45.dist-info → ccxt-4.4.47.dist-info}/RECORD +118 -118
- {ccxt-4.4.45.dist-info → ccxt-4.4.47.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.45.dist-info → ccxt-4.4.47.dist-info}/WHEEL +0 -0
- {ccxt-4.4.45.dist-info → ccxt-4.4.47.dist-info}/top_level.txt +0 -0
ccxt/async_support/bybit.py
CHANGED
@@ -356,6 +356,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
356
356
|
'v5/account/contract-transaction-log': 1,
|
357
357
|
'v5/account/smp-group': 1,
|
358
358
|
'v5/account/mmp-state': 5,
|
359
|
+
'v5/account/withdrawal': 5,
|
359
360
|
# asset
|
360
361
|
'v5/asset/exchange/query-coin-list': 0.5, # 100/s => cost = 50 / 100 = 0.5
|
361
362
|
'v5/asset/exchange/convert-result-query': 0.5, # 100/s => cost = 50 / 100 = 0.5
|
@@ -1073,8 +1074,78 @@ class bybit(Exchange, ImplicitAPI):
|
|
1073
1074
|
'ERC20': 'ETH',
|
1074
1075
|
'TRC20': 'TRX',
|
1075
1076
|
'BEP20': 'BSC',
|
1077
|
+
'SOL': 'SOL',
|
1078
|
+
'ACA': 'ACA',
|
1079
|
+
'ADA': 'ADA',
|
1080
|
+
'ALGO': 'ALGO',
|
1081
|
+
'APT': 'APTOS',
|
1082
|
+
'AR': 'AR',
|
1083
|
+
'ARBONE': 'ARBI',
|
1084
|
+
'AVAXC': 'CAVAX',
|
1085
|
+
'AVAXX': 'XAVAX',
|
1086
|
+
'ATOM': 'ATOM',
|
1087
|
+
'BCH': 'BCH',
|
1088
|
+
'BEP2': 'BNB',
|
1089
|
+
'CHZ': 'CHZ',
|
1090
|
+
'DCR': 'DCR',
|
1091
|
+
'DGB': 'DGB',
|
1092
|
+
'DOGE': 'DOGE',
|
1093
|
+
'DOT': 'DOT',
|
1094
|
+
'EGLD': 'EGLD',
|
1095
|
+
'EOS': 'EOS',
|
1096
|
+
'ETC': 'ETC',
|
1097
|
+
'ETHF': 'ETHF',
|
1098
|
+
'ETHW': 'ETHW',
|
1099
|
+
'FIL': 'FIL',
|
1100
|
+
'STEP': 'FITFI',
|
1101
|
+
'FLOW': 'FLOW',
|
1102
|
+
'FTM': 'FTM',
|
1103
|
+
'GLMR': 'GLMR',
|
1104
|
+
'HBAR': 'HBAR',
|
1105
|
+
'HNT': 'HNT',
|
1106
|
+
'ICP': 'ICP',
|
1107
|
+
'ICX': 'ICX',
|
1108
|
+
'KDA': 'KDA',
|
1109
|
+
'KLAY': 'KLAY',
|
1110
|
+
'KMA': 'KMA',
|
1111
|
+
'KSM': 'KSM',
|
1112
|
+
'LTC': 'LTC',
|
1113
|
+
# 'TERRA': 'LUNANEW',
|
1114
|
+
# 'TERRACLASSIC': 'LUNA',
|
1115
|
+
'MATIC': 'MATIC',
|
1116
|
+
'MINA': 'MINA',
|
1117
|
+
'MOVR': 'MOVR',
|
1118
|
+
'NEAR': 'NEAR',
|
1119
|
+
'NEM': 'NEM',
|
1120
|
+
'OASYS': 'OAS',
|
1121
|
+
'OASIS': 'ROSE',
|
1076
1122
|
'OMNI': 'OMNI',
|
1077
|
-
'
|
1123
|
+
'ONE': 'ONE',
|
1124
|
+
'OPTIMISM': 'OP',
|
1125
|
+
'POKT': 'POKT',
|
1126
|
+
'QTUM': 'QTUM',
|
1127
|
+
'RVN': 'RVN',
|
1128
|
+
'SC': 'SC',
|
1129
|
+
'SCRT': 'SCRT',
|
1130
|
+
'STX': 'STX',
|
1131
|
+
'THETA': 'THETA',
|
1132
|
+
'TON': 'TON',
|
1133
|
+
'WAVES': 'WAVES',
|
1134
|
+
'WAX': 'WAXP',
|
1135
|
+
'XDC': 'XDC',
|
1136
|
+
'XEC': 'XEC',
|
1137
|
+
'XLM': 'XLM',
|
1138
|
+
'XRP': 'XRP',
|
1139
|
+
'XTZ': 'XTZ',
|
1140
|
+
'XYM': 'XYM',
|
1141
|
+
'ZEN': 'ZEN',
|
1142
|
+
'ZIL': 'ZIL',
|
1143
|
+
'ZKSYNC': 'ZKSYNC',
|
1144
|
+
# todo: uncomment after consensus
|
1145
|
+
# 'CADUCEUS': 'CMP',
|
1146
|
+
# 'KON': 'KON', # konpay, "konchain"
|
1147
|
+
# 'AURORA': 'AURORA',
|
1148
|
+
# 'BITCOINGOLD': 'BTG',
|
1078
1149
|
},
|
1079
1150
|
'networksById': {
|
1080
1151
|
'ETH': 'ERC20',
|
@@ -2630,8 +2701,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
2630
2701
|
timestamp = self.safe_integer(response, 'time')
|
2631
2702
|
for i in range(0, len(tickerList)):
|
2632
2703
|
tickerList[i]['timestamp'] = timestamp # will be removed inside the parser
|
2633
|
-
|
2634
|
-
return self.filter_by_array(result, 'symbol', symbols)
|
2704
|
+
return self.parse_funding_rates(tickerList, symbols)
|
2635
2705
|
|
2636
2706
|
async def fetch_funding_rate_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
2637
2707
|
"""
|
@@ -3140,7 +3210,11 @@ class bybit(Exchange, ImplicitAPI):
|
|
3140
3210
|
if (loan is not None) and (interest is not None):
|
3141
3211
|
account['debt'] = Precise.string_add(loan, interest)
|
3142
3212
|
account['total'] = self.safe_string(coinEntry, 'walletBalance')
|
3143
|
-
|
3213
|
+
free = self.safe_string_2(coinEntry, 'availableToWithdraw', 'free')
|
3214
|
+
if free is not None:
|
3215
|
+
account['free'] = free
|
3216
|
+
else:
|
3217
|
+
account['used'] = self.safe_string(coinEntry, 'locked')
|
3144
3218
|
# account['used'] = self.safe_string(coinEntry, 'locked')
|
3145
3219
|
currencyId = self.safe_string(coinEntry, 'coin')
|
3146
3220
|
code = self.safe_currency_code(currencyId)
|
@@ -5059,12 +5133,11 @@ classic accounts only/ spot not supported* fetches information on an order made
|
|
5059
5133
|
address = self.safe_string(depositAddress, 'addressDeposit')
|
5060
5134
|
tag = self.safe_string(depositAddress, 'tagDeposit')
|
5061
5135
|
code = self.safe_string(currency, 'code')
|
5062
|
-
chain = self.safe_string(depositAddress, 'chain')
|
5063
5136
|
self.check_address(address)
|
5064
5137
|
return {
|
5065
5138
|
'info': depositAddress,
|
5066
5139
|
'currency': code,
|
5067
|
-
'network': chain,
|
5140
|
+
'network': self.network_id_to_code(self.safe_string(depositAddress, 'chain'), code),
|
5068
5141
|
'address': address,
|
5069
5142
|
'tag': tag,
|
5070
5143
|
}
|
@@ -5084,6 +5157,10 @@ classic accounts only/ spot not supported* fetches information on an order made
|
|
5084
5157
|
request: dict = {
|
5085
5158
|
'coin': currency['id'],
|
5086
5159
|
}
|
5160
|
+
networkCode = None
|
5161
|
+
networkCode, params = self.handle_network_code_and_params(params)
|
5162
|
+
if networkCode is not None:
|
5163
|
+
request['chainType'] = self.network_code_to_id(networkCode, code)
|
5087
5164
|
response = await self.privateGetV5AssetDepositQueryAddress(self.extend(request, params))
|
5088
5165
|
#
|
5089
5166
|
# {
|
@@ -5124,40 +5201,11 @@ classic accounts only/ spot not supported* fetches information on an order made
|
|
5124
5201
|
:returns dict: an `address structure <https://docs.ccxt.com/#/?id=address-structure>`
|
5125
5202
|
"""
|
5126
5203
|
await self.load_markets()
|
5127
|
-
networkCode, query = self.handle_network_code_and_params(params)
|
5128
|
-
networkId = self.network_code_to_id(networkCode)
|
5129
5204
|
currency = self.currency(code)
|
5130
|
-
|
5131
|
-
|
5132
|
-
|
5133
|
-
|
5134
|
-
request['chainType'] = networkId
|
5135
|
-
response = await self.privateGetV5AssetDepositQueryAddress(self.extend(request, query))
|
5136
|
-
#
|
5137
|
-
# {
|
5138
|
-
# "retCode": 0,
|
5139
|
-
# "retMsg": "success",
|
5140
|
-
# "result": {
|
5141
|
-
# "coin": "USDT",
|
5142
|
-
# "chains": [
|
5143
|
-
# {
|
5144
|
-
# "chainType": "ERC20",
|
5145
|
-
# "addressDeposit": "0xd9e1cd77afa0e50b452a62fbb68a3340602286c3",
|
5146
|
-
# "tagDeposit": "",
|
5147
|
-
# "chain": "ETH"
|
5148
|
-
# }
|
5149
|
-
# ]
|
5150
|
-
# },
|
5151
|
-
# "retExtInfo": {},
|
5152
|
-
# "time": 1672192792860
|
5153
|
-
# }
|
5154
|
-
#
|
5155
|
-
result = self.safe_dict(response, 'result', {})
|
5156
|
-
chains = self.safe_list(result, 'chains', [])
|
5157
|
-
chainsIndexedById = self.index_by(chains, 'chain')
|
5158
|
-
selectedNetworkId = self.select_network_id_from_raw_networks(code, networkCode, chainsIndexedById)
|
5159
|
-
addressObject = self.safe_dict(chainsIndexedById, selectedNetworkId, {})
|
5160
|
-
return self.parse_deposit_address(addressObject, currency)
|
5205
|
+
networkCode, paramsOmited = self.handle_network_code_and_params(params)
|
5206
|
+
indexedAddresses = await self.fetch_deposit_addresses_by_network(code, paramsOmited)
|
5207
|
+
selectedNetworkCode = self.select_network_code_from_unified_networks(currency['code'], networkCode, indexedAddresses)
|
5208
|
+
return indexedAddresses[selectedNetworkCode]
|
5161
5209
|
|
5162
5210
|
async def fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
5163
5211
|
"""
|
ccxt/async_support/cex.py
CHANGED
@@ -119,6 +119,63 @@ class cex(Exchange, ImplicitAPI):
|
|
119
119
|
},
|
120
120
|
},
|
121
121
|
},
|
122
|
+
'features': {
|
123
|
+
'spot': {
|
124
|
+
'sandbox': False,
|
125
|
+
'createOrder': {
|
126
|
+
'marginMode': False,
|
127
|
+
'triggerPrice': True,
|
128
|
+
'triggerPriceType': None,
|
129
|
+
'triggerDirection': False,
|
130
|
+
'stopLossPrice': False, # todo
|
131
|
+
'takeProfitPrice': False, # todo
|
132
|
+
'attachedStopLossTakeProfit': None,
|
133
|
+
'timeInForce': {
|
134
|
+
'IOC': True,
|
135
|
+
'FOK': True,
|
136
|
+
'PO': False, # todo check
|
137
|
+
'GTD': True,
|
138
|
+
},
|
139
|
+
'hedged': False,
|
140
|
+
'leverage': False,
|
141
|
+
'marketBuyRequiresPrice': False,
|
142
|
+
'marketBuyByCost': True, # todo check
|
143
|
+
'selfTradePrevention': False,
|
144
|
+
'trailing': False,
|
145
|
+
'iceberg': False,
|
146
|
+
},
|
147
|
+
'createOrders': None,
|
148
|
+
'fetchMyTrades': None,
|
149
|
+
'fetchOrder': None,
|
150
|
+
'fetchOpenOrders': {
|
151
|
+
'marginMode': False,
|
152
|
+
'limit': 1000,
|
153
|
+
'trigger': False,
|
154
|
+
'trailing': False,
|
155
|
+
},
|
156
|
+
'fetchOrders': None,
|
157
|
+
'fetchClosedOrders': {
|
158
|
+
'marginMode': False,
|
159
|
+
'limit': 1000,
|
160
|
+
'daysBack': 100000,
|
161
|
+
'daysBackCanceled': 1,
|
162
|
+
'untilDays': 100000,
|
163
|
+
'trigger': False,
|
164
|
+
'trailing': False,
|
165
|
+
},
|
166
|
+
'fetchOHLCV': {
|
167
|
+
'limit': 1000,
|
168
|
+
},
|
169
|
+
},
|
170
|
+
'swap': {
|
171
|
+
'linear': None,
|
172
|
+
'inverse': None,
|
173
|
+
},
|
174
|
+
'future': {
|
175
|
+
'linear': None,
|
176
|
+
'inverse': None,
|
177
|
+
},
|
178
|
+
},
|
122
179
|
'precisionMode': TICK_SIZE,
|
123
180
|
'exceptions': {
|
124
181
|
'exact': {},
|
ccxt/async_support/coinbase.py
CHANGED
@@ -2383,7 +2383,7 @@ class coinbase(Exchange, ImplicitAPI):
|
|
2383
2383
|
request, params = await self.prepare_account_request_with_currency_code(code, limit, params)
|
2384
2384
|
# for pagination use parameter 'starting_after'
|
2385
2385
|
# the value for the next page can be obtained from the result of the previous call in the 'pagination' field
|
2386
|
-
# eg: instance.
|
2386
|
+
# eg: instance.last_http_response -> pagination.next_starting_after
|
2387
2387
|
response = await self.v2PrivateGetAccountsAccountIdTransactions(self.extend(request, params))
|
2388
2388
|
ledger = self.parse_ledger(response['data'], currency, since, limit)
|
2389
2389
|
length = len(ledger)
|
@@ -225,6 +225,82 @@ class coinbaseexchange(Exchange, ImplicitAPI):
|
|
225
225
|
},
|
226
226
|
},
|
227
227
|
},
|
228
|
+
'features': {
|
229
|
+
'default': {
|
230
|
+
'sandbox': True,
|
231
|
+
'createOrder': {
|
232
|
+
'marginMode': True,
|
233
|
+
'triggerPrice': True,
|
234
|
+
'triggerPriceType': None,
|
235
|
+
'triggerDirection': False,
|
236
|
+
'stopLossPrice': False, # todo
|
237
|
+
'takeProfitPrice': False, # todo
|
238
|
+
'attachedStopLossTakeProfit': None,
|
239
|
+
'timeInForce': {
|
240
|
+
'IOC': True,
|
241
|
+
'FOK': True,
|
242
|
+
'PO': True,
|
243
|
+
'GTD': True,
|
244
|
+
},
|
245
|
+
'hedged': False,
|
246
|
+
'trailing': False,
|
247
|
+
'leverage': False,
|
248
|
+
'marketBuyByCost': False,
|
249
|
+
'marketBuyRequiresPrice': False,
|
250
|
+
'selfTradePrevention': False,
|
251
|
+
'iceberg': True, # todo: implement
|
252
|
+
},
|
253
|
+
'createOrders': None,
|
254
|
+
'fetchMyTrades': {
|
255
|
+
'marginMode': False,
|
256
|
+
'limit': 100,
|
257
|
+
'daysBack': 100000,
|
258
|
+
'untilDays': 100000,
|
259
|
+
},
|
260
|
+
'fetchOrder': {
|
261
|
+
'marginMode': False,
|
262
|
+
'trigger': False,
|
263
|
+
'trailing': False,
|
264
|
+
},
|
265
|
+
'fetchOpenOrders': {
|
266
|
+
'marginMode': False,
|
267
|
+
'limit': 100,
|
268
|
+
'trigger': False,
|
269
|
+
'trailing': False,
|
270
|
+
},
|
271
|
+
'fetchOrders': {
|
272
|
+
'marginMode': False,
|
273
|
+
'limit': 100,
|
274
|
+
'daysBack': 100000,
|
275
|
+
'untilDays': 100000,
|
276
|
+
'trigger': False,
|
277
|
+
'trailing': False,
|
278
|
+
},
|
279
|
+
'fetchClosedOrders': {
|
280
|
+
'marginMode': False,
|
281
|
+
'limit': 100,
|
282
|
+
'daysBack': 100000,
|
283
|
+
'daysBackCanceled': 1,
|
284
|
+
'untilDays': 100000,
|
285
|
+
'trigger': False,
|
286
|
+
'trailing': False,
|
287
|
+
},
|
288
|
+
'fetchOHLCV': {
|
289
|
+
'limit': 300,
|
290
|
+
},
|
291
|
+
},
|
292
|
+
'spot': {
|
293
|
+
'extends': 'default',
|
294
|
+
},
|
295
|
+
'swap': {
|
296
|
+
'linear': None,
|
297
|
+
'inverse': None,
|
298
|
+
},
|
299
|
+
'future': {
|
300
|
+
'linear': None,
|
301
|
+
'inverse': None,
|
302
|
+
},
|
303
|
+
},
|
228
304
|
'exceptions': {
|
229
305
|
'exact': {
|
230
306
|
'Insufficient funds': InsufficientFunds,
|
ccxt/async_support/coinex.py
CHANGED
@@ -4589,8 +4589,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
4589
4589
|
# }
|
4590
4590
|
#
|
4591
4591
|
data = self.safe_list(response, 'data', [])
|
4592
|
-
|
4593
|
-
return self.filter_by_array(result, 'symbol', symbols)
|
4592
|
+
return self.parse_funding_rates(data, symbols)
|
4594
4593
|
|
4595
4594
|
async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
|
4596
4595
|
"""
|
ccxt/async_support/delta.py
CHANGED
@@ -1446,13 +1446,14 @@ class delta(Exchange, ImplicitAPI):
|
|
1446
1446
|
"""
|
1447
1447
|
fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
1448
1448
|
|
1449
|
-
https://docs.delta.exchange/#
|
1449
|
+
https://docs.delta.exchange/#delta-exchange-api-v2-historical-ohlc-candles-sparklines
|
1450
1450
|
|
1451
1451
|
:param str symbol: unified symbol of the market to fetch OHLCV data for
|
1452
1452
|
:param str timeframe: the length of time each candle represents
|
1453
1453
|
:param int [since]: timestamp in ms of the earliest candle to fetch
|
1454
1454
|
:param int [limit]: the maximum amount of candles to fetch
|
1455
1455
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1456
|
+
:param str [params.until]: timestamp in ms of the latest candle to fetch
|
1456
1457
|
:returns int[][]: A list of candles ordered, open, high, low, close, volume
|
1457
1458
|
"""
|
1458
1459
|
await self.load_markets()
|
@@ -1462,14 +1463,18 @@ class delta(Exchange, ImplicitAPI):
|
|
1462
1463
|
}
|
1463
1464
|
duration = self.parse_timeframe(timeframe)
|
1464
1465
|
limit = limit if limit else 2000 # max 2000
|
1466
|
+
until = self.safe_integer_product(params, 'until', 0.001)
|
1467
|
+
untilIsDefined = (until is not None)
|
1468
|
+
if untilIsDefined:
|
1469
|
+
until = self.parse_to_int(until)
|
1465
1470
|
if since is None:
|
1466
|
-
end = self.seconds()
|
1471
|
+
end = until if untilIsDefined else self.seconds()
|
1467
1472
|
request['end'] = end
|
1468
1473
|
request['start'] = end - limit * duration
|
1469
1474
|
else:
|
1470
1475
|
start = self.parse_to_int(since / 1000)
|
1471
1476
|
request['start'] = start
|
1472
|
-
request['end'] = self.sum(start, limit * duration)
|
1477
|
+
request['end'] = until if untilIsDefined else self.sum(start, limit * duration)
|
1473
1478
|
price = self.safe_string(params, 'price')
|
1474
1479
|
if price == 'mark':
|
1475
1480
|
request['symbol'] = 'MARK:' + market['id']
|
@@ -1477,7 +1482,7 @@ class delta(Exchange, ImplicitAPI):
|
|
1477
1482
|
request['symbol'] = market['info']['spot_index']['symbol']
|
1478
1483
|
else:
|
1479
1484
|
request['symbol'] = market['id']
|
1480
|
-
params = self.omit(params, 'price')
|
1485
|
+
params = self.omit(params, ['price', 'until'])
|
1481
1486
|
response = await self.publicGetHistoryCandles(self.extend(request, params))
|
1482
1487
|
#
|
1483
1488
|
# {
|
@@ -2458,8 +2463,7 @@ class delta(Exchange, ImplicitAPI):
|
|
2458
2463
|
# }
|
2459
2464
|
#
|
2460
2465
|
rates = self.safe_list(response, 'result', [])
|
2461
|
-
|
2462
|
-
return self.filter_by_array(result, 'symbol', symbols)
|
2466
|
+
return self.parse_funding_rates(rates, symbols)
|
2463
2467
|
|
2464
2468
|
def parse_funding_rate(self, contract, market: Market = None) -> FundingRate:
|
2465
2469
|
#
|
ccxt/async_support/gate.py
CHANGED
@@ -735,7 +735,6 @@ class gate(Exchange, ImplicitAPI):
|
|
735
735
|
'takeProfitPrice': True,
|
736
736
|
'attachedStopLossTakeProfit': None,
|
737
737
|
'timeInForce': {
|
738
|
-
'GTC': True,
|
739
738
|
'IOC': True,
|
740
739
|
'FOK': True,
|
741
740
|
'PO': True,
|
@@ -1963,8 +1962,7 @@ class gate(Exchange, ImplicitAPI):
|
|
1963
1962
|
# }
|
1964
1963
|
# ]
|
1965
1964
|
#
|
1966
|
-
|
1967
|
-
return self.filter_by_array(result, 'symbol', symbols)
|
1965
|
+
return self.parse_funding_rates(response, symbols)
|
1968
1966
|
|
1969
1967
|
def parse_funding_rate(self, contract, market: Market = None) -> FundingRate:
|
1970
1968
|
#
|
@@ -2378,7 +2376,8 @@ class gate(Exchange, ImplicitAPI):
|
|
2378
2376
|
chainKeys = list(withdrawFixOnChains.keys())
|
2379
2377
|
for i in range(0, len(chainKeys)):
|
2380
2378
|
chainKey = chainKeys[i]
|
2381
|
-
|
2379
|
+
networkCode = self.network_id_to_code(chainKey, self.safe_string(fee, 'currency'))
|
2380
|
+
result['networks'][networkCode] = {
|
2382
2381
|
'withdraw': {
|
2383
2382
|
'fee': self.parse_number(withdrawFixOnChains[chainKey]),
|
2384
2383
|
'percentage': False,
|
ccxt/async_support/hashkey.py
CHANGED
@@ -3623,8 +3623,7 @@ class hashkey(Exchange, ImplicitAPI):
|
|
3623
3623
|
# {"symbol": "ETHUSDT-PERPETUAL", "rate": "0.0001", "nextSettleTime": "1722297600000"}
|
3624
3624
|
# ]
|
3625
3625
|
#
|
3626
|
-
|
3627
|
-
return self.filter_by_array(fundingRates, 'symbol', symbols)
|
3626
|
+
return self.parse_funding_rates(response, symbols)
|
3628
3627
|
|
3629
3628
|
def parse_funding_rate(self, contract, market: Market = None) -> FundingRate:
|
3630
3629
|
#
|
ccxt/async_support/hollaex.py
CHANGED
ccxt/async_support/htx.py
CHANGED
@@ -6780,8 +6780,7 @@ class htx(Exchange, ImplicitAPI):
|
|
6780
6780
|
# }
|
6781
6781
|
#
|
6782
6782
|
data = self.safe_value(response, 'data', [])
|
6783
|
-
|
6784
|
-
return self.filter_by_array(result, 'symbol', symbols)
|
6783
|
+
return self.parse_funding_rates(data, symbols)
|
6785
6784
|
|
6786
6785
|
async def fetch_borrow_interest(self, code: Str = None, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[BorrowInterest]:
|
6787
6786
|
"""
|
@@ -8098,8 +8097,7 @@ class htx(Exchange, ImplicitAPI):
|
|
8098
8097
|
# }
|
8099
8098
|
#
|
8100
8099
|
data = self.safe_list(response, 'data', [])
|
8101
|
-
|
8102
|
-
return self.filter_by_array(result, 'symbol', symbols)
|
8100
|
+
return self.parse_open_interests(data, symbols)
|
8103
8101
|
|
8104
8102
|
async def fetch_open_interest(self, symbol: str, params={}):
|
8105
8103
|
"""
|
@@ -239,7 +239,6 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
239
239
|
'takeProfitPrice': False,
|
240
240
|
'attachedStopLossTakeProfit': None,
|
241
241
|
'timeInForce': {
|
242
|
-
'GTC': True,
|
243
242
|
'IOC': True,
|
244
243
|
'FOK': False,
|
245
244
|
'PO': True,
|
@@ -968,8 +967,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
968
967
|
self.safe_dict(assetCtxs, i, {})
|
969
968
|
)
|
970
969
|
result.append(data)
|
971
|
-
|
972
|
-
return self.filter_by_array(funding_rates, 'symbol', symbols)
|
970
|
+
return self.parse_funding_rates(result, symbols)
|
973
971
|
|
974
972
|
def parse_funding_rate(self, info, market: Market = None) -> FundingRate:
|
975
973
|
#
|
@@ -1860,6 +1858,8 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
1860
1858
|
:returns dict[]: a list of `funding rate structures <https://docs.ccxt.com/#/?id=funding-rate-history-structure>`
|
1861
1859
|
"""
|
1862
1860
|
await self.load_markets()
|
1861
|
+
if symbol is None:
|
1862
|
+
raise ArgumentsRequired(self.id + ' fetchFundingRateHistory() requires a symbol argument')
|
1863
1863
|
market = self.market(symbol)
|
1864
1864
|
request: dict = {
|
1865
1865
|
'type': 'fundingHistory',
|
@@ -2182,7 +2182,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
2182
2182
|
else:
|
2183
2183
|
market = self.safe_market(marketId, market)
|
2184
2184
|
symbol = market['symbol']
|
2185
|
-
timestamp = self.
|
2185
|
+
timestamp = self.safe_integer(entry, 'timestamp')
|
2186
2186
|
status = self.safe_string_2(order, 'status', 'ccxtStatus')
|
2187
2187
|
order = self.omit(order, ['ccxtStatus'])
|
2188
2188
|
side = self.safe_string(entry, 'side')
|
@@ -2197,7 +2197,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
2197
2197
|
'timestamp': timestamp,
|
2198
2198
|
'datetime': self.iso8601(timestamp),
|
2199
2199
|
'lastTradeTimestamp': None,
|
2200
|
-
'lastUpdateTimestamp':
|
2200
|
+
'lastUpdateTimestamp': self.safe_integer(order, 'statusTimestamp'),
|
2201
2201
|
'symbol': symbol,
|
2202
2202
|
'type': self.parse_order_type(self.safe_string_lower(entry, 'orderType')),
|
2203
2203
|
'timeInForce': self.safe_string_upper(entry, 'tif'),
|
@@ -3148,8 +3148,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
3148
3148
|
await self.load_markets()
|
3149
3149
|
symbols = self.market_symbols(symbols)
|
3150
3150
|
swapMarkets = await self.fetch_swap_markets()
|
3151
|
-
|
3152
|
-
return self.filter_by_array(result, 'symbol', symbols)
|
3151
|
+
return self.parse_open_interests(swapMarkets, symbols)
|
3153
3152
|
|
3154
3153
|
async def fetch_open_interest(self, symbol: str, params={}):
|
3155
3154
|
"""
|
@@ -2476,6 +2476,8 @@ class krakenfutures(Exchange, ImplicitAPI):
|
|
2476
2476
|
marketId = self.safe_string(info, 'symbol')
|
2477
2477
|
market = self.safe_market(marketId, market)
|
2478
2478
|
tiers = []
|
2479
|
+
if marginLevels is None:
|
2480
|
+
return tiers
|
2479
2481
|
for i in range(0, len(marginLevels)):
|
2480
2482
|
tier = marginLevels[i]
|
2481
2483
|
initialMargin = self.safe_string(tier, 'initialMargin')
|
ccxt/async_support/lbank.py
CHANGED
@@ -1249,8 +1249,7 @@ class lbank(Exchange, ImplicitAPI):
|
|
1249
1249
|
# "success": True,
|
1250
1250
|
# }
|
1251
1251
|
data = self.safe_list(response, 'data', [])
|
1252
|
-
|
1253
|
-
return self.filter_by_array(result, 'symbol', symbols)
|
1252
|
+
return self.parse_funding_rates(data, symbols)
|
1254
1253
|
|
1255
1254
|
async def fetch_balance(self, params={}) -> Balances:
|
1256
1255
|
"""
|
ccxt/async_support/mexc.py
CHANGED
ccxt/async_support/okx.py
CHANGED
@@ -1021,7 +1021,7 @@ class okx(Exchange, ImplicitAPI):
|
|
1021
1021
|
'BHP': 'BHP',
|
1022
1022
|
'APT': 'Aptos',
|
1023
1023
|
'ARBONE': 'Arbitrum One',
|
1024
|
-
'AVAXC': 'Avalanche C',
|
1024
|
+
'AVAXC': 'Avalanche C-Chain',
|
1025
1025
|
'AVAXX': 'Avalanche X-Chain',
|
1026
1026
|
'ARK': 'ARK',
|
1027
1027
|
'AR': 'Arweave',
|
@@ -1809,8 +1809,8 @@ class okx(Exchange, ImplicitAPI):
|
|
1809
1809
|
currencyActive = active if (active) else currencyActive
|
1810
1810
|
networkId = self.safe_string(chain, 'chain')
|
1811
1811
|
if (networkId is not None) and (networkId.find('-') >= 0):
|
1812
|
-
parts = networkId.split('-')
|
1813
|
-
chainPart =
|
1812
|
+
parts = networkId.split('-')[1:]
|
1813
|
+
chainPart = '-'.join(parts)
|
1814
1814
|
networkCode = self.network_id_to_code(chainPart, currency['code'])
|
1815
1815
|
precision = self.parse_precision(self.safe_string(chain, 'wdTickSz'))
|
1816
1816
|
if maxPrecision is None:
|
@@ -2750,9 +2750,11 @@ class okx(Exchange, ImplicitAPI):
|
|
2750
2750
|
market = self.market(symbol)
|
2751
2751
|
if not market['spot']:
|
2752
2752
|
raise NotSupported(self.id + ' createMarketBuyOrderWithCost() supports spot markets only')
|
2753
|
-
|
2754
|
-
|
2755
|
-
|
2753
|
+
req = {
|
2754
|
+
'createMarketBuyOrderRequiresPrice': False,
|
2755
|
+
'tgtCcy': 'quote_ccy',
|
2756
|
+
}
|
2757
|
+
return await self.create_order(symbol, 'market', 'buy', cost, None, self.extend(req, params))
|
2756
2758
|
|
2757
2759
|
async def create_market_sell_order_with_cost(self, symbol: str, cost: float, params={}):
|
2758
2760
|
"""
|
@@ -2769,9 +2771,11 @@ class okx(Exchange, ImplicitAPI):
|
|
2769
2771
|
market = self.market(symbol)
|
2770
2772
|
if not market['spot']:
|
2771
2773
|
raise NotSupported(self.id + ' createMarketSellOrderWithCost() supports spot markets only')
|
2772
|
-
|
2773
|
-
|
2774
|
-
|
2774
|
+
req = {
|
2775
|
+
'createMarketBuyOrderRequiresPrice': False,
|
2776
|
+
'tgtCcy': 'quote_ccy',
|
2777
|
+
}
|
2778
|
+
return await self.create_order(symbol, 'market', 'sell', cost, None, self.extend(req, params))
|
2775
2779
|
|
2776
2780
|
def create_order_request(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
|
2777
2781
|
market = self.market(symbol)
|