ccxt 4.4.70__py2.py3-none-any.whl → 4.4.72__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 -3
- ccxt/abstract/bingx.py +1 -0
- ccxt/abstract/bitmart.py +1 -0
- ccxt/abstract/poloniex.py +36 -0
- ccxt/ascendex.py +1 -1
- ccxt/async_support/__init__.py +1 -3
- ccxt/async_support/ascendex.py +1 -1
- ccxt/async_support/base/exchange.py +3 -3
- ccxt/async_support/binance.py +107 -102
- ccxt/async_support/bingx.py +65 -43
- ccxt/async_support/bitfinex.py +1 -1
- ccxt/async_support/bitfinex1.py +1 -1
- ccxt/async_support/bitget.py +0 -3
- ccxt/async_support/bitmart.py +12 -1
- ccxt/async_support/bitopro.py +1 -0
- ccxt/async_support/bitrue.py +1 -0
- ccxt/async_support/bl3p.py +2 -2
- ccxt/async_support/cex.py +2 -0
- ccxt/async_support/coinbase.py +3 -2
- ccxt/async_support/coinbaseexchange.py +4 -2
- ccxt/async_support/coinbaseinternational.py +3 -2
- ccxt/async_support/coinex.py +1 -1
- ccxt/async_support/deribit.py +3 -1
- ccxt/async_support/derive.py +11 -7
- ccxt/async_support/gate.py +3 -0
- ccxt/async_support/gemini.py +2 -1
- ccxt/async_support/hashkey.py +4 -2
- ccxt/async_support/hitbtc.py +1 -1
- ccxt/async_support/hyperliquid.py +38 -0
- ccxt/async_support/kraken.py +78 -6
- ccxt/async_support/krakenfutures.py +4 -0
- ccxt/async_support/kucoin.py +5 -3
- ccxt/async_support/kuna.py +1 -1
- ccxt/async_support/mexc.py +9 -5
- ccxt/async_support/ndax.py +1 -1
- ccxt/async_support/okcoin.py +4 -0
- ccxt/async_support/okx.py +79 -76
- ccxt/async_support/paradex.py +65 -7
- ccxt/async_support/paymium.py +1 -1
- ccxt/async_support/poloniex.py +1265 -86
- ccxt/async_support/upbit.py +1 -1
- ccxt/async_support/whitebit.py +102 -4
- ccxt/async_support/woo.py +3 -1
- ccxt/async_support/woofipro.py +1 -1
- ccxt/async_support/yobit.py +2 -1
- ccxt/base/errors.py +6 -0
- ccxt/base/exchange.py +31 -4
- ccxt/base/types.py +28 -0
- ccxt/binance.py +107 -102
- ccxt/bingx.py +65 -43
- ccxt/bitfinex.py +1 -1
- ccxt/bitfinex1.py +1 -1
- ccxt/bitget.py +0 -3
- ccxt/bitmart.py +12 -1
- ccxt/bitopro.py +1 -0
- ccxt/bitrue.py +1 -0
- ccxt/bl3p.py +2 -2
- ccxt/cex.py +2 -0
- ccxt/coinbase.py +3 -2
- ccxt/coinbaseexchange.py +4 -2
- ccxt/coinbaseinternational.py +3 -2
- ccxt/coinex.py +1 -1
- ccxt/deribit.py +3 -1
- ccxt/derive.py +11 -7
- ccxt/gate.py +3 -0
- ccxt/gemini.py +2 -1
- ccxt/hashkey.py +4 -2
- ccxt/hitbtc.py +1 -1
- ccxt/hyperliquid.py +38 -0
- ccxt/kraken.py +78 -6
- ccxt/krakenfutures.py +4 -0
- ccxt/kucoin.py +5 -3
- ccxt/kuna.py +1 -1
- ccxt/mexc.py +9 -5
- ccxt/ndax.py +1 -1
- ccxt/okcoin.py +4 -0
- ccxt/okx.py +79 -76
- ccxt/paradex.py +65 -7
- ccxt/paymium.py +1 -1
- ccxt/poloniex.py +1264 -86
- ccxt/pro/__init__.py +1 -3
- ccxt/pro/binance.py +102 -102
- ccxt/pro/bingx.py +63 -52
- ccxt/pro/bitmart.py +15 -7
- ccxt/pro/derive.py +2 -2
- ccxt/pro/krakenfutures.py +1 -1
- ccxt/test/tests_async.py +1 -0
- ccxt/test/tests_sync.py +1 -0
- ccxt/upbit.py +1 -1
- ccxt/whitebit.py +102 -4
- ccxt/woo.py +3 -1
- ccxt/woofipro.py +1 -1
- ccxt/yobit.py +2 -1
- {ccxt-4.4.70.dist-info → ccxt-4.4.72.dist-info}/METADATA +6 -9
- {ccxt-4.4.70.dist-info → ccxt-4.4.72.dist-info}/RECORD +98 -99
- ccxt/abstract/poloniexfutures.py +0 -48
- {ccxt-4.4.70.dist-info → ccxt-4.4.72.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.70.dist-info → ccxt-4.4.72.dist-info}/WHEEL +0 -0
- {ccxt-4.4.70.dist-info → ccxt-4.4.72.dist-info}/top_level.txt +0 -0
ccxt/async_support/bingx.py
CHANGED
@@ -58,6 +58,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
58
58
|
'createOrder': True,
|
59
59
|
'createOrders': True,
|
60
60
|
'createOrderWithTakeProfitAndStopLoss': True,
|
61
|
+
'createReduceOnlyOrder': True,
|
61
62
|
'createStopLossOrder': True,
|
62
63
|
'createStopOrder': True,
|
63
64
|
'createTakeProfitOrder': True,
|
@@ -401,6 +402,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
401
402
|
'uid': 1,
|
402
403
|
'apiKey/query': 2,
|
403
404
|
'account/apiPermissions': 5,
|
405
|
+
'allAccountBalance': 2,
|
404
406
|
},
|
405
407
|
'post': {
|
406
408
|
'innerTransfer/authorizeSubAccount': 1,
|
@@ -830,7 +832,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
830
832
|
# {
|
831
833
|
# "symbol": "GEAR-USDT",
|
832
834
|
# "minQty": 735, # deprecated
|
833
|
-
# "maxQty": 2941177, # deprecated
|
835
|
+
# "maxQty": 2941177, # deprecated.
|
834
836
|
# "minNotional": 5,
|
835
837
|
# "maxNotional": 20000,
|
836
838
|
# "status": 1,
|
@@ -1429,62 +1431,82 @@ class bingx(Exchange, ImplicitAPI):
|
|
1429
1431
|
# spot
|
1430
1432
|
#
|
1431
1433
|
# {
|
1432
|
-
# "code":
|
1433
|
-
# "
|
1434
|
-
#
|
1435
|
-
# [
|
1436
|
-
#
|
1437
|
-
#
|
1438
|
-
#
|
1439
|
-
# [
|
1440
|
-
# "26324.71",
|
1441
|
-
# "0.31888"
|
1442
|
-
# ],
|
1443
|
-
# ],
|
1444
|
-
# "asks": [
|
1445
|
-
# [
|
1446
|
-
# "26340.30",
|
1447
|
-
# "6.45221"
|
1434
|
+
# "code":0,
|
1435
|
+
# "timestamp":1743240504535,
|
1436
|
+
# "data":{
|
1437
|
+
# "bids":[
|
1438
|
+
# ["83775.39","1.981875"],
|
1439
|
+
# ["83775.38","0.001076"],
|
1440
|
+
# ["83775.34","0.254716"],
|
1448
1441
|
# ],
|
1449
|
-
# [
|
1450
|
-
#
|
1451
|
-
#
|
1442
|
+
# "asks":[
|
1443
|
+
# ["83985.40","0.000013"],
|
1444
|
+
# ["83980.00","0.000011"],
|
1445
|
+
# ["83975.70","0.000061000000000000005"],
|
1452
1446
|
# ],
|
1453
|
-
#
|
1447
|
+
# "ts":1743240504535,
|
1448
|
+
# "lastUpdateId":13565639906
|
1449
|
+
# }
|
1454
1450
|
# }
|
1455
1451
|
#
|
1456
|
-
#
|
1452
|
+
#
|
1453
|
+
# linear swap
|
1457
1454
|
#
|
1458
1455
|
# {
|
1459
|
-
# "code":
|
1460
|
-
# "msg":
|
1461
|
-
# "data":
|
1462
|
-
#
|
1463
|
-
#
|
1464
|
-
#
|
1465
|
-
#
|
1466
|
-
#
|
1456
|
+
# "code":0,
|
1457
|
+
# "msg":"",
|
1458
|
+
# "data":{
|
1459
|
+
# "T":1743240836255,
|
1460
|
+
# "bids":[
|
1461
|
+
# ["83760.7","7.0861"],
|
1462
|
+
# ["83760.6","0.0044"],
|
1463
|
+
# ["83757.7","1.9526"],
|
1467
1464
|
# ],
|
1468
|
-
# [
|
1469
|
-
#
|
1470
|
-
#
|
1465
|
+
# "asks":[
|
1466
|
+
# ["83784.3","8.3531"],
|
1467
|
+
# ["83782.8","23.7289"],
|
1468
|
+
# ["83780.1","18.0617"],
|
1471
1469
|
# ],
|
1472
|
-
#
|
1473
|
-
#
|
1474
|
-
#
|
1475
|
-
#
|
1476
|
-
# "43616.00000000"
|
1470
|
+
# "bidsCoin":[
|
1471
|
+
# ["83760.7","0.0007"],
|
1472
|
+
# ["83760.6","0.0000"],
|
1473
|
+
# ["83757.7","0.0002"],
|
1477
1474
|
# ],
|
1478
|
-
# [
|
1479
|
-
#
|
1480
|
-
#
|
1475
|
+
# "asksCoin":[
|
1476
|
+
# ["83784.3","0.0008"],
|
1477
|
+
# ["83782.8","0.0024"],
|
1478
|
+
# ["83780.1","0.0018"],
|
1479
|
+
# ]
|
1480
|
+
# }
|
1481
|
+
# }
|
1482
|
+
#
|
1483
|
+
# inverse swap
|
1484
|
+
#
|
1485
|
+
# {
|
1486
|
+
# "code":0,
|
1487
|
+
# "msg":"",
|
1488
|
+
# "timestamp":1743240979146,
|
1489
|
+
# "data":{
|
1490
|
+
# "T":1743240978691,
|
1491
|
+
# "bids":[
|
1492
|
+
# ["83611.4","241.0"],
|
1493
|
+
# ["83611.3","1.0"],
|
1494
|
+
# ["83602.9","666.0"],
|
1481
1495
|
# ],
|
1482
|
-
#
|
1496
|
+
# "asks":[
|
1497
|
+
# ["83645.0","4253.0"],
|
1498
|
+
# ["83640.5","3188.0"],
|
1499
|
+
# ["83636.0","5540.0"],
|
1500
|
+
# ]
|
1501
|
+
# }
|
1483
1502
|
# }
|
1484
1503
|
#
|
1485
1504
|
orderbook = self.safe_dict(response, 'data', {})
|
1505
|
+
nonce = self.safe_integer(orderbook, 'lastUpdateId')
|
1486
1506
|
timestamp = self.safe_integer_2(orderbook, 'T', 'ts')
|
1487
|
-
|
1507
|
+
result = self.parse_order_book(orderbook, market['symbol'], timestamp, 'bids', 'asks', 0, 1)
|
1508
|
+
result['nonce'] = nonce
|
1509
|
+
return result
|
1488
1510
|
|
1489
1511
|
async def fetch_funding_rate(self, symbol: str, params={}) -> FundingRate:
|
1490
1512
|
"""
|
ccxt/async_support/bitfinex.py
CHANGED
@@ -2203,7 +2203,7 @@ class bitfinex(Exchange, ImplicitAPI):
|
|
2203
2203
|
tradesList.append({'result': response[i]}) # convert to array of dicts to match parseOrder signature
|
2204
2204
|
return self.parse_trades(tradesList, market, since, limit)
|
2205
2205
|
|
2206
|
-
async def create_deposit_address(self, code: str, params={}):
|
2206
|
+
async def create_deposit_address(self, code: str, params={}) -> DepositAddress:
|
2207
2207
|
"""
|
2208
2208
|
create a currency deposit address
|
2209
2209
|
|
ccxt/async_support/bitfinex1.py
CHANGED
@@ -1395,7 +1395,7 @@ class bitfinex1(Exchange, ImplicitAPI):
|
|
1395
1395
|
return self.options['currencyNames'][code]
|
1396
1396
|
raise NotSupported(self.id + ' ' + code + ' not supported for withdrawal')
|
1397
1397
|
|
1398
|
-
async def create_deposit_address(self, code: str, params={}):
|
1398
|
+
async def create_deposit_address(self, code: str, params={}) -> DepositAddress:
|
1399
1399
|
"""
|
1400
1400
|
create a currency deposit address
|
1401
1401
|
|
ccxt/async_support/bitget.py
CHANGED
@@ -1758,10 +1758,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
1758
1758
|
"""
|
1759
1759
|
if self.options['adjustForTimeDifference']:
|
1760
1760
|
await self.load_time_difference()
|
1761
|
-
sandboxMode = self.safe_bool(self.options, 'sandboxMode', False)
|
1762
1761
|
types = self.safe_value(self.options, 'fetchMarkets', ['spot', 'swap'])
|
1763
|
-
if sandboxMode:
|
1764
|
-
types = ['swap']
|
1765
1762
|
promises = []
|
1766
1763
|
fetchMargins = False
|
1767
1764
|
for i in range(0, len(types)):
|
ccxt/async_support/bitmart.py
CHANGED
@@ -61,6 +61,7 @@ class bitmart(Exchange, ImplicitAPI):
|
|
61
61
|
'createOrder': True,
|
62
62
|
'createOrders': True,
|
63
63
|
'createPostOnlyOrder': True,
|
64
|
+
'createReduceOnlyOrder': True,
|
64
65
|
'createStopLimitOrder': False,
|
65
66
|
'createStopMarketOrder': False,
|
66
67
|
'createStopOrder': False,
|
@@ -278,6 +279,7 @@ class bitmart(Exchange, ImplicitAPI):
|
|
278
279
|
'contract/private/submit-tp-sl-order': 2.5,
|
279
280
|
'contract/private/modify-plan-order': 2.5,
|
280
281
|
'contract/private/modify-preset-plan-order': 2.5,
|
282
|
+
'contract/private/modify-limit-order': 2.5,
|
281
283
|
'contract/private/modify-tp-sl-order': 2.5,
|
282
284
|
'contract/private/submit-trail-order': 2.5, # weight is not provided by the exchange, is set order
|
283
285
|
'contract/private/cancel-trail-order': 1.5, # weight is not provided by the exchange, is set order
|
@@ -4875,6 +4877,7 @@ class bitmart(Exchange, ImplicitAPI):
|
|
4875
4877
|
https://developer-pro.bitmart.com/en/futuresv2/#modify-plan-order-signed
|
4876
4878
|
https://developer-pro.bitmart.com/en/futuresv2/#modify-tp-sl-order-signed
|
4877
4879
|
https://developer-pro.bitmart.com/en/futuresv2/#modify-preset-plan-order-signed
|
4880
|
+
https://developer-pro.bitmart.com/en/futuresv2/#modify-limit-order-signed
|
4878
4881
|
|
4879
4882
|
:param str id: order id
|
4880
4883
|
:param str symbol: unified symbol of the market to edit an order in
|
@@ -4909,6 +4912,7 @@ class bitmart(Exchange, ImplicitAPI):
|
|
4909
4912
|
isTakeProfit = takeProfitPrice is not None
|
4910
4913
|
isPresetStopLoss = presetStopLoss is not None
|
4911
4914
|
isPresetTakeProfit = presetTakeProfit is not None
|
4915
|
+
isLimitOrder = (type == 'limit')
|
4912
4916
|
request: dict = {
|
4913
4917
|
'symbol': market['id'],
|
4914
4918
|
}
|
@@ -4973,8 +4977,15 @@ class bitmart(Exchange, ImplicitAPI):
|
|
4973
4977
|
# "trace": "a5c3234534534a836bc476a203.123452.172716624359200197"
|
4974
4978
|
# }
|
4975
4979
|
#
|
4980
|
+
elif isLimitOrder:
|
4981
|
+
request['order_id'] = self.parse_to_int(id) # reparse id self endpoint is the only one requiring it
|
4982
|
+
if amount is not None:
|
4983
|
+
request['size'] = self.amount_to_precision(symbol, amount)
|
4984
|
+
if price is not None:
|
4985
|
+
request['price'] = self.price_to_precision(symbol, price)
|
4986
|
+
response = await self.privatePostContractPrivateModifyLimitOrder(self.extend(request, params))
|
4976
4987
|
else:
|
4977
|
-
raise NotSupported(self.id + ' editOrder() only supports trigger, stop loss and take profit orders')
|
4988
|
+
raise NotSupported(self.id + ' editOrder() only supports limit, trigger, stop loss and take profit orders')
|
4978
4989
|
data = self.safe_dict(response, 'data', {})
|
4979
4990
|
return self.parse_order(data, market)
|
4980
4991
|
|
ccxt/async_support/bitopro.py
CHANGED
ccxt/async_support/bitrue.py
CHANGED
@@ -57,6 +57,7 @@ class bitrue(Exchange, ImplicitAPI):
|
|
57
57
|
'createMarketOrderWithCost': False,
|
58
58
|
'createMarketSellOrderWithCost': False,
|
59
59
|
'createOrder': True,
|
60
|
+
'createReduceOnlyOrder': True,
|
60
61
|
'createStopLimitOrder': True,
|
61
62
|
'createStopMarketOrder': True,
|
62
63
|
'createStopOrder': True,
|
ccxt/async_support/bl3p.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.async_support.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.bl3p import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Any, Balances, Currency, IndexType, Int, Market, Num, OrderBook, OrderSide, OrderType, Str, Ticker, Trade, TradingFees
|
9
|
+
from ccxt.base.types import Any, Balances, Currency, DepositAddress, IndexType, Int, Market, Num, OrderBook, OrderSide, OrderType, Str, Ticker, Trade, TradingFees
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.decimal_to_precision import TICK_SIZE
|
12
12
|
from ccxt.base.precise import Precise
|
@@ -477,7 +477,7 @@ class bl3p(Exchange, ImplicitAPI):
|
|
477
477
|
'info': response,
|
478
478
|
})
|
479
479
|
|
480
|
-
async def create_deposit_address(self, code: str, params={}):
|
480
|
+
async def create_deposit_address(self, code: str, params={}) -> DepositAddress:
|
481
481
|
"""
|
482
482
|
create a currency deposit address
|
483
483
|
|
ccxt/async_support/cex.py
CHANGED
@@ -39,6 +39,7 @@ class cex(Exchange, ImplicitAPI):
|
|
39
39
|
'cancelAllOrders': True,
|
40
40
|
'cancelOrder': True,
|
41
41
|
'createOrder': True,
|
42
|
+
'createReduceOnlyOrder': False,
|
42
43
|
'createStopOrder': True,
|
43
44
|
'createTriggerOrder': True,
|
44
45
|
'fetchAccounts': True,
|
@@ -328,6 +329,7 @@ class cex(Exchange, ImplicitAPI):
|
|
328
329
|
'margin': None,
|
329
330
|
'deposit': deposit,
|
330
331
|
'withdraw': withdraw,
|
332
|
+
'active': None,
|
331
333
|
'fee': self.safe_number(rawNetwork, 'withdrawalFee'),
|
332
334
|
'precision': currencyPrecision,
|
333
335
|
'limits': {
|
ccxt/async_support/coinbase.py
CHANGED
@@ -735,7 +735,7 @@ class coinbase(Exchange, ImplicitAPI):
|
|
735
735
|
'info': account,
|
736
736
|
}
|
737
737
|
|
738
|
-
async def create_deposit_address(self, code: str, params={}):
|
738
|
+
async def create_deposit_address(self, code: str, params={}) -> DepositAddress:
|
739
739
|
"""
|
740
740
|
create a currency deposit address
|
741
741
|
|
@@ -803,6 +803,7 @@ class coinbase(Exchange, ImplicitAPI):
|
|
803
803
|
'currency': code,
|
804
804
|
'tag': tag,
|
805
805
|
'address': address,
|
806
|
+
'network': None,
|
806
807
|
'info': response,
|
807
808
|
}
|
808
809
|
|
@@ -2301,7 +2302,7 @@ class coinbase(Exchange, ImplicitAPI):
|
|
2301
2302
|
# "ending_before":null,
|
2302
2303
|
# "starting_after":null,
|
2303
2304
|
# "previous_ending_before":null,
|
2304
|
-
# "next_starting_after":"6b17acd6-2e68-5eb0-9f45-
|
2305
|
+
# "next_starting_after":"6b17acd6-2e68-5eb0-9f45-72d67cef578a",
|
2305
2306
|
# "limit":100,
|
2306
2307
|
# "order":"desc",
|
2307
2308
|
# "previous_uri":null,
|
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.async_support.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.coinbaseexchange import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Account, Any, Balances, Currencies, Currency, Int, LedgerEntry, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFees, Transaction
|
9
|
+
from ccxt.base.types import Account, Any, Balances, Currencies, Currency, DepositAddress, Int, LedgerEntry, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFees, Transaction
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
12
|
from ccxt.base.errors import AuthenticationError
|
@@ -43,6 +43,7 @@ class coinbaseexchange(Exchange, ImplicitAPI):
|
|
43
43
|
'cancelOrder': True,
|
44
44
|
'createDepositAddress': True,
|
45
45
|
'createOrder': True,
|
46
|
+
'createReduceOnlyOrder': False,
|
46
47
|
'createStopLimitOrder': True,
|
47
48
|
'createStopMarketOrder': True,
|
48
49
|
'createStopOrder': True,
|
@@ -1782,7 +1783,7 @@ class coinbaseexchange(Exchange, ImplicitAPI):
|
|
1782
1783
|
'fee': fee,
|
1783
1784
|
}
|
1784
1785
|
|
1785
|
-
async def create_deposit_address(self, code: str, params={}):
|
1786
|
+
async def create_deposit_address(self, code: str, params={}) -> DepositAddress:
|
1786
1787
|
"""
|
1787
1788
|
create a currency deposit address
|
1788
1789
|
|
@@ -1813,6 +1814,7 @@ class coinbaseexchange(Exchange, ImplicitAPI):
|
|
1813
1814
|
return {
|
1814
1815
|
'currency': code,
|
1815
1816
|
'address': self.check_address(address),
|
1817
|
+
'network': None,
|
1816
1818
|
'tag': tag,
|
1817
1819
|
'info': response,
|
1818
1820
|
}
|
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.async_support.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.coinbaseinternational import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Any, Balances, Currencies, Currency, Int, Market, Order, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry
|
9
|
+
from ccxt.base.types import Any, Balances, Currencies, Currency, DepositAddress, Int, Market, Order, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
12
|
from ccxt.base.errors import AuthenticationError
|
@@ -736,7 +736,7 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
736
736
|
}
|
737
737
|
return self.safe_string(statuses, status, status)
|
738
738
|
|
739
|
-
async def create_deposit_address(self, code: str, params={}):
|
739
|
+
async def create_deposit_address(self, code: str, params={}) -> DepositAddress:
|
740
740
|
"""
|
741
741
|
create a currency deposit address
|
742
742
|
|
@@ -783,6 +783,7 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
783
783
|
'currency': code,
|
784
784
|
'tag': tag,
|
785
785
|
'address': address,
|
786
|
+
'network': None,
|
786
787
|
'info': response,
|
787
788
|
}
|
788
789
|
|
ccxt/async_support/coinex.py
CHANGED
@@ -3679,7 +3679,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
3679
3679
|
"""
|
3680
3680
|
return await self.fetch_orders_by_status('finished', symbol, since, limit, params)
|
3681
3681
|
|
3682
|
-
async def create_deposit_address(self, code: str, params={}):
|
3682
|
+
async def create_deposit_address(self, code: str, params={}) -> DepositAddress:
|
3683
3683
|
"""
|
3684
3684
|
create a currency deposit address
|
3685
3685
|
|
ccxt/async_support/deribit.py
CHANGED
@@ -50,6 +50,7 @@ class deribit(Exchange, ImplicitAPI):
|
|
50
50
|
'cancelOrders': False,
|
51
51
|
'createDepositAddress': True,
|
52
52
|
'createOrder': True,
|
53
|
+
'createReduceOnlyOrder': True,
|
53
54
|
'createStopLimitOrder': True,
|
54
55
|
'createStopMarketOrder': True,
|
55
56
|
'createStopOrder': True,
|
@@ -1099,7 +1100,7 @@ class deribit(Exchange, ImplicitAPI):
|
|
1099
1100
|
result = self.safe_dict(response, 'result', {})
|
1100
1101
|
return self.parse_balance(result)
|
1101
1102
|
|
1102
|
-
async def create_deposit_address(self, code: str, params={}):
|
1103
|
+
async def create_deposit_address(self, code: str, params={}) -> DepositAddress:
|
1103
1104
|
"""
|
1104
1105
|
create a currency deposit address
|
1105
1106
|
|
@@ -1134,6 +1135,7 @@ class deribit(Exchange, ImplicitAPI):
|
|
1134
1135
|
'currency': code,
|
1135
1136
|
'address': address,
|
1136
1137
|
'tag': None,
|
1138
|
+
'network': None,
|
1137
1139
|
'info': response,
|
1138
1140
|
}
|
1139
1141
|
|
ccxt/async_support/derive.py
CHANGED
@@ -601,6 +601,7 @@ class derive(Exchange, ImplicitAPI):
|
|
601
601
|
swap = False
|
602
602
|
option = False
|
603
603
|
linear: Bool = None
|
604
|
+
inverse: Bool = None
|
604
605
|
baseId = self.safe_string(market, 'base_currency')
|
605
606
|
quoteId = self.safe_string(market, 'quote_currency')
|
606
607
|
base = self.safe_currency_code(baseId)
|
@@ -623,6 +624,7 @@ class derive(Exchange, ImplicitAPI):
|
|
623
624
|
symbol = base + '/' + quote + ':' + settle
|
624
625
|
swap = True
|
625
626
|
linear = True
|
627
|
+
inverse = False
|
626
628
|
marketType = 'swap'
|
627
629
|
elif type == 'option':
|
628
630
|
settleId = 'USDC'
|
@@ -657,7 +659,7 @@ class derive(Exchange, ImplicitAPI):
|
|
657
659
|
'active': self.safe_bool(market, 'is_active'),
|
658
660
|
'contract': (swap or option),
|
659
661
|
'linear': linear,
|
660
|
-
'inverse':
|
662
|
+
'inverse': inverse,
|
661
663
|
'contractSize': None if (spot) else 1,
|
662
664
|
'expiry': expiry,
|
663
665
|
'expiryDatetime': self.iso8601(expiry),
|
@@ -1812,7 +1814,7 @@ class derive(Exchange, ImplicitAPI):
|
|
1812
1814
|
order = self.safe_dict(rawOrder, 'data')
|
1813
1815
|
if order is None:
|
1814
1816
|
order = rawOrder
|
1815
|
-
timestamp = self.
|
1817
|
+
timestamp = self.safe_integer_2(rawOrder, 'creation_timestamp', 'nonce')
|
1816
1818
|
orderId = self.safe_string(order, 'order_id')
|
1817
1819
|
marketId = self.safe_string(order, 'instrument_name')
|
1818
1820
|
if marketId is not None:
|
@@ -2329,17 +2331,19 @@ class derive(Exchange, ImplicitAPI):
|
|
2329
2331
|
result: dict = {
|
2330
2332
|
'info': response,
|
2331
2333
|
}
|
2332
|
-
# TODO:
|
2333
|
-
# checked multiple subaccounts
|
2334
|
-
# checked balance after open orders / positions
|
2335
2334
|
for i in range(0, len(response)):
|
2336
2335
|
subaccount = response[i]
|
2337
2336
|
collaterals = self.safe_list(subaccount, 'collaterals', [])
|
2338
2337
|
for j in range(0, len(collaterals)):
|
2339
2338
|
balance = collaterals[j]
|
2340
2339
|
code = self.safe_currency_code(self.safe_string(balance, 'currency'))
|
2341
|
-
account = self.
|
2342
|
-
account
|
2340
|
+
account = self.safe_dict(result, code)
|
2341
|
+
if account is None:
|
2342
|
+
account = self.account()
|
2343
|
+
account['total'] = self.safe_string(balance, 'amount')
|
2344
|
+
else:
|
2345
|
+
amount = self.safe_string(balance, 'amount')
|
2346
|
+
account['total'] = Precise.string_add(account['total'], amount)
|
2343
2347
|
result[code] = account
|
2344
2348
|
return self.safe_balance(result)
|
2345
2349
|
|
ccxt/async_support/gate.py
CHANGED
@@ -6364,6 +6364,9 @@ class gate(Exchange, ImplicitAPI):
|
|
6364
6364
|
if (method == 'GET') or (method == 'DELETE') or requiresURLEncoding or (method == 'PATCH'):
|
6365
6365
|
if query:
|
6366
6366
|
queryString = self.urlencode(query)
|
6367
|
+
# https://github.com/ccxt/ccxt/issues/25570
|
6368
|
+
if queryString.find('currencies=') >= 0 and queryString.find('%2C') >= 0:
|
6369
|
+
queryString = queryString.replace('%2', ',')
|
6367
6370
|
url += '?' + queryString
|
6368
6371
|
if method == 'PATCH':
|
6369
6372
|
body = self.json(query)
|
ccxt/async_support/gemini.py
CHANGED
@@ -1874,7 +1874,7 @@ class gemini(Exchange, ImplicitAPI):
|
|
1874
1874
|
raise ExchangeError(feedback) # unknown message
|
1875
1875
|
return None
|
1876
1876
|
|
1877
|
-
async def create_deposit_address(self, code: str, params={}):
|
1877
|
+
async def create_deposit_address(self, code: str, params={}) -> DepositAddress:
|
1878
1878
|
"""
|
1879
1879
|
create a currency deposit address
|
1880
1880
|
|
@@ -1896,6 +1896,7 @@ class gemini(Exchange, ImplicitAPI):
|
|
1896
1896
|
'currency': code,
|
1897
1897
|
'address': address,
|
1898
1898
|
'tag': None,
|
1899
|
+
'network': None,
|
1899
1900
|
'info': response,
|
1900
1901
|
}
|
1901
1902
|
|
ccxt/async_support/hashkey.py
CHANGED
@@ -2399,8 +2399,10 @@ class hashkey(Exchange, ImplicitAPI):
|
|
2399
2399
|
market = self.market(symbol)
|
2400
2400
|
if not market['spot']:
|
2401
2401
|
raise NotSupported(self.id + ' createMarketBuyOrderWithCost() is supported for spot markets only')
|
2402
|
-
|
2403
|
-
|
2402
|
+
req = {
|
2403
|
+
'cost': cost,
|
2404
|
+
}
|
2405
|
+
return await self.create_order(symbol, 'market', 'buy', cost, None, self.extend(req, params))
|
2404
2406
|
|
2405
2407
|
async def create_spot_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}) -> Order:
|
2406
2408
|
"""
|
ccxt/async_support/hitbtc.py
CHANGED
@@ -1020,7 +1020,7 @@ class hitbtc(Exchange, ImplicitAPI):
|
|
1020
1020
|
}
|
1021
1021
|
return result
|
1022
1022
|
|
1023
|
-
async def create_deposit_address(self, code: str, params={}):
|
1023
|
+
async def create_deposit_address(self, code: str, params={}) -> DepositAddress:
|
1024
1024
|
"""
|
1025
1025
|
create a currency deposit address
|
1026
1026
|
|
@@ -1898,6 +1898,44 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
1898
1898
|
statuses = self.safe_list(dataObject, 'statuses', [])
|
1899
1899
|
return self.parse_orders(statuses)
|
1900
1900
|
|
1901
|
+
async def create_vault(self, name: str, description: str, initialUsd: int, params={}):
|
1902
|
+
"""
|
1903
|
+
creates a value
|
1904
|
+
:param str name: The name of the vault
|
1905
|
+
:param str description: The description of the vault
|
1906
|
+
:param number initialUsd: The initialUsd of the vault
|
1907
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1908
|
+
:returns dict: the api result
|
1909
|
+
"""
|
1910
|
+
self.check_required_credentials()
|
1911
|
+
await self.load_markets()
|
1912
|
+
nonce = self.milliseconds()
|
1913
|
+
request: dict = {
|
1914
|
+
'nonce': nonce,
|
1915
|
+
}
|
1916
|
+
usd = self.parse_to_int(Precise.string_mul(self.number_to_string(initialUsd), '1000000'))
|
1917
|
+
action: dict = {
|
1918
|
+
'type': 'createVault',
|
1919
|
+
'name': name,
|
1920
|
+
'description': description,
|
1921
|
+
'initialUsd': usd,
|
1922
|
+
'nonce': nonce,
|
1923
|
+
}
|
1924
|
+
signature = self.sign_l1_action(action, nonce)
|
1925
|
+
request['action'] = action
|
1926
|
+
request['signature'] = signature
|
1927
|
+
response = await self.privatePostExchange(self.extend(request, params))
|
1928
|
+
#
|
1929
|
+
# {
|
1930
|
+
# "status": "ok",
|
1931
|
+
# "response": {
|
1932
|
+
# "type": "createVault",
|
1933
|
+
# "data": "0x04fddcbc9ce80219301bd16f18491bedf2a8c2b8"
|
1934
|
+
# }
|
1935
|
+
# }
|
1936
|
+
#
|
1937
|
+
return response
|
1938
|
+
|
1901
1939
|
async def fetch_funding_rate_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
1902
1940
|
"""
|
1903
1941
|
fetches historical funding rate prices
|