ccxt 4.3.6__py2.py3-none-any.whl → 4.3.8__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.
Potentially problematic release.
This version of ccxt might be problematic. Click here for more details.
- ccxt/__init__.py +1 -1
- ccxt/abstract/coinbase.py +5 -0
- ccxt/ace.py +5 -0
- ccxt/alpaca.py +6 -0
- ccxt/ascendex.py +2 -2
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/ace.py +5 -0
- ccxt/async_support/alpaca.py +6 -0
- ccxt/async_support/ascendex.py +2 -2
- ccxt/async_support/base/exchange.py +27 -1
- ccxt/async_support/bigone.py +1 -1
- ccxt/async_support/binance.py +6 -4
- ccxt/async_support/bingx.py +4 -2
- ccxt/async_support/bitbank.py +4 -1
- ccxt/async_support/bitfinex.py +1 -1
- ccxt/async_support/bitfinex2.py +1 -1
- ccxt/async_support/bitflyer.py +1 -1
- ccxt/async_support/bitget.py +71 -5
- ccxt/async_support/bithumb.py +5 -1
- ccxt/async_support/bitmart.py +1 -1
- ccxt/async_support/bitmex.py +3 -1
- ccxt/async_support/bitopro.py +6 -1
- ccxt/async_support/bitrue.py +1 -1
- ccxt/async_support/bitso.py +4 -1
- ccxt/async_support/bitstamp.py +4 -1
- ccxt/async_support/bitteam.py +4 -0
- ccxt/async_support/bitvavo.py +4 -1
- ccxt/async_support/bl3p.py +3 -0
- ccxt/async_support/blockchaincom.py +1 -1
- ccxt/async_support/btcalpha.py +3 -0
- ccxt/async_support/btcbox.py +3 -0
- ccxt/async_support/btcmarkets.py +4 -1
- ccxt/async_support/btcturk.py +3 -0
- ccxt/async_support/bybit.py +116 -14
- ccxt/async_support/cex.py +6 -0
- ccxt/async_support/coinbase.py +94 -18
- ccxt/async_support/coinbaseinternational.py +3 -1
- ccxt/async_support/coinbasepro.py +7 -1
- ccxt/async_support/coincheck.py +3 -0
- ccxt/async_support/coinex.py +255 -192
- ccxt/async_support/coinlist.py +5 -1
- ccxt/async_support/coinmate.py +4 -1
- ccxt/async_support/coinone.py +3 -0
- ccxt/async_support/coinsph.py +5 -1
- ccxt/async_support/coinspot.py +3 -0
- ccxt/async_support/cryptocom.py +3 -1
- ccxt/async_support/delta.py +2 -2
- ccxt/async_support/deribit.py +1 -1
- ccxt/async_support/digifinex.py +3 -3
- ccxt/async_support/exmo.py +8 -3
- ccxt/async_support/gate.py +112 -24
- ccxt/async_support/gemini.py +1 -1
- ccxt/async_support/hitbtc.py +7 -6
- ccxt/async_support/hollaex.py +1 -1
- ccxt/async_support/htx.py +3 -1
- ccxt/async_support/huobijp.py +1 -1
- ccxt/async_support/hyperliquid.py +2 -2
- ccxt/async_support/idex.py +4 -1
- ccxt/async_support/independentreserve.py +3 -0
- ccxt/async_support/indodax.py +4 -1
- ccxt/async_support/kraken.py +1 -1
- ccxt/async_support/kucoin.py +3 -1
- ccxt/async_support/kucoinfutures.py +3 -1
- ccxt/async_support/kuna.py +1 -1
- ccxt/async_support/latoken.py +6 -0
- ccxt/async_support/lbank.py +1 -1
- ccxt/async_support/luno.py +3 -0
- ccxt/async_support/lykke.py +6 -1
- ccxt/async_support/mercado.py +4 -1
- ccxt/async_support/mexc.py +110 -4
- ccxt/async_support/ndax.py +5 -1
- ccxt/async_support/novadax.py +5 -1
- ccxt/async_support/okcoin.py +1 -1
- ccxt/async_support/okx.py +81 -5
- ccxt/async_support/onetrading.py +4 -1
- ccxt/async_support/p2b.py +3 -0
- ccxt/async_support/phemex.py +1 -1
- ccxt/async_support/poloniex.py +1 -1
- ccxt/async_support/probit.py +4 -1
- ccxt/async_support/timex.py +3 -0
- ccxt/async_support/tokocrypto.py +1 -1
- ccxt/async_support/tradeogre.py +3 -0
- ccxt/async_support/upbit.py +1 -1
- ccxt/async_support/wavesexchange.py +4 -1
- ccxt/async_support/wazirx.py +3 -0
- ccxt/async_support/whitebit.py +1 -1
- ccxt/async_support/woo.py +4 -2
- ccxt/async_support/yobit.py +4 -1
- ccxt/async_support/zaif.py +1 -1
- ccxt/async_support/zonda.py +1 -1
- ccxt/base/exchange.py +38 -4
- ccxt/bigone.py +1 -1
- ccxt/binance.py +6 -4
- ccxt/bingx.py +4 -2
- ccxt/bitbank.py +4 -1
- ccxt/bitfinex.py +1 -1
- ccxt/bitfinex2.py +1 -1
- ccxt/bitflyer.py +1 -1
- ccxt/bitget.py +71 -5
- ccxt/bithumb.py +5 -1
- ccxt/bitmart.py +1 -1
- ccxt/bitmex.py +3 -1
- ccxt/bitopro.py +6 -1
- ccxt/bitrue.py +1 -1
- ccxt/bitso.py +4 -1
- ccxt/bitstamp.py +4 -1
- ccxt/bitteam.py +4 -0
- ccxt/bitvavo.py +4 -1
- ccxt/bl3p.py +3 -0
- ccxt/blockchaincom.py +1 -1
- ccxt/btcalpha.py +3 -0
- ccxt/btcbox.py +3 -0
- ccxt/btcmarkets.py +4 -1
- ccxt/btcturk.py +3 -0
- ccxt/bybit.py +116 -14
- ccxt/cex.py +6 -0
- ccxt/coinbase.py +94 -18
- ccxt/coinbaseinternational.py +3 -1
- ccxt/coinbasepro.py +7 -1
- ccxt/coincheck.py +3 -0
- ccxt/coinex.py +255 -192
- ccxt/coinlist.py +5 -1
- ccxt/coinmate.py +4 -1
- ccxt/coinone.py +3 -0
- ccxt/coinsph.py +5 -1
- ccxt/coinspot.py +3 -0
- ccxt/cryptocom.py +3 -1
- ccxt/delta.py +2 -2
- ccxt/deribit.py +1 -1
- ccxt/digifinex.py +3 -3
- ccxt/exmo.py +8 -3
- ccxt/gate.py +112 -24
- ccxt/gemini.py +1 -1
- ccxt/hitbtc.py +7 -6
- ccxt/hollaex.py +1 -1
- ccxt/htx.py +3 -1
- ccxt/huobijp.py +1 -1
- ccxt/hyperliquid.py +2 -2
- ccxt/idex.py +4 -1
- ccxt/independentreserve.py +3 -0
- ccxt/indodax.py +4 -1
- ccxt/kraken.py +1 -1
- ccxt/kucoin.py +3 -1
- ccxt/kucoinfutures.py +3 -1
- ccxt/kuna.py +1 -1
- ccxt/latoken.py +6 -0
- ccxt/lbank.py +1 -1
- ccxt/luno.py +3 -0
- ccxt/lykke.py +6 -1
- ccxt/mercado.py +4 -1
- ccxt/mexc.py +110 -4
- ccxt/ndax.py +5 -1
- ccxt/novadax.py +5 -1
- ccxt/okcoin.py +1 -1
- ccxt/okx.py +81 -5
- ccxt/onetrading.py +4 -1
- ccxt/p2b.py +3 -0
- ccxt/phemex.py +1 -1
- ccxt/poloniex.py +1 -1
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/bybit.py +1 -1
- ccxt/pro/coinbase.py +28 -28
- ccxt/probit.py +4 -1
- ccxt/timex.py +3 -0
- ccxt/tokocrypto.py +1 -1
- ccxt/tradeogre.py +3 -0
- ccxt/upbit.py +1 -1
- ccxt/wavesexchange.py +4 -1
- ccxt/wazirx.py +3 -0
- ccxt/whitebit.py +1 -1
- ccxt/woo.py +4 -2
- ccxt/yobit.py +4 -1
- ccxt/zaif.py +1 -1
- ccxt/zonda.py +1 -1
- {ccxt-4.3.6.dist-info → ccxt-4.3.8.dist-info}/METADATA +4 -4
- {ccxt-4.3.6.dist-info → ccxt-4.3.8.dist-info}/RECORD +178 -178
- {ccxt-4.3.6.dist-info → ccxt-4.3.8.dist-info}/WHEEL +0 -0
- {ccxt-4.3.6.dist-info → ccxt-4.3.8.dist-info}/top_level.txt +0 -0
ccxt/async_support/coinlist.py
CHANGED
@@ -103,7 +103,11 @@ class coinlist(Exchange, ImplicitAPI):
|
|
103
103
|
'fetchOrders': True,
|
104
104
|
'fetchOrderTrades': True,
|
105
105
|
'fetchPosition': False,
|
106
|
+
'fetchPositionHistory': False,
|
107
|
+
'fetchPositionMode': False,
|
106
108
|
'fetchPositions': False,
|
109
|
+
'fetchPositionsForSymbol': False,
|
110
|
+
'fetchPositionsHistory': False,
|
107
111
|
'fetchPositionsRisk': False,
|
108
112
|
'fetchPremiumIndexOHLCV': False,
|
109
113
|
'fetchStatus': False,
|
@@ -1865,7 +1869,7 @@ class coinlist(Exchange, ImplicitAPI):
|
|
1865
1869
|
# coinlist returns both internal transfers and blockchain transactions
|
1866
1870
|
return self.parse_transactions(response, currency, since, limit)
|
1867
1871
|
|
1868
|
-
async def withdraw(self, code: str, amount: float, address, tag=None, params={}):
|
1872
|
+
async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}):
|
1869
1873
|
"""
|
1870
1874
|
request a withdrawal from CoinList wallet.(Disabled by default. Contact CoinList to apply for an exception.)
|
1871
1875
|
:see: https://trade-docs.coinlist.co/?javascript--nodejs#request-withdrawal-from-wallet
|
ccxt/async_support/coinmate.py
CHANGED
@@ -65,8 +65,11 @@ class coinmate(Exchange, ImplicitAPI):
|
|
65
65
|
'fetchOrderBook': True,
|
66
66
|
'fetchOrders': True,
|
67
67
|
'fetchPosition': False,
|
68
|
+
'fetchPositionHistory': False,
|
68
69
|
'fetchPositionMode': False,
|
69
70
|
'fetchPositions': False,
|
71
|
+
'fetchPositionsForSymbol': False,
|
72
|
+
'fetchPositionsHistory': False,
|
70
73
|
'fetchPositionsRisk': False,
|
71
74
|
'fetchPremiumIndexOHLCV': False,
|
72
75
|
'fetchTicker': True,
|
@@ -584,7 +587,7 @@ class coinmate(Exchange, ImplicitAPI):
|
|
584
587
|
},
|
585
588
|
}
|
586
589
|
|
587
|
-
async def withdraw(self, code: str, amount: float, address, tag=None, params={}):
|
590
|
+
async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}):
|
588
591
|
"""
|
589
592
|
make a withdrawal
|
590
593
|
:see: https://coinmate.docs.apiary.io/#reference/bitcoin-withdrawal-and-deposit/withdraw-bitcoins/post
|
ccxt/async_support/coinone.py
CHANGED
@@ -72,8 +72,11 @@ class coinone(Exchange, ImplicitAPI):
|
|
72
72
|
'fetchOrder': True,
|
73
73
|
'fetchOrderBook': True,
|
74
74
|
'fetchPosition': False,
|
75
|
+
'fetchPositionHistory': False,
|
75
76
|
'fetchPositionMode': False,
|
76
77
|
'fetchPositions': False,
|
78
|
+
'fetchPositionsForSymbol': False,
|
79
|
+
'fetchPositionsHistory': False,
|
77
80
|
'fetchPositionsRisk': False,
|
78
81
|
'fetchPremiumIndexOHLCV': False,
|
79
82
|
'fetchTicker': True,
|
ccxt/async_support/coinsph.py
CHANGED
@@ -108,7 +108,11 @@ class coinsph(Exchange, ImplicitAPI):
|
|
108
108
|
'fetchOrders': False,
|
109
109
|
'fetchOrderTrades': True,
|
110
110
|
'fetchPosition': False,
|
111
|
+
'fetchPositionHistory': False,
|
112
|
+
'fetchPositionMode': False,
|
111
113
|
'fetchPositions': False,
|
114
|
+
'fetchPositionsForSymbol': False,
|
115
|
+
'fetchPositionsHistory': False,
|
112
116
|
'fetchPositionsRisk': False,
|
113
117
|
'fetchPremiumIndexOHLCV': False,
|
114
118
|
'fetchStatus': True,
|
@@ -1497,7 +1501,7 @@ class coinsph(Exchange, ImplicitAPI):
|
|
1497
1501
|
'tierBased': None,
|
1498
1502
|
}
|
1499
1503
|
|
1500
|
-
async def withdraw(self, code: str, amount: float, address, tag=None, params={}):
|
1504
|
+
async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}):
|
1501
1505
|
"""
|
1502
1506
|
make a withdrawal to coins_ph account
|
1503
1507
|
:see: https://coins-docs.github.io/rest-api/#withdrawuser_data
|
ccxt/async_support/coinspot.py
CHANGED
@@ -60,8 +60,11 @@ class coinspot(Exchange, ImplicitAPI):
|
|
60
60
|
'fetchOpenInterestHistory': False,
|
61
61
|
'fetchOrderBook': True,
|
62
62
|
'fetchPosition': False,
|
63
|
+
'fetchPositionHistory': False,
|
63
64
|
'fetchPositionMode': False,
|
64
65
|
'fetchPositions': False,
|
66
|
+
'fetchPositionsForSymbol': False,
|
67
|
+
'fetchPositionsHistory': False,
|
65
68
|
'fetchPositionsRisk': False,
|
66
69
|
'fetchPremiumIndexOHLCV': False,
|
67
70
|
'fetchTicker': True,
|
ccxt/async_support/cryptocom.py
CHANGED
@@ -95,8 +95,10 @@ class cryptocom(Exchange, ImplicitAPI):
|
|
95
95
|
'fetchOrderBook': True,
|
96
96
|
'fetchOrders': True,
|
97
97
|
'fetchPosition': True,
|
98
|
+
'fetchPositionHistory': False,
|
98
99
|
'fetchPositionMode': False,
|
99
100
|
'fetchPositions': True,
|
101
|
+
'fetchPositionsHistory': False,
|
100
102
|
'fetchPremiumIndexOHLCV': False,
|
101
103
|
'fetchSettlementHistory': True,
|
102
104
|
'fetchStatus': False,
|
@@ -1516,7 +1518,7 @@ class cryptocom(Exchange, ImplicitAPI):
|
|
1516
1518
|
address = addressString
|
1517
1519
|
return [address, tag]
|
1518
1520
|
|
1519
|
-
async def withdraw(self, code: str, amount: float, address, tag=None, params={}):
|
1521
|
+
async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}):
|
1520
1522
|
"""
|
1521
1523
|
make a withdrawal
|
1522
1524
|
:see: https://exchange-docs.crypto.com/exchange/v1/rest-ws/index.html#private-create-withdrawal
|
ccxt/async_support/delta.py
CHANGED
@@ -2480,7 +2480,7 @@ class delta(Exchange, ImplicitAPI):
|
|
2480
2480
|
'previousFundingDatetime': None,
|
2481
2481
|
}
|
2482
2482
|
|
2483
|
-
async def add_margin(self, symbol: str, amount, params={}) -> MarginModification:
|
2483
|
+
async def add_margin(self, symbol: str, amount: float, params={}) -> MarginModification:
|
2484
2484
|
"""
|
2485
2485
|
add margin
|
2486
2486
|
:see: https://docs.delta.exchange/#add-remove-position-margin
|
@@ -2491,7 +2491,7 @@ class delta(Exchange, ImplicitAPI):
|
|
2491
2491
|
"""
|
2492
2492
|
return await self.modify_margin_helper(symbol, amount, 'add', params)
|
2493
2493
|
|
2494
|
-
async def reduce_margin(self, symbol: str, amount, params={}) -> MarginModification:
|
2494
|
+
async def reduce_margin(self, symbol: str, amount: float, params={}) -> MarginModification:
|
2495
2495
|
"""
|
2496
2496
|
remove margin from a position
|
2497
2497
|
:see: https://docs.delta.exchange/#add-remove-position-margin
|
ccxt/async_support/deribit.py
CHANGED
@@ -2749,7 +2749,7 @@ class deribit(Exchange, ImplicitAPI):
|
|
2749
2749
|
}
|
2750
2750
|
return self.safe_string(statuses, status, status)
|
2751
2751
|
|
2752
|
-
async def withdraw(self, code: str, amount: float, address, tag=None, params={}):
|
2752
|
+
async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}):
|
2753
2753
|
"""
|
2754
2754
|
make a withdrawal
|
2755
2755
|
:see: https://docs.deribit.com/#private-withdraw
|
ccxt/async_support/digifinex.py
CHANGED
@@ -2755,7 +2755,7 @@ class digifinex(Exchange, ImplicitAPI):
|
|
2755
2755
|
#
|
2756
2756
|
return self.parse_transfer(response, currency)
|
2757
2757
|
|
2758
|
-
async def withdraw(self, code: str, amount: float, address, tag=None, params={}):
|
2758
|
+
async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}):
|
2759
2759
|
"""
|
2760
2760
|
make a withdrawal
|
2761
2761
|
:param str code: unified currency code
|
@@ -3735,7 +3735,7 @@ class digifinex(Exchange, ImplicitAPI):
|
|
3735
3735
|
depositWithdrawFees[code] = self.assign_default_deposit_withdraw_fees(depositWithdrawFees[code], currency)
|
3736
3736
|
return depositWithdrawFees
|
3737
3737
|
|
3738
|
-
async def add_margin(self, symbol: str, amount, params={}) -> MarginModification:
|
3738
|
+
async def add_margin(self, symbol: str, amount: float, params={}) -> MarginModification:
|
3739
3739
|
"""
|
3740
3740
|
add margin to a position
|
3741
3741
|
:see: https://docs.digifinex.com/en-ww/swap/v2/rest.html#positionmargin
|
@@ -3749,7 +3749,7 @@ class digifinex(Exchange, ImplicitAPI):
|
|
3749
3749
|
self.check_required_argument('addMargin', side, 'side', ['long', 'short'])
|
3750
3750
|
return await self.modify_margin_helper(symbol, amount, 1, params)
|
3751
3751
|
|
3752
|
-
async def reduce_margin(self, symbol: str, amount, params={}) -> MarginModification:
|
3752
|
+
async def reduce_margin(self, symbol: str, amount: float, params={}) -> MarginModification:
|
3753
3753
|
"""
|
3754
3754
|
remove margin from a position
|
3755
3755
|
:see: https://docs.digifinex.com/en-ww/swap/v2/rest.html#positionmargin
|
ccxt/async_support/exmo.py
CHANGED
@@ -74,7 +74,12 @@ class exmo(Exchange, ImplicitAPI):
|
|
74
74
|
'fetchOrderBook': True,
|
75
75
|
'fetchOrderBooks': True,
|
76
76
|
'fetchOrderTrades': True,
|
77
|
+
'fetchPosition': False,
|
78
|
+
'fetchPositionHistory': False,
|
77
79
|
'fetchPositionMode': False,
|
80
|
+
'fetchPositions': False,
|
81
|
+
'fetchPositionsHistory': False,
|
82
|
+
'fetchPositionsRisk': False,
|
78
83
|
'fetchPremiumIndexOHLCV': False,
|
79
84
|
'fetchTicker': True,
|
80
85
|
'fetchTickers': True,
|
@@ -282,7 +287,7 @@ class exmo(Exchange, ImplicitAPI):
|
|
282
287
|
'datetime': None,
|
283
288
|
}
|
284
289
|
|
285
|
-
async def reduce_margin(self, symbol: str, amount, params={}) -> MarginModification:
|
290
|
+
async def reduce_margin(self, symbol: str, amount: float, params={}) -> MarginModification:
|
286
291
|
"""
|
287
292
|
remove margin from a position
|
288
293
|
:see: https://documenter.getpostman.com/view/10287440/SzYXWKPi#eebf9f25-0289-4946-9482-89872c738449
|
@@ -293,7 +298,7 @@ class exmo(Exchange, ImplicitAPI):
|
|
293
298
|
"""
|
294
299
|
return await self.modify_margin_helper(symbol, amount, 'reduce', params)
|
295
300
|
|
296
|
-
async def add_margin(self, symbol: str, amount, params={}) -> MarginModification:
|
301
|
+
async def add_margin(self, symbol: str, amount: float, params={}) -> MarginModification:
|
297
302
|
"""
|
298
303
|
add margin
|
299
304
|
:see: https://documenter.getpostman.com/view/10287440/SzYXWKPi#143ef808-79ca-4e49-9e79-a60ea4d8c0e3
|
@@ -1980,7 +1985,7 @@ class exmo(Exchange, ImplicitAPI):
|
|
1980
1985
|
return self.markets[symbols[0]]
|
1981
1986
|
return None
|
1982
1987
|
|
1983
|
-
async def withdraw(self, code: str, amount: float, address, tag=None, params={}):
|
1988
|
+
async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}):
|
1984
1989
|
"""
|
1985
1990
|
make a withdrawal
|
1986
1991
|
:see: https://documenter.getpostman.com/view/10287440/SzYXWKPi#3ab9c34d-ad58-4f87-9c57-2e2ea88a8325
|
ccxt/async_support/gate.py
CHANGED
@@ -7,7 +7,7 @@ from ccxt.async_support.base.exchange import Exchange
|
|
7
7
|
from ccxt.abstract.gate import ImplicitAPI
|
8
8
|
import asyncio
|
9
9
|
import hashlib
|
10
|
-
from ccxt.base.types import Balances, Currencies, Currency, FundingHistory, Greeks, Int, Leverage, Leverages, MarginModification, Market, MarketInterface, Num, Option, OptionChain, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, TradingFees, Transaction, TransferEntry
|
10
|
+
from ccxt.base.types import Balances, Currencies, Currency, FundingHistory, Greeks, Int, Leverage, Leverages, MarginModification, Market, MarketInterface, Num, Option, OptionChain, Order, OrderBook, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, TradingFees, Transaction, TransferEntry
|
11
11
|
from typing import List
|
12
12
|
from ccxt.base.errors import ExchangeError
|
13
13
|
from ccxt.base.errors import AuthenticationError
|
@@ -157,8 +157,10 @@ class gate(Exchange, ImplicitAPI):
|
|
157
157
|
'fetchOrder': True,
|
158
158
|
'fetchOrderBook': True,
|
159
159
|
'fetchPosition': True,
|
160
|
+
'fetchPositionHistory': 'emulated',
|
160
161
|
'fetchPositionMode': False,
|
161
162
|
'fetchPositions': True,
|
163
|
+
'fetchPositionsHistory': True,
|
162
164
|
'fetchPremiumIndexOHLCV': False,
|
163
165
|
'fetchSettlementHistory': True,
|
164
166
|
'fetchTicker': True,
|
@@ -673,7 +675,6 @@ class gate(Exchange, ImplicitAPI):
|
|
673
675
|
'option': 'options',
|
674
676
|
'options': 'options',
|
675
677
|
},
|
676
|
-
'defaultType': 'spot',
|
677
678
|
'swap': {
|
678
679
|
'fetchMarkets': {
|
679
680
|
'settlementCurrencies': ['usdt', 'btc'],
|
@@ -3392,7 +3393,7 @@ class gate(Exchange, ImplicitAPI):
|
|
3392
3393
|
response = await self.privateWalletGetWithdrawals(self.extend(request, params))
|
3393
3394
|
return self.parse_transactions(response, currency)
|
3394
3395
|
|
3395
|
-
async def withdraw(self, code: str, amount: float, address, tag=None, params={}):
|
3396
|
+
async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}):
|
3396
3397
|
"""
|
3397
3398
|
make a withdrawal
|
3398
3399
|
:see: https://www.gate.io/docs/developers/apiv4/en/#withdraw
|
@@ -4947,37 +4948,61 @@ class gate(Exchange, ImplicitAPI):
|
|
4947
4948
|
# "pending_orders": 0
|
4948
4949
|
# }
|
4949
4950
|
#
|
4951
|
+
# fetchPositionsHistory(swap and future)
|
4952
|
+
#
|
4953
|
+
# {
|
4954
|
+
# "contract": "SLERF_USDT", # Futures contract
|
4955
|
+
# "text": "web", # Text of close order
|
4956
|
+
# "long_price": "0.766306", # When 'side' is 'long,' it indicates the opening average price; when 'side' is 'short,' it indicates the closing average price.
|
4957
|
+
# "pnl": "-23.41702352", # PNL
|
4958
|
+
# "pnl_pnl": "-22.7187", # Position P/L
|
4959
|
+
# "pnl_fee": "-0.06527125", # Transaction Fees
|
4960
|
+
# "pnl_fund": "-0.63305227", # Funding Fees
|
4961
|
+
# "accum_size": "100",
|
4962
|
+
# "time": 1711279263, # Position close time
|
4963
|
+
# "short_price": "0.539119", # When 'side' is 'long,' it indicates the opening average price; when 'side' is 'short,' it indicates the closing average price
|
4964
|
+
# "side": "long", # Position side, long or short
|
4965
|
+
# "max_size": "100", # Max Trade Size
|
4966
|
+
# "first_open_time": 1711037985 # First Open Time
|
4967
|
+
# }
|
4968
|
+
#
|
4950
4969
|
contract = self.safe_string(position, 'contract')
|
4951
4970
|
market = self.safe_market(contract, market, '_', 'contract')
|
4952
|
-
size = self.
|
4953
|
-
side =
|
4954
|
-
if
|
4955
|
-
|
4956
|
-
|
4957
|
-
|
4971
|
+
size = self.safe_string_2(position, 'size', 'accum_size')
|
4972
|
+
side = self.safe_string(position, 'side')
|
4973
|
+
if side is None:
|
4974
|
+
if Precise.string_gt(size, '0'):
|
4975
|
+
side = 'long'
|
4976
|
+
elif Precise.string_lt(size, '0'):
|
4977
|
+
side = 'short'
|
4958
4978
|
maintenanceRate = self.safe_string(position, 'maintenance_rate')
|
4959
4979
|
notional = self.safe_string(position, 'value')
|
4960
4980
|
leverage = self.safe_string(position, 'leverage')
|
4961
4981
|
marginMode = None
|
4962
|
-
if leverage
|
4963
|
-
|
4964
|
-
|
4965
|
-
|
4966
|
-
|
4982
|
+
if leverage is not None:
|
4983
|
+
if leverage == '0':
|
4984
|
+
marginMode = 'cross'
|
4985
|
+
else:
|
4986
|
+
marginMode = 'isolated'
|
4967
4987
|
# Initial Position Margin = ( Position Value / Leverage ) + Close Position Fee
|
4968
4988
|
# *The default leverage under the full position is the highest leverage in the market.
|
4969
4989
|
# *Trading fee is charged Fee Rate(0.075%).
|
4970
|
-
|
4971
|
-
|
4972
|
-
|
4973
|
-
|
4990
|
+
feePaid = self.safe_string(position, 'pnl_fee')
|
4991
|
+
initialMarginString = None
|
4992
|
+
if feePaid is None:
|
4993
|
+
takerFee = '0.00075'
|
4994
|
+
feePaid = Precise.string_mul(takerFee, notional)
|
4995
|
+
initialMarginString = Precise.string_add(Precise.string_div(notional, leverage), feePaid)
|
4996
|
+
timestamp = self.safe_timestamp_2(position, 'open_time', 'first_open_time')
|
4997
|
+
if timestamp == 0:
|
4998
|
+
timestamp = None
|
4974
4999
|
return self.safe_position({
|
4975
5000
|
'info': position,
|
4976
5001
|
'id': None,
|
4977
5002
|
'symbol': self.safe_string(market, 'symbol'),
|
4978
5003
|
'timestamp': timestamp,
|
4979
5004
|
'datetime': self.iso8601(timestamp),
|
4980
|
-
'lastUpdateTimestamp': self.
|
5005
|
+
'lastUpdateTimestamp': self.safe_timestamp_2(position, 'update_time', 'time'),
|
4981
5006
|
'initialMargin': self.parse_number(initialMarginString),
|
4982
5007
|
'initialMarginPercentage': self.parse_number(Precise.string_div(initialMarginString, notional)),
|
4983
5008
|
'maintenanceMargin': self.parse_number(Precise.string_mul(maintenanceRate, notional)),
|
@@ -4985,11 +5010,10 @@ class gate(Exchange, ImplicitAPI):
|
|
4985
5010
|
'entryPrice': self.safe_number(position, 'entry_price'),
|
4986
5011
|
'notional': self.parse_number(notional),
|
4987
5012
|
'leverage': self.safe_number(position, 'leverage'),
|
4988
|
-
'unrealizedPnl': self.
|
4989
|
-
'realizedPnl': self.
|
5013
|
+
'unrealizedPnl': self.safe_number(position, 'unrealised_pnl'),
|
5014
|
+
'realizedPnl': self.safe_number_2(position, 'realised_pnl', 'pnl'),
|
4990
5015
|
'contracts': self.parse_number(Precise.string_abs(size)),
|
4991
5016
|
'contractSize': self.safe_number(market, 'contractSize'),
|
4992
|
-
# 'realisedPnl': position['realised_pnl'],
|
4993
5017
|
'marginRatio': None,
|
4994
5018
|
'liquidationPrice': self.safe_number(position, 'liq_price'),
|
4995
5019
|
'markPrice': self.safe_number(position, 'mark_price'),
|
@@ -5698,7 +5722,7 @@ class gate(Exchange, ImplicitAPI):
|
|
5698
5722
|
'datetime': None,
|
5699
5723
|
}
|
5700
5724
|
|
5701
|
-
async def reduce_margin(self, symbol: str, amount, params={}) -> MarginModification:
|
5725
|
+
async def reduce_margin(self, symbol: str, amount: float, params={}) -> MarginModification:
|
5702
5726
|
"""
|
5703
5727
|
remove margin from a position
|
5704
5728
|
:see: https://www.gate.io/docs/developers/apiv4/en/#update-position-margin
|
@@ -5710,7 +5734,7 @@ class gate(Exchange, ImplicitAPI):
|
|
5710
5734
|
"""
|
5711
5735
|
return await self.modify_margin_helper(symbol, -amount, params)
|
5712
5736
|
|
5713
|
-
async def add_margin(self, symbol: str, amount, params={}) -> MarginModification:
|
5737
|
+
async def add_margin(self, symbol: str, amount: float, params={}) -> MarginModification:
|
5714
5738
|
"""
|
5715
5739
|
add margin
|
5716
5740
|
:see: https://www.gate.io/docs/developers/apiv4/en/#update-position-margin
|
@@ -6869,6 +6893,70 @@ class gate(Exchange, ImplicitAPI):
|
|
6869
6893
|
'quoteVolume': None,
|
6870
6894
|
}
|
6871
6895
|
|
6896
|
+
async def fetch_positions_history(self, symbols: Strings = None, since: Int = None, limit: Int = None, params={}) -> List[Position]:
|
6897
|
+
"""
|
6898
|
+
fetches historical positions
|
6899
|
+
:see: https://www.gate.io/docs/developers/apiv4/#list-position-close-history
|
6900
|
+
:see: https://www.gate.io/docs/developers/apiv4/#list-position-close-history-2
|
6901
|
+
:param str[] symbols: unified conract symbols, must all have the same settle currency and the same market type
|
6902
|
+
:param int [since]: the earliest time in ms to fetch positions for
|
6903
|
+
:param int [limit]: the maximum amount of records to fetch, default=1000
|
6904
|
+
:param dict params: extra parameters specific to the exchange api endpoint
|
6905
|
+
:param int [params.until]: the latest time in ms to fetch positions for
|
6906
|
+
*
|
6907
|
+
* EXCHANGE SPECIFIC PARAMETERS
|
6908
|
+
:param int offset: list offset, starting from 0
|
6909
|
+
:param str side: long or short
|
6910
|
+
:param str pnl: query profit or loss
|
6911
|
+
:returns dict[]: a list of `position structures <https://docs.ccxt.com/#/?id=position-structure>`
|
6912
|
+
"""
|
6913
|
+
await self.load_markets()
|
6914
|
+
market = None
|
6915
|
+
if symbols is not None:
|
6916
|
+
symbolsLength = len(symbols)
|
6917
|
+
if symbolsLength == 1:
|
6918
|
+
market = self.market(symbols[0])
|
6919
|
+
marketType = None
|
6920
|
+
marketType, params = self.handle_market_type_and_params('fetchPositionsHistory', market, params, 'swap')
|
6921
|
+
until = self.safe_integer(params, 'until')
|
6922
|
+
params = self.omit(params, 'until')
|
6923
|
+
request = {}
|
6924
|
+
request, params = self.prepare_request(market, marketType, params)
|
6925
|
+
if limit is not None:
|
6926
|
+
request['limit'] = limit
|
6927
|
+
if since is not None:
|
6928
|
+
request['from'] = self.parse_to_int(since / 1000)
|
6929
|
+
if until is not None:
|
6930
|
+
request['to'] = self.parse_to_int(until / 1000)
|
6931
|
+
response = None
|
6932
|
+
if marketType == 'swap':
|
6933
|
+
response = await self.privateFuturesGetSettlePositionClose(self.extend(request, params))
|
6934
|
+
elif marketType == 'future':
|
6935
|
+
response = await self.privateDeliveryGetSettlePositionClose(self.extend(request, params))
|
6936
|
+
else:
|
6937
|
+
raise NotSupported(self.id + ' fetchPositionsHistory() does not support markets of type ' + marketType)
|
6938
|
+
#
|
6939
|
+
# [
|
6940
|
+
# {
|
6941
|
+
# "contract": "SLERF_USDT",
|
6942
|
+
# "text": "web",
|
6943
|
+
# "long_price": "0.766306",
|
6944
|
+
# "pnl": "-23.41702352",
|
6945
|
+
# "pnl_pnl": "-22.7187",
|
6946
|
+
# "pnl_fee": "-0.06527125",
|
6947
|
+
# "pnl_fund": "-0.63305227",
|
6948
|
+
# "accum_size": "100",
|
6949
|
+
# "time": 1711279263,
|
6950
|
+
# "short_price": "0.539119",
|
6951
|
+
# "side": "long",
|
6952
|
+
# "max_size": "100",
|
6953
|
+
# "first_open_time": 1711037985
|
6954
|
+
# },
|
6955
|
+
# ...
|
6956
|
+
# ]
|
6957
|
+
#
|
6958
|
+
return self.parse_positions(response, symbols, params)
|
6959
|
+
|
6872
6960
|
def handle_errors(self, code, reason, url, method, headers, body, response, requestHeaders, requestBody):
|
6873
6961
|
if response is None:
|
6874
6962
|
return None
|
ccxt/async_support/gemini.py
CHANGED
@@ -1523,7 +1523,7 @@ class gemini(Exchange, ImplicitAPI):
|
|
1523
1523
|
response = await self.privatePostV1Mytrades(self.extend(request, params))
|
1524
1524
|
return self.parse_trades(response, market, since, limit)
|
1525
1525
|
|
1526
|
-
async def withdraw(self, code: str, amount: float, address, tag=None, params={}):
|
1526
|
+
async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}):
|
1527
1527
|
"""
|
1528
1528
|
make a withdrawal
|
1529
1529
|
:see: https://docs.gemini.com/rest-api/#withdraw-crypto-funds
|
ccxt/async_support/hitbtc.py
CHANGED
@@ -2491,7 +2491,7 @@ class hitbtc(Exchange, ImplicitAPI):
|
|
2491
2491
|
'info': response,
|
2492
2492
|
}
|
2493
2493
|
|
2494
|
-
async def withdraw(self, code: str, amount: float, address, tag=None, params={}):
|
2494
|
+
async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}):
|
2495
2495
|
"""
|
2496
2496
|
make a withdrawal
|
2497
2497
|
:see: https://api.hitbtc.com/#withdraw-crypto
|
@@ -3008,8 +3008,9 @@ class hitbtc(Exchange, ImplicitAPI):
|
|
3008
3008
|
if market['swap']:
|
3009
3009
|
if leverage is None:
|
3010
3010
|
raise ArgumentsRequired(self.id + ' modifyMarginHelper() requires a leverage parameter for swap markets')
|
3011
|
-
|
3012
|
-
|
3011
|
+
stringAmount = self.number_to_string(amount)
|
3012
|
+
if stringAmount != '0':
|
3013
|
+
amount = self.amount_to_precision(symbol, stringAmount)
|
3013
3014
|
else:
|
3014
3015
|
amount = '0'
|
3015
3016
|
request = {
|
@@ -3091,7 +3092,7 @@ class hitbtc(Exchange, ImplicitAPI):
|
|
3091
3092
|
'datetime': datetime,
|
3092
3093
|
}
|
3093
3094
|
|
3094
|
-
async def reduce_margin(self, symbol: str, amount, params={}) -> MarginModification:
|
3095
|
+
async def reduce_margin(self, symbol: str, amount: float, params={}) -> MarginModification:
|
3095
3096
|
"""
|
3096
3097
|
remove margin from a position
|
3097
3098
|
:see: https://api.hitbtc.com/#create-update-margin-account-2
|
@@ -3103,11 +3104,11 @@ class hitbtc(Exchange, ImplicitAPI):
|
|
3103
3104
|
:param bool [params.margin]: True for reducing spot-margin
|
3104
3105
|
:returns dict: a `margin structure <https://docs.ccxt.com/#/?id=reduce-margin-structure>`
|
3105
3106
|
"""
|
3106
|
-
if amount != 0:
|
3107
|
+
if self.number_to_string(amount) != '0':
|
3107
3108
|
raise BadRequest(self.id + ' reduceMargin() on hitbtc requires the amount to be 0 and that will remove the entire margin amount')
|
3108
3109
|
return await self.modify_margin_helper(symbol, amount, 'reduce', params)
|
3109
3110
|
|
3110
|
-
async def add_margin(self, symbol: str, amount, params={}) -> MarginModification:
|
3111
|
+
async def add_margin(self, symbol: str, amount: float, params={}) -> MarginModification:
|
3111
3112
|
"""
|
3112
3113
|
add margin
|
3113
3114
|
:see: https://api.hitbtc.com/#create-update-margin-account-2
|
ccxt/async_support/hollaex.py
CHANGED
@@ -1609,7 +1609,7 @@ class hollaex(Exchange, ImplicitAPI):
|
|
1609
1609
|
'fee': fee,
|
1610
1610
|
}
|
1611
1611
|
|
1612
|
-
async def withdraw(self, code: str, amount: float, address, tag=None, params={}):
|
1612
|
+
async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}):
|
1613
1613
|
"""
|
1614
1614
|
make a withdrawal
|
1615
1615
|
:see: https://apidocs.hollaex.com/#withdrawal
|
ccxt/async_support/htx.py
CHANGED
@@ -121,7 +121,9 @@ class htx(Exchange, ImplicitAPI):
|
|
121
121
|
'fetchOrders': True,
|
122
122
|
'fetchOrderTrades': True,
|
123
123
|
'fetchPosition': True,
|
124
|
+
'fetchPositionHistory': 'emulated',
|
124
125
|
'fetchPositions': True,
|
126
|
+
'fetchPositionsHistory': False,
|
125
127
|
'fetchPositionsRisk': False,
|
126
128
|
'fetchPremiumIndexOHLCV': True,
|
127
129
|
'fetchSettlementHistory': True,
|
@@ -5976,7 +5978,7 @@ class htx(Exchange, ImplicitAPI):
|
|
5976
5978
|
}
|
5977
5979
|
return self.safe_string(statuses, status, status)
|
5978
5980
|
|
5979
|
-
async def withdraw(self, code: str, amount: float, address, tag=None, params={}):
|
5981
|
+
async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}):
|
5980
5982
|
"""
|
5981
5983
|
make a withdrawal
|
5982
5984
|
:param str code: unified currency code
|
ccxt/async_support/huobijp.py
CHANGED
@@ -1696,7 +1696,7 @@ class huobijp(Exchange, ImplicitAPI):
|
|
1696
1696
|
}
|
1697
1697
|
return self.safe_string(statuses, status, status)
|
1698
1698
|
|
1699
|
-
async def withdraw(self, code: str, amount: float, address, tag=None, params={}):
|
1699
|
+
async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}):
|
1700
1700
|
"""
|
1701
1701
|
make a withdrawal
|
1702
1702
|
:param str code: unified currency code
|
@@ -2127,7 +2127,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
2127
2127
|
#
|
2128
2128
|
return response
|
2129
2129
|
|
2130
|
-
async def add_margin(self, symbol: str, amount, params={}) -> MarginModification:
|
2130
|
+
async def add_margin(self, symbol: str, amount: float, params={}) -> MarginModification:
|
2131
2131
|
"""
|
2132
2132
|
add margin
|
2133
2133
|
:see: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#update-isolated-margin
|
@@ -2138,7 +2138,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
2138
2138
|
"""
|
2139
2139
|
return await self.modify_margin_helper(symbol, amount, 'add', params)
|
2140
2140
|
|
2141
|
-
async def reduce_margin(self, symbol: str, amount, params={}) -> MarginModification:
|
2141
|
+
async def reduce_margin(self, symbol: str, amount: float, params={}) -> MarginModification:
|
2142
2142
|
"""
|
2143
2143
|
:see: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#update-isolated-margin
|
2144
2144
|
remove margin from a position
|
ccxt/async_support/idex.py
CHANGED
@@ -88,8 +88,11 @@ class idex(Exchange, ImplicitAPI):
|
|
88
88
|
'fetchOrderBook': True,
|
89
89
|
'fetchOrders': False,
|
90
90
|
'fetchPosition': False,
|
91
|
+
'fetchPositionHistory': False,
|
91
92
|
'fetchPositionMode': False,
|
92
93
|
'fetchPositions': False,
|
94
|
+
'fetchPositionsForSymbol': False,
|
95
|
+
'fetchPositionsHistory': False,
|
93
96
|
'fetchPositionsRisk': False,
|
94
97
|
'fetchPremiumIndexOHLCV': False,
|
95
98
|
'fetchStatus': True,
|
@@ -1287,7 +1290,7 @@ class idex(Exchange, ImplicitAPI):
|
|
1287
1290
|
response = await self.privatePostOrders(request)
|
1288
1291
|
return self.parse_order(response, market)
|
1289
1292
|
|
1290
|
-
async def withdraw(self, code: str, amount: float, address, tag=None, params={}):
|
1293
|
+
async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}):
|
1291
1294
|
"""
|
1292
1295
|
make a withdrawal
|
1293
1296
|
:see: https://api-docs-v3.idex.io/#withdraw-funds
|
@@ -64,8 +64,11 @@ class independentreserve(Exchange, ImplicitAPI):
|
|
64
64
|
'fetchOrder': True,
|
65
65
|
'fetchOrderBook': True,
|
66
66
|
'fetchPosition': False,
|
67
|
+
'fetchPositionHistory': False,
|
67
68
|
'fetchPositionMode': False,
|
68
69
|
'fetchPositions': False,
|
70
|
+
'fetchPositionsForSymbol': False,
|
71
|
+
'fetchPositionsHistory': False,
|
69
72
|
'fetchPositionsRisk': False,
|
70
73
|
'fetchPremiumIndexOHLCV': False,
|
71
74
|
'fetchTicker': True,
|
ccxt/async_support/indodax.py
CHANGED
@@ -78,8 +78,11 @@ class indodax(Exchange, ImplicitAPI):
|
|
78
78
|
'fetchOrderBook': True,
|
79
79
|
'fetchOrders': False,
|
80
80
|
'fetchPosition': False,
|
81
|
+
'fetchPositionHistory': False,
|
81
82
|
'fetchPositionMode': False,
|
82
83
|
'fetchPositions': False,
|
84
|
+
'fetchPositionsForSymbol': False,
|
85
|
+
'fetchPositionsHistory': False,
|
83
86
|
'fetchPositionsRisk': False,
|
84
87
|
'fetchPremiumIndexOHLCV': False,
|
85
88
|
'fetchTicker': True,
|
@@ -951,7 +954,7 @@ class indodax(Exchange, ImplicitAPI):
|
|
951
954
|
transactions = self.array_concat(withdraws, deposits)
|
952
955
|
return self.parse_transactions(transactions, currency, since, limit)
|
953
956
|
|
954
|
-
async def withdraw(self, code: str, amount: float, address, tag=None, params={}):
|
957
|
+
async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}):
|
955
958
|
"""
|
956
959
|
make a withdrawal
|
957
960
|
:see: https://github.com/btcid/indodax-official-api-docs/blob/master/Private-RestAPI.md#withdraw-coin-endpoints
|
ccxt/async_support/kraken.py
CHANGED
@@ -2522,7 +2522,7 @@ class kraken(Exchange, ImplicitAPI):
|
|
2522
2522
|
'info': depositAddress,
|
2523
2523
|
}
|
2524
2524
|
|
2525
|
-
async def withdraw(self, code: str, amount: float, address, tag=None, params={}):
|
2525
|
+
async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}):
|
2526
2526
|
"""
|
2527
2527
|
make a withdrawal
|
2528
2528
|
:see: https://docs.kraken.com/rest/#tag/Funding/operation/withdrawFunds
|
ccxt/async_support/kucoin.py
CHANGED
@@ -108,7 +108,9 @@ class kucoin(Exchange, ImplicitAPI):
|
|
108
108
|
'fetchOrderBooks': False,
|
109
109
|
'fetchOrdersByStatus': True,
|
110
110
|
'fetchOrderTrades': True,
|
111
|
+
'fetchPositionHistory': False,
|
111
112
|
'fetchPositionMode': False,
|
113
|
+
'fetchPositionsHistory': False,
|
112
114
|
'fetchPremiumIndexOHLCV': False,
|
113
115
|
'fetchStatus': True,
|
114
116
|
'fetchTicker': True,
|
@@ -3004,7 +3006,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
3004
3006
|
'tierBased': True,
|
3005
3007
|
}
|
3006
3008
|
|
3007
|
-
async def withdraw(self, code: str, amount: float, address, tag=None, params={}):
|
3009
|
+
async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}):
|
3008
3010
|
"""
|
3009
3011
|
make a withdrawal
|
3010
3012
|
:see: https://www.kucoin.com/docs/rest/funding/withdrawals/apply-withdraw
|