ccxt 4.3.6__py2.py3-none-any.whl → 4.3.7__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 +5 -3
- ccxt/async_support/bingx.py +3 -1
- 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 +70 -4
- 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 +151 -47
- 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 +80 -4
- 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 +3 -1
- 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 +27 -1
- ccxt/bigone.py +1 -1
- ccxt/binance.py +5 -3
- ccxt/bingx.py +3 -1
- ccxt/bitbank.py +4 -1
- ccxt/bitfinex.py +1 -1
- ccxt/bitfinex2.py +1 -1
- ccxt/bitflyer.py +1 -1
- ccxt/bitget.py +70 -4
- 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 +151 -47
- 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 +80 -4
- 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 +3 -1
- ccxt/yobit.py +4 -1
- ccxt/zaif.py +1 -1
- ccxt/zonda.py +1 -1
- {ccxt-4.3.6.dist-info → ccxt-4.3.7.dist-info}/METADATA +4 -4
- {ccxt-4.3.6.dist-info → ccxt-4.3.7.dist-info}/RECORD +178 -178
- {ccxt-4.3.6.dist-info → ccxt-4.3.7.dist-info}/WHEEL +0 -0
- {ccxt-4.3.6.dist-info → ccxt-4.3.7.dist-info}/top_level.txt +0 -0
ccxt/async_support/coinex.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.async_support.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.coinex import ImplicitAPI
|
8
8
|
import asyncio
|
9
|
-
from ccxt.base.types import Balances, Currencies, Currency, Int, Leverage, Leverages, MarginModification, Market, Num, Order, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, TradingFees, Transaction, TransferEntry
|
9
|
+
from ccxt.base.types import Balances, Currencies, Currency, Int, Leverage, Leverages, MarginModification, Market, Num, Order, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, TradingFees, Transaction, TransferEntry
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
12
|
from ccxt.base.errors import AuthenticationError
|
@@ -103,7 +103,9 @@ class coinex(Exchange, ImplicitAPI):
|
|
103
103
|
'fetchOrder': True,
|
104
104
|
'fetchOrderBook': True,
|
105
105
|
'fetchPosition': True,
|
106
|
+
'fetchPositionHistory': True,
|
106
107
|
'fetchPositions': True,
|
108
|
+
'fetchPositionsHistory': False,
|
107
109
|
'fetchPositionsRisk': False,
|
108
110
|
'fetchPremiumIndexOHLCV': False,
|
109
111
|
'fetchTicker': True,
|
@@ -1416,31 +1418,31 @@ class coinex(Exchange, ImplicitAPI):
|
|
1416
1418
|
|
1417
1419
|
def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
|
1418
1420
|
#
|
1419
|
-
#
|
1420
|
-
#
|
1421
|
-
# "
|
1422
|
-
# "
|
1423
|
-
# "
|
1424
|
-
# "
|
1425
|
-
# "
|
1426
|
-
# "
|
1427
|
-
# "
|
1428
|
-
#
|
1421
|
+
# {
|
1422
|
+
# "close": "66999.95",
|
1423
|
+
# "created_at": 1713934620000,
|
1424
|
+
# "high": "66999.95",
|
1425
|
+
# "low": "66988.53",
|
1426
|
+
# "market": "BTCUSDT",
|
1427
|
+
# "open": "66988.53",
|
1428
|
+
# "value": "0.1572393", # base volume
|
1429
|
+
# "volume": "10533.2501364336" # quote volume
|
1430
|
+
# }
|
1429
1431
|
#
|
1430
1432
|
return [
|
1431
|
-
self.
|
1432
|
-
self.safe_number(ohlcv,
|
1433
|
-
self.safe_number(ohlcv,
|
1434
|
-
self.safe_number(ohlcv,
|
1435
|
-
self.safe_number(ohlcv,
|
1436
|
-
self.safe_number(ohlcv,
|
1433
|
+
self.safe_integer(ohlcv, 'created_at'),
|
1434
|
+
self.safe_number(ohlcv, 'open'),
|
1435
|
+
self.safe_number(ohlcv, 'high'),
|
1436
|
+
self.safe_number(ohlcv, 'low'),
|
1437
|
+
self.safe_number(ohlcv, 'close'),
|
1438
|
+
self.safe_number(ohlcv, 'value'),
|
1437
1439
|
]
|
1438
1440
|
|
1439
1441
|
async def fetch_ohlcv(self, symbol: str, timeframe='1m', since: Int = None, limit: Int = None, params={}) -> List[list]:
|
1440
1442
|
"""
|
1441
1443
|
fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
1442
|
-
:see: https://
|
1443
|
-
:see: https://
|
1444
|
+
:see: https://docs.coinex.com/api/v2/spot/market/http/list-market-kline
|
1445
|
+
:see: https://docs.coinex.com/api/v2/futures/market/http/list-market-kline
|
1444
1446
|
:param str symbol: unified symbol of the market to fetch OHLCV data for
|
1445
1447
|
:param str timeframe: the length of time each candle represents
|
1446
1448
|
:param int [since]: timestamp in ms of the earliest candle to fetch
|
@@ -1452,36 +1454,31 @@ class coinex(Exchange, ImplicitAPI):
|
|
1452
1454
|
market = self.market(symbol)
|
1453
1455
|
request = {
|
1454
1456
|
'market': market['id'],
|
1455
|
-
'
|
1457
|
+
'period': self.safe_string(self.timeframes, timeframe, timeframe),
|
1456
1458
|
}
|
1457
1459
|
if limit is not None:
|
1458
1460
|
request['limit'] = limit
|
1459
1461
|
response = None
|
1460
1462
|
if market['swap']:
|
1461
|
-
response = await self.
|
1463
|
+
response = await self.v2PublicGetFuturesKline(self.extend(request, params))
|
1462
1464
|
else:
|
1463
|
-
response = await self.
|
1464
|
-
#
|
1465
|
-
# Spot
|
1465
|
+
response = await self.v2PublicGetSpotKline(self.extend(request, params))
|
1466
1466
|
#
|
1467
|
-
#
|
1468
|
-
# "code": 0,
|
1469
|
-
# "data": [
|
1470
|
-
# [1591484400, "0.02505349", "0.02506988", "0.02507000", "0.02505304", "343.19716223", "8.6021323866383196", "ETHBTC"],
|
1471
|
-
# [1591484700, "0.02506990", "0.02508109", "0.02508109", "0.02506979", "91.59841581", "2.2972047780447000", "ETHBTC"],
|
1472
|
-
# [1591485000, "0.02508106", "0.02507996", "0.02508106", "0.02507500", "65.15307697", "1.6340597822306000", "ETHBTC"],
|
1473
|
-
# ],
|
1474
|
-
# "message": "OK"
|
1475
|
-
# }
|
1476
|
-
#
|
1477
|
-
# Swap
|
1467
|
+
# Spot and Swap
|
1478
1468
|
#
|
1479
1469
|
# {
|
1480
1470
|
# "code": 0,
|
1481
1471
|
# "data": [
|
1482
|
-
#
|
1483
|
-
#
|
1484
|
-
#
|
1472
|
+
# {
|
1473
|
+
# "close": "66999.95",
|
1474
|
+
# "created_at": 1713934620000,
|
1475
|
+
# "high": "66999.95",
|
1476
|
+
# "low": "66988.53",
|
1477
|
+
# "market": "BTCUSDT",
|
1478
|
+
# "open": "66988.53",
|
1479
|
+
# "value": "0.1572393",
|
1480
|
+
# "volume": "10533.2501364336"
|
1481
|
+
# },
|
1485
1482
|
# ],
|
1486
1483
|
# "message": "OK"
|
1487
1484
|
# }
|
@@ -3519,7 +3516,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
3519
3516
|
# "side": 2,
|
3520
3517
|
# "stop_loss_price": "0.00000000000000000000",
|
3521
3518
|
# "stop_loss_type": 0,
|
3522
|
-
# "
|
3519
|
+
# "sy s": 0,
|
3523
3520
|
# "take_profit_price": "0.00000000000000000000",
|
3524
3521
|
# "take_profit_type": 0,
|
3525
3522
|
# "taker_fee": "0.00000000000000000000",
|
@@ -3598,7 +3595,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
3598
3595
|
# "side": 2,
|
3599
3596
|
# "stop_loss_price": "0.00000000000000000000",
|
3600
3597
|
# "stop_loss_type": 0,
|
3601
|
-
# "
|
3598
|
+
# "s ys": 0,
|
3602
3599
|
# "take_profit_price": "0.00000000000000000000",
|
3603
3600
|
# "take_profit_type": 0,
|
3604
3601
|
# "taker_fee": "0.00000000000000000000",
|
@@ -3615,6 +3612,8 @@ class coinex(Exchange, ImplicitAPI):
|
|
3615
3612
|
return self.parse_position(data[0], market)
|
3616
3613
|
|
3617
3614
|
def parse_position(self, position, market: Market = None):
|
3615
|
+
#
|
3616
|
+
# fetchPosition
|
3618
3617
|
#
|
3619
3618
|
# {
|
3620
3619
|
# "adl_sort": 3396,
|
@@ -3658,7 +3657,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
3658
3657
|
# "side": 2,
|
3659
3658
|
# "stop_loss_price": "0.00000000000000000000",
|
3660
3659
|
# "stop_loss_type": 0,
|
3661
|
-
# "
|
3660
|
+
# "s ys": 0,
|
3662
3661
|
# "take_profit_price": "0.00000000000000000000",
|
3663
3662
|
# "take_profit_type": 0,
|
3664
3663
|
# "taker_fee": "0.00000000000000000000",
|
@@ -3668,6 +3667,40 @@ class coinex(Exchange, ImplicitAPI):
|
|
3668
3667
|
# "user_id": 3620173
|
3669
3668
|
# }
|
3670
3669
|
#
|
3670
|
+
#
|
3671
|
+
# fetchPositionHistory
|
3672
|
+
#
|
3673
|
+
# {
|
3674
|
+
# amount_max: '10',
|
3675
|
+
# amount_max_margin: '2.03466666666666666666',
|
3676
|
+
# bkr_price: '0',
|
3677
|
+
# create_time: '1711150526.2581',
|
3678
|
+
# deal_all: '12.591',
|
3679
|
+
# deal_asset_fee: '0',
|
3680
|
+
# fee_asset: '',
|
3681
|
+
# finish_type: '5',
|
3682
|
+
# first_price: '0.6104',
|
3683
|
+
# latest_price: '0.6487',
|
3684
|
+
# leverage: '3',
|
3685
|
+
# liq_amount: '0',
|
3686
|
+
# liq_price: '0',
|
3687
|
+
# liq_profit: '0',
|
3688
|
+
# mainten_margin: '0.01',
|
3689
|
+
# market: 'XRPUSDT',
|
3690
|
+
# market_type: '1',
|
3691
|
+
# open_price: '0.6104',
|
3692
|
+
# open_val_max: '6.104',
|
3693
|
+
# position_id: '297371462',
|
3694
|
+
# profit_real: '0.35702107169',
|
3695
|
+
# settle_price: '0.6104',
|
3696
|
+
# settle_val: '0',
|
3697
|
+
# side: '2',
|
3698
|
+
# s ys: "0",
|
3699
|
+
# type: '2',
|
3700
|
+
# update_time: '1711391446.133233',
|
3701
|
+
# user_id: '3685860'
|
3702
|
+
# }
|
3703
|
+
#
|
3671
3704
|
marketId = self.safe_string(position, 'market')
|
3672
3705
|
market = self.safe_market(marketId, market, None, 'swap')
|
3673
3706
|
symbol = market['symbol']
|
@@ -3683,7 +3716,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
3683
3716
|
timestamp = self.safe_timestamp(position, 'update_time')
|
3684
3717
|
maintenanceMargin = self.safe_string(position, 'mainten_margin_amount')
|
3685
3718
|
maintenanceMarginPercentage = self.safe_string(position, 'mainten_margin')
|
3686
|
-
collateral = self.
|
3719
|
+
collateral = self.safe_string_2(position, 'margin_amount', 'amount_max_margin')
|
3687
3720
|
leverage = self.safe_string(position, 'leverage')
|
3688
3721
|
notional = self.safe_string(position, 'open_val')
|
3689
3722
|
initialMargin = Precise.string_div(notional, leverage)
|
@@ -3893,7 +3926,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
3893
3926
|
# "side": 2,
|
3894
3927
|
# "stop_loss_price": "0.00000000000000000000",
|
3895
3928
|
# "stop_loss_type": 0,
|
3896
|
-
# "
|
3929
|
+
# "s ys": 0,
|
3897
3930
|
# "take_profit_price": "0.00000000000000000000",
|
3898
3931
|
# "take_profit_type": 0,
|
3899
3932
|
# "taker_fee": "0.00000000000000000000",
|
@@ -3958,7 +3991,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
3958
3991
|
# "side": 2,
|
3959
3992
|
# "stop_loss_price": "0.00000000000000000000",
|
3960
3993
|
# "stop_loss_type": 0,
|
3961
|
-
# "
|
3994
|
+
# "sy s": 0,
|
3962
3995
|
# "take_profit_price": "0.00000000000000000000",
|
3963
3996
|
# "take_profit_type": 0,
|
3964
3997
|
# "taker_fee": "0.00000000000000000000",
|
@@ -4002,7 +4035,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
4002
4035
|
'datetime': self.iso8601(timestamp),
|
4003
4036
|
}
|
4004
4037
|
|
4005
|
-
async def add_margin(self, symbol: str, amount, params={}) -> MarginModification:
|
4038
|
+
async def add_margin(self, symbol: str, amount: float, params={}) -> MarginModification:
|
4006
4039
|
"""
|
4007
4040
|
add margin
|
4008
4041
|
:see: https://viabtc.github.io/coinex_api_en_doc/futures/#docsfutures001_http032_adjust_position_margin
|
@@ -4013,7 +4046,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
4013
4046
|
"""
|
4014
4047
|
return await self.modify_margin_helper(symbol, amount, 1, params)
|
4015
4048
|
|
4016
|
-
async def reduce_margin(self, symbol: str, amount, params={}) -> MarginModification:
|
4049
|
+
async def reduce_margin(self, symbol: str, amount: float, params={}) -> MarginModification:
|
4017
4050
|
"""
|
4018
4051
|
remove margin from a position
|
4019
4052
|
:see: https://viabtc.github.io/coinex_api_en_doc/futures/#docsfutures001_http032_adjust_position_margin
|
@@ -4265,7 +4298,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
4265
4298
|
result.append(self.parse_funding_rate(ticker, marketInner))
|
4266
4299
|
return self.filter_by_array(result, 'symbol', symbols)
|
4267
4300
|
|
4268
|
-
async def withdraw(self, code: str, amount: float, address, tag=None, params={}):
|
4301
|
+
async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}):
|
4269
4302
|
"""
|
4270
4303
|
make a withdrawal
|
4271
4304
|
:see: https://viabtc.github.io/coinex_api_en_doc/spot/#docsspot002_account015_submit_withdraw
|
@@ -5252,6 +5285,77 @@ class coinex(Exchange, ImplicitAPI):
|
|
5252
5285
|
'shortLeverage': leverageValue,
|
5253
5286
|
}
|
5254
5287
|
|
5288
|
+
async def fetch_position_history(self, symbol: str, since: Int = None, limit: Int = None, params={}) -> Position:
|
5289
|
+
"""
|
5290
|
+
fetches historical positions
|
5291
|
+
:see: https://viabtc.github.io/coinex_api_en_doc/futures/#docsfutures001_http033-0_finished_position
|
5292
|
+
:param str symbol: unified contract symbol
|
5293
|
+
:param int [since]: not used by coinex fetchPositionHistory
|
5294
|
+
:param int [limit]: the maximum amount of records to fetch, default=1000
|
5295
|
+
:param dict params: extra parameters specific to the exchange api endpoint
|
5296
|
+
*
|
5297
|
+
* EXCHANGE SPECIFIC PARAMETERS
|
5298
|
+
:param int [params.side]: 0: all 1: sell, 2: buy
|
5299
|
+
:returns dict[]: a list of `position structures <https://docs.ccxt.com/#/?id=position-structure>`
|
5300
|
+
"""
|
5301
|
+
await self.load_markets()
|
5302
|
+
market = self.market(symbol)
|
5303
|
+
if limit is None:
|
5304
|
+
limit = 1000
|
5305
|
+
request = {
|
5306
|
+
'market': market['id'],
|
5307
|
+
'side': 0,
|
5308
|
+
'limit': limit,
|
5309
|
+
}
|
5310
|
+
response = await self.v1PerpetualPrivateGetPositionFinished(self.extend(request, params))
|
5311
|
+
#
|
5312
|
+
# {
|
5313
|
+
# code: '0',
|
5314
|
+
# data: {
|
5315
|
+
# limit: '1000',
|
5316
|
+
# offset: '0',
|
5317
|
+
# records: [
|
5318
|
+
# {
|
5319
|
+
# amount_max: '10',
|
5320
|
+
# amount_max_margin: '2.03466666666666666666',
|
5321
|
+
# bkr_price: '0',
|
5322
|
+
# create_time: '1711150526.2581',
|
5323
|
+
# deal_all: '12.591',
|
5324
|
+
# deal_asset_fee: '0',
|
5325
|
+
# fee_asset: '',
|
5326
|
+
# finish_type: '5',
|
5327
|
+
# first_price: '0.6104',
|
5328
|
+
# latest_price: '0.6487',
|
5329
|
+
# leverage: '3',
|
5330
|
+
# liq_amount: '0',
|
5331
|
+
# liq_price: '0',
|
5332
|
+
# liq_profit: '0',
|
5333
|
+
# mainten_margin: '0.01',
|
5334
|
+
# market: 'XRPUSDT',
|
5335
|
+
# market_type: '1',
|
5336
|
+
# open_price: '0.6104',
|
5337
|
+
# open_val_max: '6.104',
|
5338
|
+
# position_id: '297371462',
|
5339
|
+
# profit_real: '0.35702107169',
|
5340
|
+
# settle_price: '0.6104',
|
5341
|
+
# settle_val: '0',
|
5342
|
+
# side: '2',
|
5343
|
+
# sy s: '0',
|
5344
|
+
# type: '2',
|
5345
|
+
# update_time: '1711391446.133233',
|
5346
|
+
# user_id: '3685860'
|
5347
|
+
# },
|
5348
|
+
# ...
|
5349
|
+
# ]
|
5350
|
+
# },
|
5351
|
+
# message: 'OK'
|
5352
|
+
# }
|
5353
|
+
#
|
5354
|
+
data = self.safe_dict(response, 'data')
|
5355
|
+
records = self.safe_list(data, 'records')
|
5356
|
+
positions = self.parse_positions(records)
|
5357
|
+
return self.filter_by_symbol_since_limit(positions, symbol, since, limit)
|
5358
|
+
|
5255
5359
|
def handle_margin_mode_and_params(self, methodName, params={}, defaultValue=None):
|
5256
5360
|
"""
|
5257
5361
|
* @ignore
|
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
|