ccxt 4.4.36__py2.py3-none-any.whl → 4.4.38__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 +3 -3
- ccxt/abstract/bingx.py +0 -1
- ccxt/abstract/bitfinex.py +136 -65
- ccxt/abstract/bitfinex1.py +69 -0
- ccxt/async_support/__init__.py +3 -3
- ccxt/async_support/base/exchange.py +1 -1
- ccxt/async_support/binance.py +0 -2
- ccxt/async_support/bingx.py +89 -8
- ccxt/async_support/bitfinex.py +3005 -1084
- ccxt/async_support/bitfinex1.py +1704 -0
- ccxt/async_support/bitget.py +2 -4
- ccxt/async_support/bithumb.py +1 -1
- ccxt/async_support/bitmart.py +160 -13
- ccxt/async_support/bybit.py +3 -2
- ccxt/async_support/coinbase.py +86 -0
- ccxt/async_support/gate.py +1 -1
- ccxt/async_support/hyperliquid.py +124 -14
- ccxt/async_support/kucoin.py +75 -2
- ccxt/async_support/kucoinfutures.py +92 -5
- ccxt/async_support/ndax.py +5 -1
- ccxt/async_support/okx.py +0 -1
- ccxt/async_support/paradex.py +2 -2
- ccxt/async_support/probit.py +3 -1
- ccxt/base/exchange.py +9 -2
- ccxt/binance.py +0 -2
- ccxt/bingx.py +89 -8
- ccxt/bitfinex.py +3005 -1084
- ccxt/bitfinex1.py +1703 -0
- ccxt/bitget.py +2 -4
- ccxt/bithumb.py +1 -1
- ccxt/bitmart.py +160 -13
- ccxt/bybit.py +3 -2
- ccxt/coinbase.py +86 -0
- ccxt/gate.py +1 -1
- ccxt/hyperliquid.py +124 -14
- ccxt/kucoin.py +75 -2
- ccxt/kucoinfutures.py +92 -5
- ccxt/ndax.py +5 -1
- ccxt/okx.py +0 -1
- ccxt/paradex.py +2 -2
- ccxt/pro/__init__.py +3 -3
- ccxt/pro/bitfinex.py +725 -274
- ccxt/pro/bitfinex1.py +635 -0
- ccxt/pro/probit.py +1 -0
- ccxt/probit.py +3 -1
- ccxt/test/tests_async.py +5 -1
- ccxt/test/tests_sync.py +5 -1
- {ccxt-4.4.36.dist-info → ccxt-4.4.38.dist-info}/METADATA +8 -8
- {ccxt-4.4.36.dist-info → ccxt-4.4.38.dist-info}/RECORD +52 -49
- ccxt/abstract/bitfinex2.py +0 -140
- {ccxt-4.4.36.dist-info → ccxt-4.4.38.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.36.dist-info → ccxt-4.4.38.dist-info}/WHEEL +0 -0
- {ccxt-4.4.36.dist-info → ccxt-4.4.38.dist-info}/top_level.txt +0 -0
ccxt/__init__.py
CHANGED
@@ -22,7 +22,7 @@
|
|
22
22
|
|
23
23
|
# ----------------------------------------------------------------------------
|
24
24
|
|
25
|
-
__version__ = '4.4.
|
25
|
+
__version__ = '4.4.38'
|
26
26
|
|
27
27
|
# ----------------------------------------------------------------------------
|
28
28
|
|
@@ -98,7 +98,7 @@ from ccxt.bitbank import bitbank # noqa: F4
|
|
98
98
|
from ccxt.bitbns import bitbns # noqa: F401
|
99
99
|
from ccxt.bitcoincom import bitcoincom # noqa: F401
|
100
100
|
from ccxt.bitfinex import bitfinex # noqa: F401
|
101
|
-
from ccxt.
|
101
|
+
from ccxt.bitfinex1 import bitfinex1 # noqa: F401
|
102
102
|
from ccxt.bitflyer import bitflyer # noqa: F401
|
103
103
|
from ccxt.bitget import bitget # noqa: F401
|
104
104
|
from ccxt.bithumb import bithumb # noqa: F401
|
@@ -211,7 +211,7 @@ exchanges = [
|
|
211
211
|
'bitbns',
|
212
212
|
'bitcoincom',
|
213
213
|
'bitfinex',
|
214
|
-
'
|
214
|
+
'bitfinex1',
|
215
215
|
'bitflyer',
|
216
216
|
'bitget',
|
217
217
|
'bithumb',
|
ccxt/abstract/bingx.py
CHANGED
@@ -35,7 +35,6 @@ class ImplicitAPI:
|
|
35
35
|
swap_v1_public_get_market_markpriceklines = swapV1PublicGetMarketMarkPriceKlines = Entry('market/markPriceKlines', ['swap', 'v1', 'public'], 'GET', {'cost': 1})
|
36
36
|
swap_v1_public_get_trade_multiassetsrules = swapV1PublicGetTradeMultiAssetsRules = Entry('trade/multiAssetsRules', ['swap', 'v1', 'public'], 'GET', {'cost': 1})
|
37
37
|
swap_v1_private_get_positionside_dual = swapV1PrivateGetPositionSideDual = Entry('positionSide/dual', ['swap', 'v1', 'private'], 'GET', {'cost': 5})
|
38
|
-
swap_v1_private_get_market_markpriceklines = swapV1PrivateGetMarketMarkPriceKlines = Entry('market/markPriceKlines', ['swap', 'v1', 'private'], 'GET', {'cost': 1})
|
39
38
|
swap_v1_private_get_trade_batchcancelreplace = swapV1PrivateGetTradeBatchCancelReplace = Entry('trade/batchCancelReplace', ['swap', 'v1', 'private'], 'GET', {'cost': 5})
|
40
39
|
swap_v1_private_get_trade_fullorder = swapV1PrivateGetTradeFullOrder = Entry('trade/fullOrder', ['swap', 'v1', 'private'], 'GET', {'cost': 2})
|
41
40
|
swap_v1_private_get_maintmarginratio = swapV1PrivateGetMaintMarginRatio = Entry('maintMarginRatio', ['swap', 'v1', 'private'], 'GET', {'cost': 2})
|
ccxt/abstract/bitfinex.py
CHANGED
@@ -2,68 +2,139 @@ from ccxt.base.types import Entry
|
|
2
2
|
|
3
3
|
|
4
4
|
class ImplicitAPI:
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
5
|
+
public_get_conf_config = publicGetConfConfig = Entry('conf/{config}', 'public', 'GET', {'cost': 2.7})
|
6
|
+
public_get_conf_pub_action_object = publicGetConfPubActionObject = Entry('conf/pub:{action}:{object}', 'public', 'GET', {'cost': 2.7})
|
7
|
+
public_get_conf_pub_action_object_detail = publicGetConfPubActionObjectDetail = Entry('conf/pub:{action}:{object}:{detail}', 'public', 'GET', {'cost': 2.7})
|
8
|
+
public_get_conf_pub_map_object = publicGetConfPubMapObject = Entry('conf/pub:map:{object}', 'public', 'GET', {'cost': 2.7})
|
9
|
+
public_get_conf_pub_map_object_detail = publicGetConfPubMapObjectDetail = Entry('conf/pub:map:{object}:{detail}', 'public', 'GET', {'cost': 2.7})
|
10
|
+
public_get_conf_pub_map_currency_detail = publicGetConfPubMapCurrencyDetail = Entry('conf/pub:map:currency:{detail}', 'public', 'GET', {'cost': 2.7})
|
11
|
+
public_get_conf_pub_map_currency_sym = publicGetConfPubMapCurrencySym = Entry('conf/pub:map:currency:sym', 'public', 'GET', {'cost': 2.7})
|
12
|
+
public_get_conf_pub_map_currency_label = publicGetConfPubMapCurrencyLabel = Entry('conf/pub:map:currency:label', 'public', 'GET', {'cost': 2.7})
|
13
|
+
public_get_conf_pub_map_currency_unit = publicGetConfPubMapCurrencyUnit = Entry('conf/pub:map:currency:unit', 'public', 'GET', {'cost': 2.7})
|
14
|
+
public_get_conf_pub_map_currency_undl = publicGetConfPubMapCurrencyUndl = Entry('conf/pub:map:currency:undl', 'public', 'GET', {'cost': 2.7})
|
15
|
+
public_get_conf_pub_map_currency_pool = publicGetConfPubMapCurrencyPool = Entry('conf/pub:map:currency:pool', 'public', 'GET', {'cost': 2.7})
|
16
|
+
public_get_conf_pub_map_currency_explorer = publicGetConfPubMapCurrencyExplorer = Entry('conf/pub:map:currency:explorer', 'public', 'GET', {'cost': 2.7})
|
17
|
+
public_get_conf_pub_map_currency_tx_fee = publicGetConfPubMapCurrencyTxFee = Entry('conf/pub:map:currency:tx:fee', 'public', 'GET', {'cost': 2.7})
|
18
|
+
public_get_conf_pub_map_tx_method = publicGetConfPubMapTxMethod = Entry('conf/pub:map:tx:method', 'public', 'GET', {'cost': 2.7})
|
19
|
+
public_get_conf_pub_list_object = publicGetConfPubListObject = Entry('conf/pub:list:{object}', 'public', 'GET', {'cost': 2.7})
|
20
|
+
public_get_conf_pub_list_object_detail = publicGetConfPubListObjectDetail = Entry('conf/pub:list:{object}:{detail}', 'public', 'GET', {'cost': 2.7})
|
21
|
+
public_get_conf_pub_list_currency = publicGetConfPubListCurrency = Entry('conf/pub:list:currency', 'public', 'GET', {'cost': 2.7})
|
22
|
+
public_get_conf_pub_list_pair_exchange = publicGetConfPubListPairExchange = Entry('conf/pub:list:pair:exchange', 'public', 'GET', {'cost': 2.7})
|
23
|
+
public_get_conf_pub_list_pair_margin = publicGetConfPubListPairMargin = Entry('conf/pub:list:pair:margin', 'public', 'GET', {'cost': 2.7})
|
24
|
+
public_get_conf_pub_list_pair_futures = publicGetConfPubListPairFutures = Entry('conf/pub:list:pair:futures', 'public', 'GET', {'cost': 2.7})
|
25
|
+
public_get_conf_pub_list_competitions = publicGetConfPubListCompetitions = Entry('conf/pub:list:competitions', 'public', 'GET', {'cost': 2.7})
|
26
|
+
public_get_conf_pub_info_object = publicGetConfPubInfoObject = Entry('conf/pub:info:{object}', 'public', 'GET', {'cost': 2.7})
|
27
|
+
public_get_conf_pub_info_object_detail = publicGetConfPubInfoObjectDetail = Entry('conf/pub:info:{object}:{detail}', 'public', 'GET', {'cost': 2.7})
|
28
|
+
public_get_conf_pub_info_pair = publicGetConfPubInfoPair = Entry('conf/pub:info:pair', 'public', 'GET', {'cost': 2.7})
|
29
|
+
public_get_conf_pub_info_pair_futures = publicGetConfPubInfoPairFutures = Entry('conf/pub:info:pair:futures', 'public', 'GET', {'cost': 2.7})
|
30
|
+
public_get_conf_pub_info_tx_status = publicGetConfPubInfoTxStatus = Entry('conf/pub:info:tx:status', 'public', 'GET', {'cost': 2.7})
|
31
|
+
public_get_conf_pub_fees = publicGetConfPubFees = Entry('conf/pub:fees', 'public', 'GET', {'cost': 2.7})
|
32
|
+
public_get_platform_status = publicGetPlatformStatus = Entry('platform/status', 'public', 'GET', {'cost': 8})
|
33
|
+
public_get_tickers = publicGetTickers = Entry('tickers', 'public', 'GET', {'cost': 2.7})
|
34
|
+
public_get_ticker_symbol = publicGetTickerSymbol = Entry('ticker/{symbol}', 'public', 'GET', {'cost': 2.7})
|
35
|
+
public_get_tickers_hist = publicGetTickersHist = Entry('tickers/hist', 'public', 'GET', {'cost': 2.7})
|
36
|
+
public_get_trades_symbol_hist = publicGetTradesSymbolHist = Entry('trades/{symbol}/hist', 'public', 'GET', {'cost': 2.7})
|
37
|
+
public_get_book_symbol_precision = publicGetBookSymbolPrecision = Entry('book/{symbol}/{precision}', 'public', 'GET', {'cost': 1})
|
38
|
+
public_get_book_symbol_p0 = publicGetBookSymbolP0 = Entry('book/{symbol}/P0', 'public', 'GET', {'cost': 1})
|
39
|
+
public_get_book_symbol_p1 = publicGetBookSymbolP1 = Entry('book/{symbol}/P1', 'public', 'GET', {'cost': 1})
|
40
|
+
public_get_book_symbol_p2 = publicGetBookSymbolP2 = Entry('book/{symbol}/P2', 'public', 'GET', {'cost': 1})
|
41
|
+
public_get_book_symbol_p3 = publicGetBookSymbolP3 = Entry('book/{symbol}/P3', 'public', 'GET', {'cost': 1})
|
42
|
+
public_get_book_symbol_r0 = publicGetBookSymbolR0 = Entry('book/{symbol}/R0', 'public', 'GET', {'cost': 1})
|
43
|
+
public_get_stats1_key_size_symbol_side_section = publicGetStats1KeySizeSymbolSideSection = Entry('stats1/{key}:{size}:{symbol}:{side}/{section}', 'public', 'GET', {'cost': 2.7})
|
44
|
+
public_get_stats1_key_size_symbol_side_last = publicGetStats1KeySizeSymbolSideLast = Entry('stats1/{key}:{size}:{symbol}:{side}/last', 'public', 'GET', {'cost': 2.7})
|
45
|
+
public_get_stats1_key_size_symbol_side_hist = publicGetStats1KeySizeSymbolSideHist = Entry('stats1/{key}:{size}:{symbol}:{side}/hist', 'public', 'GET', {'cost': 2.7})
|
46
|
+
public_get_stats1_key_size_symbol_section = publicGetStats1KeySizeSymbolSection = Entry('stats1/{key}:{size}:{symbol}/{section}', 'public', 'GET', {'cost': 2.7})
|
47
|
+
public_get_stats1_key_size_symbol_last = publicGetStats1KeySizeSymbolLast = Entry('stats1/{key}:{size}:{symbol}/last', 'public', 'GET', {'cost': 2.7})
|
48
|
+
public_get_stats1_key_size_symbol_hist = publicGetStats1KeySizeSymbolHist = Entry('stats1/{key}:{size}:{symbol}/hist', 'public', 'GET', {'cost': 2.7})
|
49
|
+
public_get_stats1_key_size_symbol_long_last = publicGetStats1KeySizeSymbolLongLast = Entry('stats1/{key}:{size}:{symbol}:long/last', 'public', 'GET', {'cost': 2.7})
|
50
|
+
public_get_stats1_key_size_symbol_long_hist = publicGetStats1KeySizeSymbolLongHist = Entry('stats1/{key}:{size}:{symbol}:long/hist', 'public', 'GET', {'cost': 2.7})
|
51
|
+
public_get_stats1_key_size_symbol_short_last = publicGetStats1KeySizeSymbolShortLast = Entry('stats1/{key}:{size}:{symbol}:short/last', 'public', 'GET', {'cost': 2.7})
|
52
|
+
public_get_stats1_key_size_symbol_short_hist = publicGetStats1KeySizeSymbolShortHist = Entry('stats1/{key}:{size}:{symbol}:short/hist', 'public', 'GET', {'cost': 2.7})
|
53
|
+
public_get_candles_trade_timeframe_symbol_period_section = publicGetCandlesTradeTimeframeSymbolPeriodSection = Entry('candles/trade:{timeframe}:{symbol}:{period}/{section}', 'public', 'GET', {'cost': 2.7})
|
54
|
+
public_get_candles_trade_timeframe_symbol_section = publicGetCandlesTradeTimeframeSymbolSection = Entry('candles/trade:{timeframe}:{symbol}/{section}', 'public', 'GET', {'cost': 2.7})
|
55
|
+
public_get_candles_trade_timeframe_symbol_last = publicGetCandlesTradeTimeframeSymbolLast = Entry('candles/trade:{timeframe}:{symbol}/last', 'public', 'GET', {'cost': 2.7})
|
56
|
+
public_get_candles_trade_timeframe_symbol_hist = publicGetCandlesTradeTimeframeSymbolHist = Entry('candles/trade:{timeframe}:{symbol}/hist', 'public', 'GET', {'cost': 2.7})
|
57
|
+
public_get_status_type = publicGetStatusType = Entry('status/{type}', 'public', 'GET', {'cost': 2.7})
|
58
|
+
public_get_status_deriv = publicGetStatusDeriv = Entry('status/deriv', 'public', 'GET', {'cost': 2.7})
|
59
|
+
public_get_status_deriv_symbol_hist = publicGetStatusDerivSymbolHist = Entry('status/deriv/{symbol}/hist', 'public', 'GET', {'cost': 2.7})
|
60
|
+
public_get_liquidations_hist = publicGetLiquidationsHist = Entry('liquidations/hist', 'public', 'GET', {'cost': 80})
|
61
|
+
public_get_rankings_key_timeframe_symbol_section = publicGetRankingsKeyTimeframeSymbolSection = Entry('rankings/{key}:{timeframe}:{symbol}/{section}', 'public', 'GET', {'cost': 2.7})
|
62
|
+
public_get_rankings_key_timeframe_symbol_hist = publicGetRankingsKeyTimeframeSymbolHist = Entry('rankings/{key}:{timeframe}:{symbol}/hist', 'public', 'GET', {'cost': 2.7})
|
63
|
+
public_get_pulse_hist = publicGetPulseHist = Entry('pulse/hist', 'public', 'GET', {'cost': 2.7})
|
64
|
+
public_get_pulse_profile_nickname = publicGetPulseProfileNickname = Entry('pulse/profile/{nickname}', 'public', 'GET', {'cost': 2.7})
|
65
|
+
public_get_funding_stats_symbol_hist = publicGetFundingStatsSymbolHist = Entry('funding/stats/{symbol}/hist', 'public', 'GET', {'cost': 10})
|
66
|
+
public_get_ext_vasps = publicGetExtVasps = Entry('ext/vasps', 'public', 'GET', {'cost': 1})
|
67
|
+
public_post_calc_trade_avg = publicPostCalcTradeAvg = Entry('calc/trade/avg', 'public', 'POST', {'cost': 2.7})
|
68
|
+
public_post_calc_fx = publicPostCalcFx = Entry('calc/fx', 'public', 'POST', {'cost': 2.7})
|
69
|
+
private_post_auth_r_wallets = privatePostAuthRWallets = Entry('auth/r/wallets', 'private', 'POST', {'cost': 2.7})
|
70
|
+
private_post_auth_r_wallets_hist = privatePostAuthRWalletsHist = Entry('auth/r/wallets/hist', 'private', 'POST', {'cost': 2.7})
|
71
|
+
private_post_auth_r_orders = privatePostAuthROrders = Entry('auth/r/orders', 'private', 'POST', {'cost': 2.7})
|
72
|
+
private_post_auth_r_orders_symbol = privatePostAuthROrdersSymbol = Entry('auth/r/orders/{symbol}', 'private', 'POST', {'cost': 2.7})
|
73
|
+
private_post_auth_w_order_submit = privatePostAuthWOrderSubmit = Entry('auth/w/order/submit', 'private', 'POST', {'cost': 2.7})
|
74
|
+
private_post_auth_w_order_update = privatePostAuthWOrderUpdate = Entry('auth/w/order/update', 'private', 'POST', {'cost': 2.7})
|
75
|
+
private_post_auth_w_order_cancel = privatePostAuthWOrderCancel = Entry('auth/w/order/cancel', 'private', 'POST', {'cost': 2.7})
|
76
|
+
private_post_auth_w_order_multi = privatePostAuthWOrderMulti = Entry('auth/w/order/multi', 'private', 'POST', {'cost': 2.7})
|
77
|
+
private_post_auth_w_order_cancel_multi = privatePostAuthWOrderCancelMulti = Entry('auth/w/order/cancel/multi', 'private', 'POST', {'cost': 2.7})
|
78
|
+
private_post_auth_r_orders_symbol_hist = privatePostAuthROrdersSymbolHist = Entry('auth/r/orders/{symbol}/hist', 'private', 'POST', {'cost': 2.7})
|
79
|
+
private_post_auth_r_orders_hist = privatePostAuthROrdersHist = Entry('auth/r/orders/hist', 'private', 'POST', {'cost': 2.7})
|
80
|
+
private_post_auth_r_order_symbol_id_trades = privatePostAuthROrderSymbolIdTrades = Entry('auth/r/order/{symbol}:{id}/trades', 'private', 'POST', {'cost': 2.7})
|
81
|
+
private_post_auth_r_trades_symbol_hist = privatePostAuthRTradesSymbolHist = Entry('auth/r/trades/{symbol}/hist', 'private', 'POST', {'cost': 2.7})
|
82
|
+
private_post_auth_r_trades_hist = privatePostAuthRTradesHist = Entry('auth/r/trades/hist', 'private', 'POST', {'cost': 2.7})
|
83
|
+
private_post_auth_r_ledgers_currency_hist = privatePostAuthRLedgersCurrencyHist = Entry('auth/r/ledgers/{currency}/hist', 'private', 'POST', {'cost': 2.7})
|
84
|
+
private_post_auth_r_ledgers_hist = privatePostAuthRLedgersHist = Entry('auth/r/ledgers/hist', 'private', 'POST', {'cost': 2.7})
|
85
|
+
private_post_auth_r_info_margin_key = privatePostAuthRInfoMarginKey = Entry('auth/r/info/margin/{key}', 'private', 'POST', {'cost': 2.7})
|
86
|
+
private_post_auth_r_info_margin_base = privatePostAuthRInfoMarginBase = Entry('auth/r/info/margin/base', 'private', 'POST', {'cost': 2.7})
|
87
|
+
private_post_auth_r_info_margin_sym_all = privatePostAuthRInfoMarginSymAll = Entry('auth/r/info/margin/sym_all', 'private', 'POST', {'cost': 2.7})
|
88
|
+
private_post_auth_r_positions = privatePostAuthRPositions = Entry('auth/r/positions', 'private', 'POST', {'cost': 2.7})
|
89
|
+
private_post_auth_w_position_claim = privatePostAuthWPositionClaim = Entry('auth/w/position/claim', 'private', 'POST', {'cost': 2.7})
|
90
|
+
private_post_auth_w_position_increase = privatePostAuthWPositionIncrease = Entry('auth/w/position/increase:', 'private', 'POST', {'cost': 2.7})
|
91
|
+
private_post_auth_r_position_increase_info = privatePostAuthRPositionIncreaseInfo = Entry('auth/r/position/increase/info', 'private', 'POST', {'cost': 2.7})
|
92
|
+
private_post_auth_r_positions_hist = privatePostAuthRPositionsHist = Entry('auth/r/positions/hist', 'private', 'POST', {'cost': 2.7})
|
93
|
+
private_post_auth_r_positions_audit = privatePostAuthRPositionsAudit = Entry('auth/r/positions/audit', 'private', 'POST', {'cost': 2.7})
|
94
|
+
private_post_auth_r_positions_snap = privatePostAuthRPositionsSnap = Entry('auth/r/positions/snap', 'private', 'POST', {'cost': 2.7})
|
95
|
+
private_post_auth_w_deriv_collateral_set = privatePostAuthWDerivCollateralSet = Entry('auth/w/deriv/collateral/set', 'private', 'POST', {'cost': 2.7})
|
96
|
+
private_post_auth_w_deriv_collateral_limits = privatePostAuthWDerivCollateralLimits = Entry('auth/w/deriv/collateral/limits', 'private', 'POST', {'cost': 2.7})
|
97
|
+
private_post_auth_r_funding_offers = privatePostAuthRFundingOffers = Entry('auth/r/funding/offers', 'private', 'POST', {'cost': 2.7})
|
98
|
+
private_post_auth_r_funding_offers_symbol = privatePostAuthRFundingOffersSymbol = Entry('auth/r/funding/offers/{symbol}', 'private', 'POST', {'cost': 2.7})
|
99
|
+
private_post_auth_w_funding_offer_submit = privatePostAuthWFundingOfferSubmit = Entry('auth/w/funding/offer/submit', 'private', 'POST', {'cost': 2.7})
|
100
|
+
private_post_auth_w_funding_offer_cancel = privatePostAuthWFundingOfferCancel = Entry('auth/w/funding/offer/cancel', 'private', 'POST', {'cost': 2.7})
|
101
|
+
private_post_auth_w_funding_offer_cancel_all = privatePostAuthWFundingOfferCancelAll = Entry('auth/w/funding/offer/cancel/all', 'private', 'POST', {'cost': 2.7})
|
102
|
+
private_post_auth_w_funding_close = privatePostAuthWFundingClose = Entry('auth/w/funding/close', 'private', 'POST', {'cost': 2.7})
|
103
|
+
private_post_auth_w_funding_auto = privatePostAuthWFundingAuto = Entry('auth/w/funding/auto', 'private', 'POST', {'cost': 2.7})
|
104
|
+
private_post_auth_w_funding_keep = privatePostAuthWFundingKeep = Entry('auth/w/funding/keep', 'private', 'POST', {'cost': 2.7})
|
105
|
+
private_post_auth_r_funding_offers_symbol_hist = privatePostAuthRFundingOffersSymbolHist = Entry('auth/r/funding/offers/{symbol}/hist', 'private', 'POST', {'cost': 2.7})
|
106
|
+
private_post_auth_r_funding_offers_hist = privatePostAuthRFundingOffersHist = Entry('auth/r/funding/offers/hist', 'private', 'POST', {'cost': 2.7})
|
107
|
+
private_post_auth_r_funding_loans = privatePostAuthRFundingLoans = Entry('auth/r/funding/loans', 'private', 'POST', {'cost': 2.7})
|
108
|
+
private_post_auth_r_funding_loans_hist = privatePostAuthRFundingLoansHist = Entry('auth/r/funding/loans/hist', 'private', 'POST', {'cost': 2.7})
|
109
|
+
private_post_auth_r_funding_loans_symbol = privatePostAuthRFundingLoansSymbol = Entry('auth/r/funding/loans/{symbol}', 'private', 'POST', {'cost': 2.7})
|
110
|
+
private_post_auth_r_funding_loans_symbol_hist = privatePostAuthRFundingLoansSymbolHist = Entry('auth/r/funding/loans/{symbol}/hist', 'private', 'POST', {'cost': 2.7})
|
111
|
+
private_post_auth_r_funding_credits = privatePostAuthRFundingCredits = Entry('auth/r/funding/credits', 'private', 'POST', {'cost': 2.7})
|
112
|
+
private_post_auth_r_funding_credits_hist = privatePostAuthRFundingCreditsHist = Entry('auth/r/funding/credits/hist', 'private', 'POST', {'cost': 2.7})
|
113
|
+
private_post_auth_r_funding_credits_symbol = privatePostAuthRFundingCreditsSymbol = Entry('auth/r/funding/credits/{symbol}', 'private', 'POST', {'cost': 2.7})
|
114
|
+
private_post_auth_r_funding_credits_symbol_hist = privatePostAuthRFundingCreditsSymbolHist = Entry('auth/r/funding/credits/{symbol}/hist', 'private', 'POST', {'cost': 2.7})
|
115
|
+
private_post_auth_r_funding_trades_symbol_hist = privatePostAuthRFundingTradesSymbolHist = Entry('auth/r/funding/trades/{symbol}/hist', 'private', 'POST', {'cost': 2.7})
|
116
|
+
private_post_auth_r_funding_trades_hist = privatePostAuthRFundingTradesHist = Entry('auth/r/funding/trades/hist', 'private', 'POST', {'cost': 2.7})
|
117
|
+
private_post_auth_r_info_funding_key = privatePostAuthRInfoFundingKey = Entry('auth/r/info/funding/{key}', 'private', 'POST', {'cost': 2.7})
|
118
|
+
private_post_auth_r_info_user = privatePostAuthRInfoUser = Entry('auth/r/info/user', 'private', 'POST', {'cost': 2.7})
|
119
|
+
private_post_auth_r_summary = privatePostAuthRSummary = Entry('auth/r/summary', 'private', 'POST', {'cost': 2.7})
|
120
|
+
private_post_auth_r_logins_hist = privatePostAuthRLoginsHist = Entry('auth/r/logins/hist', 'private', 'POST', {'cost': 2.7})
|
121
|
+
private_post_auth_r_permissions = privatePostAuthRPermissions = Entry('auth/r/permissions', 'private', 'POST', {'cost': 2.7})
|
122
|
+
private_post_auth_w_token = privatePostAuthWToken = Entry('auth/w/token', 'private', 'POST', {'cost': 2.7})
|
123
|
+
private_post_auth_r_audit_hist = privatePostAuthRAuditHist = Entry('auth/r/audit/hist', 'private', 'POST', {'cost': 2.7})
|
124
|
+
private_post_auth_w_transfer = privatePostAuthWTransfer = Entry('auth/w/transfer', 'private', 'POST', {'cost': 2.7})
|
125
|
+
private_post_auth_w_deposit_address = privatePostAuthWDepositAddress = Entry('auth/w/deposit/address', 'private', 'POST', {'cost': 24})
|
126
|
+
private_post_auth_w_deposit_invoice = privatePostAuthWDepositInvoice = Entry('auth/w/deposit/invoice', 'private', 'POST', {'cost': 24})
|
127
|
+
private_post_auth_w_withdraw = privatePostAuthWWithdraw = Entry('auth/w/withdraw', 'private', 'POST', {'cost': 24})
|
128
|
+
private_post_auth_r_movements_currency_hist = privatePostAuthRMovementsCurrencyHist = Entry('auth/r/movements/{currency}/hist', 'private', 'POST', {'cost': 2.7})
|
129
|
+
private_post_auth_r_movements_hist = privatePostAuthRMovementsHist = Entry('auth/r/movements/hist', 'private', 'POST', {'cost': 2.7})
|
130
|
+
private_post_auth_r_alerts = privatePostAuthRAlerts = Entry('auth/r/alerts', 'private', 'POST', {'cost': 5.34})
|
131
|
+
private_post_auth_w_alert_set = privatePostAuthWAlertSet = Entry('auth/w/alert/set', 'private', 'POST', {'cost': 2.7})
|
132
|
+
private_post_auth_w_alert_price_symbol_price_del = privatePostAuthWAlertPriceSymbolPriceDel = Entry('auth/w/alert/price:{symbol}:{price}/del', 'private', 'POST', {'cost': 2.7})
|
133
|
+
private_post_auth_w_alert_type_symbol_price_del = privatePostAuthWAlertTypeSymbolPriceDel = Entry('auth/w/alert/{type}:{symbol}:{price}/del', 'private', 'POST', {'cost': 2.7})
|
134
|
+
private_post_auth_calc_order_avail = privatePostAuthCalcOrderAvail = Entry('auth/calc/order/avail', 'private', 'POST', {'cost': 2.7})
|
135
|
+
private_post_auth_w_settings_set = privatePostAuthWSettingsSet = Entry('auth/w/settings/set', 'private', 'POST', {'cost': 2.7})
|
136
|
+
private_post_auth_r_settings = privatePostAuthRSettings = Entry('auth/r/settings', 'private', 'POST', {'cost': 2.7})
|
137
|
+
private_post_auth_w_settings_del = privatePostAuthWSettingsDel = Entry('auth/w/settings/del', 'private', 'POST', {'cost': 2.7})
|
138
|
+
private_post_auth_r_pulse_hist = privatePostAuthRPulseHist = Entry('auth/r/pulse/hist', 'private', 'POST', {'cost': 2.7})
|
139
|
+
private_post_auth_w_pulse_add = privatePostAuthWPulseAdd = Entry('auth/w/pulse/add', 'private', 'POST', {'cost': 16})
|
140
|
+
private_post_auth_w_pulse_del = privatePostAuthWPulseDel = Entry('auth/w/pulse/del', 'private', 'POST', {'cost': 2.7})
|
@@ -0,0 +1,69 @@
|
|
1
|
+
from ccxt.base.types import Entry
|
2
|
+
|
3
|
+
|
4
|
+
class ImplicitAPI:
|
5
|
+
v2_get_platform_status = v2GetPlatformStatus = Entry('platform/status', 'v2', 'GET', {'cost': 3})
|
6
|
+
v2_get_tickers = v2GetTickers = Entry('tickers', 'v2', 'GET', {'cost': 1})
|
7
|
+
v2_get_ticker_symbol = v2GetTickerSymbol = Entry('ticker/{symbol}', 'v2', 'GET', {'cost': 1})
|
8
|
+
v2_get_tickers_hist = v2GetTickersHist = Entry('tickers/hist', 'v2', 'GET', {'cost': 1})
|
9
|
+
v2_get_trades_symbol_hist = v2GetTradesSymbolHist = Entry('trades/{symbol}/hist', 'v2', 'GET', {'cost': 1})
|
10
|
+
v2_get_book_symbol_precision = v2GetBookSymbolPrecision = Entry('book/{symbol}/{precision}', 'v2', 'GET', {'cost': 0.375})
|
11
|
+
v2_get_book_symbol_p0 = v2GetBookSymbolP0 = Entry('book/{symbol}/P0', 'v2', 'GET', {'cost': 0.375})
|
12
|
+
v2_get_book_symbol_p1 = v2GetBookSymbolP1 = Entry('book/{symbol}/P1', 'v2', 'GET', {'cost': 0.375})
|
13
|
+
v2_get_book_symbol_p2 = v2GetBookSymbolP2 = Entry('book/{symbol}/P2', 'v2', 'GET', {'cost': 0.375})
|
14
|
+
v2_get_book_symbol_p3 = v2GetBookSymbolP3 = Entry('book/{symbol}/P3', 'v2', 'GET', {'cost': 0.375})
|
15
|
+
v2_get_book_symbol_r0 = v2GetBookSymbolR0 = Entry('book/{symbol}/R0', 'v2', 'GET', {'cost': 0.375})
|
16
|
+
v2_get_stats1_key_size_symbol_side_section = v2GetStats1KeySizeSymbolSideSection = Entry('stats1/{key}:{size}:{symbol}:{side}/{section}', 'v2', 'GET', {'cost': 1})
|
17
|
+
v2_get_stats1_key_size_symbol_section = v2GetStats1KeySizeSymbolSection = Entry('stats1/{key}:{size}:{symbol}/{section}', 'v2', 'GET', {'cost': 1})
|
18
|
+
v2_get_stats1_key_size_symbol_long_last = v2GetStats1KeySizeSymbolLongLast = Entry('stats1/{key}:{size}:{symbol}:long/last', 'v2', 'GET', {'cost': 1})
|
19
|
+
v2_get_stats1_key_size_symbol_long_hist = v2GetStats1KeySizeSymbolLongHist = Entry('stats1/{key}:{size}:{symbol}:long/hist', 'v2', 'GET', {'cost': 1})
|
20
|
+
v2_get_stats1_key_size_symbol_short_last = v2GetStats1KeySizeSymbolShortLast = Entry('stats1/{key}:{size}:{symbol}:short/last', 'v2', 'GET', {'cost': 1})
|
21
|
+
v2_get_stats1_key_size_symbol_short_hist = v2GetStats1KeySizeSymbolShortHist = Entry('stats1/{key}:{size}:{symbol}:short/hist', 'v2', 'GET', {'cost': 1})
|
22
|
+
v2_get_candles_trade_timeframe_symbol_section = v2GetCandlesTradeTimeframeSymbolSection = Entry('candles/trade:{timeframe}:{symbol}/{section}', 'v2', 'GET', {'cost': 1})
|
23
|
+
v2_get_candles_trade_timeframe_symbol_last = v2GetCandlesTradeTimeframeSymbolLast = Entry('candles/trade:{timeframe}:{symbol}/last', 'v2', 'GET', {'cost': 1})
|
24
|
+
v2_get_candles_trade_timeframe_symbol_hist = v2GetCandlesTradeTimeframeSymbolHist = Entry('candles/trade:{timeframe}:{symbol}/hist', 'v2', 'GET', {'cost': 1})
|
25
|
+
public_get_book_symbol = publicGetBookSymbol = Entry('book/{symbol}', 'public', 'GET', {'cost': 1})
|
26
|
+
public_get_lendbook_currency = publicGetLendbookCurrency = Entry('lendbook/{currency}', 'public', 'GET', {'cost': 6})
|
27
|
+
public_get_lends_currency = publicGetLendsCurrency = Entry('lends/{currency}', 'public', 'GET', {'cost': 3})
|
28
|
+
public_get_pubticker_symbol = publicGetPubtickerSymbol = Entry('pubticker/{symbol}', 'public', 'GET', {'cost': 3})
|
29
|
+
public_get_stats_symbol = publicGetStatsSymbol = Entry('stats/{symbol}', 'public', 'GET', {'cost': 6})
|
30
|
+
public_get_symbols = publicGetSymbols = Entry('symbols', 'public', 'GET', {'cost': 18})
|
31
|
+
public_get_symbols_details = publicGetSymbolsDetails = Entry('symbols_details', 'public', 'GET', {'cost': 18})
|
32
|
+
public_get_tickers = publicGetTickers = Entry('tickers', 'public', 'GET', {'cost': 1})
|
33
|
+
public_get_trades_symbol = publicGetTradesSymbol = Entry('trades/{symbol}', 'public', 'GET', {'cost': 3})
|
34
|
+
private_post_account_fees = privatePostAccountFees = Entry('account_fees', 'private', 'POST', {'cost': 18})
|
35
|
+
private_post_account_infos = privatePostAccountInfos = Entry('account_infos', 'private', 'POST', {'cost': 6})
|
36
|
+
private_post_balances = privatePostBalances = Entry('balances', 'private', 'POST', {'cost': 9.036})
|
37
|
+
private_post_basket_manage = privatePostBasketManage = Entry('basket_manage', 'private', 'POST', {'cost': 6})
|
38
|
+
private_post_credits = privatePostCredits = Entry('credits', 'private', 'POST', {'cost': 6})
|
39
|
+
private_post_deposit_new = privatePostDepositNew = Entry('deposit/new', 'private', 'POST', {'cost': 18})
|
40
|
+
private_post_funding_close = privatePostFundingClose = Entry('funding/close', 'private', 'POST', {'cost': 6})
|
41
|
+
private_post_history = privatePostHistory = Entry('history', 'private', 'POST', {'cost': 6})
|
42
|
+
private_post_history_movements = privatePostHistoryMovements = Entry('history/movements', 'private', 'POST', {'cost': 6})
|
43
|
+
private_post_key_info = privatePostKeyInfo = Entry('key_info', 'private', 'POST', {'cost': 6})
|
44
|
+
private_post_margin_infos = privatePostMarginInfos = Entry('margin_infos', 'private', 'POST', {'cost': 3})
|
45
|
+
private_post_mytrades = privatePostMytrades = Entry('mytrades', 'private', 'POST', {'cost': 3})
|
46
|
+
private_post_mytrades_funding = privatePostMytradesFunding = Entry('mytrades_funding', 'private', 'POST', {'cost': 6})
|
47
|
+
private_post_offer_cancel = privatePostOfferCancel = Entry('offer/cancel', 'private', 'POST', {'cost': 6})
|
48
|
+
private_post_offer_new = privatePostOfferNew = Entry('offer/new', 'private', 'POST', {'cost': 6})
|
49
|
+
private_post_offer_status = privatePostOfferStatus = Entry('offer/status', 'private', 'POST', {'cost': 6})
|
50
|
+
private_post_offers = privatePostOffers = Entry('offers', 'private', 'POST', {'cost': 6})
|
51
|
+
private_post_offers_hist = privatePostOffersHist = Entry('offers/hist', 'private', 'POST', {'cost': 90.03})
|
52
|
+
private_post_order_cancel = privatePostOrderCancel = Entry('order/cancel', 'private', 'POST', {'cost': 0.2})
|
53
|
+
private_post_order_cancel_all = privatePostOrderCancelAll = Entry('order/cancel/all', 'private', 'POST', {'cost': 0.2})
|
54
|
+
private_post_order_cancel_multi = privatePostOrderCancelMulti = Entry('order/cancel/multi', 'private', 'POST', {'cost': 0.2})
|
55
|
+
private_post_order_cancel_replace = privatePostOrderCancelReplace = Entry('order/cancel/replace', 'private', 'POST', {'cost': 0.2})
|
56
|
+
private_post_order_new = privatePostOrderNew = Entry('order/new', 'private', 'POST', {'cost': 0.2})
|
57
|
+
private_post_order_new_multi = privatePostOrderNewMulti = Entry('order/new/multi', 'private', 'POST', {'cost': 0.2})
|
58
|
+
private_post_order_status = privatePostOrderStatus = Entry('order/status', 'private', 'POST', {'cost': 0.2})
|
59
|
+
private_post_orders = privatePostOrders = Entry('orders', 'private', 'POST', {'cost': 0.2})
|
60
|
+
private_post_orders_hist = privatePostOrdersHist = Entry('orders/hist', 'private', 'POST', {'cost': 90.03})
|
61
|
+
private_post_position_claim = privatePostPositionClaim = Entry('position/claim', 'private', 'POST', {'cost': 18})
|
62
|
+
private_post_position_close = privatePostPositionClose = Entry('position/close', 'private', 'POST', {'cost': 18})
|
63
|
+
private_post_positions = privatePostPositions = Entry('positions', 'private', 'POST', {'cost': 18})
|
64
|
+
private_post_summary = privatePostSummary = Entry('summary', 'private', 'POST', {'cost': 18})
|
65
|
+
private_post_taken_funds = privatePostTakenFunds = Entry('taken_funds', 'private', 'POST', {'cost': 6})
|
66
|
+
private_post_total_taken_funds = privatePostTotalTakenFunds = Entry('total_taken_funds', 'private', 'POST', {'cost': 6})
|
67
|
+
private_post_transfer = privatePostTransfer = Entry('transfer', 'private', 'POST', {'cost': 18})
|
68
|
+
private_post_unused_taken_funds = privatePostUnusedTakenFunds = Entry('unused_taken_funds', 'private', 'POST', {'cost': 6})
|
69
|
+
private_post_withdraw = privatePostWithdraw = Entry('withdraw', 'private', 'POST', {'cost': 18})
|
ccxt/async_support/__init__.py
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
# -----------------------------------------------------------------------------
|
6
6
|
|
7
|
-
__version__ = '4.4.
|
7
|
+
__version__ = '4.4.38'
|
8
8
|
|
9
9
|
# -----------------------------------------------------------------------------
|
10
10
|
|
@@ -78,7 +78,7 @@ from ccxt.async_support.bitbank import bitbank
|
|
78
78
|
from ccxt.async_support.bitbns import bitbns # noqa: F401
|
79
79
|
from ccxt.async_support.bitcoincom import bitcoincom # noqa: F401
|
80
80
|
from ccxt.async_support.bitfinex import bitfinex # noqa: F401
|
81
|
-
from ccxt.async_support.
|
81
|
+
from ccxt.async_support.bitfinex1 import bitfinex1 # noqa: F401
|
82
82
|
from ccxt.async_support.bitflyer import bitflyer # noqa: F401
|
83
83
|
from ccxt.async_support.bitget import bitget # noqa: F401
|
84
84
|
from ccxt.async_support.bithumb import bithumb # noqa: F401
|
@@ -191,7 +191,7 @@ exchanges = [
|
|
191
191
|
'bitbns',
|
192
192
|
'bitcoincom',
|
193
193
|
'bitfinex',
|
194
|
-
'
|
194
|
+
'bitfinex1',
|
195
195
|
'bitflyer',
|
196
196
|
'bitget',
|
197
197
|
'bithumb',
|
ccxt/async_support/binance.py
CHANGED
@@ -1592,7 +1592,6 @@ class binance(Exchange, ImplicitAPI):
|
|
1592
1592
|
'takeProfitPrice': True,
|
1593
1593
|
'attachedStopLossTakeProfit': None, # not supported
|
1594
1594
|
'timeInForce': {
|
1595
|
-
'GTC': True,
|
1596
1595
|
'IOC': True,
|
1597
1596
|
'FOK': True,
|
1598
1597
|
'PO': True,
|
@@ -1659,7 +1658,6 @@ class binance(Exchange, ImplicitAPI):
|
|
1659
1658
|
'takeProfitPrice': True,
|
1660
1659
|
'attachedStopLossTakeProfit': None, # not supported
|
1661
1660
|
'timeInForce': {
|
1662
|
-
'GTC': True,
|
1663
1661
|
'IOC': True,
|
1664
1662
|
'FOK': True,
|
1665
1663
|
'PO': True,
|
ccxt/async_support/bingx.py
CHANGED
@@ -96,7 +96,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
96
96
|
'fetchPositionHistory': False,
|
97
97
|
'fetchPositionMode': True,
|
98
98
|
'fetchPositions': True,
|
99
|
-
'fetchPositionsHistory':
|
99
|
+
'fetchPositionsHistory': True,
|
100
100
|
'fetchTicker': True,
|
101
101
|
'fetchTickers': True,
|
102
102
|
'fetchTime': True,
|
@@ -220,7 +220,6 @@ class bingx(Exchange, ImplicitAPI):
|
|
220
220
|
'private': {
|
221
221
|
'get': {
|
222
222
|
'positionSide/dual': 5,
|
223
|
-
'market/markPriceKlines': 1,
|
224
223
|
'trade/batchCancelReplace': 5,
|
225
224
|
'trade/fullOrder': 2,
|
226
225
|
'maintMarginRatio': 2,
|
@@ -554,7 +553,6 @@ class bingx(Exchange, ImplicitAPI):
|
|
554
553
|
'limitPrice': True,
|
555
554
|
},
|
556
555
|
'timeInForce': {
|
557
|
-
'GTC': True,
|
558
556
|
'IOC': True,
|
559
557
|
'FOK': True,
|
560
558
|
'PO': True,
|
@@ -1016,7 +1014,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
1016
1014
|
https://bingx-api.github.io/docs/#/swapV2/market-api.html#K-Line%20Data
|
1017
1015
|
https://bingx-api.github.io/docs/#/spot/market-api.html#Candlestick%20chart%20data
|
1018
1016
|
https://bingx-api.github.io/docs/#/swapV2/market-api.html#%20K-Line%20Data
|
1019
|
-
https://bingx-api.github.io/docs/#/en-us/swapV2/market-api.html#
|
1017
|
+
https://bingx-api.github.io/docs/#/en-us/swapV2/market-api.html#Mark%20Price%20Kline/Candlestick%20Data
|
1020
1018
|
https://bingx-api.github.io/docs/#/en-us/cswap/market-api.html#Get%20K-line%20Data
|
1021
1019
|
|
1022
1020
|
:param str symbol: unified symbol of the market to fetch OHLCV data for
|
@@ -1056,7 +1054,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
1056
1054
|
price = self.safe_string(params, 'price')
|
1057
1055
|
params = self.omit(params, 'price')
|
1058
1056
|
if price == 'mark':
|
1059
|
-
response = await self.
|
1057
|
+
response = await self.swapV1PublicGetMarketMarkPriceKlines(self.extend(request, params))
|
1060
1058
|
else:
|
1061
1059
|
response = await self.swapV3PublicGetQuoteKlines(self.extend(request, params))
|
1062
1060
|
#
|
@@ -2265,6 +2263,67 @@ class bingx(Exchange, ImplicitAPI):
|
|
2265
2263
|
result[code] = account
|
2266
2264
|
return self.safe_balance(result)
|
2267
2265
|
|
2266
|
+
async def fetch_position_history(self, symbol: str, since: Int = None, limit: Int = None, params={}) -> List[Position]:
|
2267
|
+
"""
|
2268
|
+
fetches historical positions
|
2269
|
+
|
2270
|
+
https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Query%20Position%20History
|
2271
|
+
|
2272
|
+
:param str symbol: unified contract symbol
|
2273
|
+
:param int [since]: the earliest time in ms to fetch positions for
|
2274
|
+
:param int [limit]: the maximum amount of records to fetch
|
2275
|
+
:param dict [params]: extra parameters specific to the exchange api endpoint
|
2276
|
+
:param int [params.until]: the latest time in ms to fetch positions for
|
2277
|
+
:returns dict[]: a list of `position structures <https://docs.ccxt.com/#/?id=position-structure>`
|
2278
|
+
"""
|
2279
|
+
await self.load_markets()
|
2280
|
+
market = self.market(symbol)
|
2281
|
+
request: dict = {
|
2282
|
+
'symbol': market['id'],
|
2283
|
+
}
|
2284
|
+
if limit is not None:
|
2285
|
+
request['pageSize'] = limit
|
2286
|
+
if since is not None:
|
2287
|
+
request['startTs'] = since
|
2288
|
+
request, params = self.handle_until_option('endTs', request, params)
|
2289
|
+
response = None
|
2290
|
+
if market['linear']:
|
2291
|
+
response = await self.swapV1PrivateGetTradePositionHistory(self.extend(request, params))
|
2292
|
+
else:
|
2293
|
+
raise NotSupported(self.id + ' fetchPositionHistory() is not supported for inverse swap positions')
|
2294
|
+
#
|
2295
|
+
# {
|
2296
|
+
# "code": 0,
|
2297
|
+
# "msg": "",
|
2298
|
+
# "data": {
|
2299
|
+
# "positionHistory": [
|
2300
|
+
# {
|
2301
|
+
# "positionId": "1861675561156571136",
|
2302
|
+
# "symbol": "LTC-USDT",
|
2303
|
+
# "isolated": False,
|
2304
|
+
# "positionSide": "LONG",
|
2305
|
+
# "openTime": 1732693017000,
|
2306
|
+
# "updateTime": 1733310292000,
|
2307
|
+
# "avgPrice": "95.18",
|
2308
|
+
# "avgClosePrice": "129.48",
|
2309
|
+
# "realisedProfit": "102.89",
|
2310
|
+
# "netProfit": "99.63",
|
2311
|
+
# "positionAmt": "30.0",
|
2312
|
+
# "closePositionAmt": "30.0",
|
2313
|
+
# "leverage": 6,
|
2314
|
+
# "closeAllPositions": True,
|
2315
|
+
# "positionCommission": "-0.33699650000000003",
|
2316
|
+
# "totalFunding": "-2.921461693902908"
|
2317
|
+
# },
|
2318
|
+
# ]
|
2319
|
+
# }
|
2320
|
+
# }
|
2321
|
+
#
|
2322
|
+
data = self.safe_dict(response, 'data', {})
|
2323
|
+
records = self.safe_list(data, 'positionHistory', [])
|
2324
|
+
positions = self.parse_positions(records)
|
2325
|
+
return self.filter_by_symbol_since_limit(positions, symbol, since, limit)
|
2326
|
+
|
2268
2327
|
async def fetch_positions(self, symbols: Strings = None, params={}):
|
2269
2328
|
"""
|
2270
2329
|
fetch all open positions
|
@@ -2504,12 +2563,34 @@ class bingx(Exchange, ImplicitAPI):
|
|
2504
2563
|
# "positionAmt": "1.20365912",
|
2505
2564
|
# }
|
2506
2565
|
#
|
2566
|
+
# linear swap fetchPositionHistory
|
2567
|
+
#
|
2568
|
+
# {
|
2569
|
+
# "positionId": "1861675561156571136",
|
2570
|
+
# "symbol": "LTC-USDT",
|
2571
|
+
# "isolated": False,
|
2572
|
+
# "positionSide": "LONG",
|
2573
|
+
# "openTime": 1732693017000,
|
2574
|
+
# "updateTime": 1733310292000,
|
2575
|
+
# "avgPrice": "95.18",
|
2576
|
+
# "avgClosePrice": "129.48",
|
2577
|
+
# "realisedProfit": "102.89",
|
2578
|
+
# "netProfit": "99.63",
|
2579
|
+
# "positionAmt": "30.0",
|
2580
|
+
# "closePositionAmt": "30.0",
|
2581
|
+
# "leverage": 6,
|
2582
|
+
# "closeAllPositions": True,
|
2583
|
+
# "positionCommission": "-0.33699650000000003",
|
2584
|
+
# "totalFunding": "-2.921461693902908"
|
2585
|
+
# }
|
2586
|
+
#
|
2507
2587
|
marketId = self.safe_string(position, 'symbol', '')
|
2508
2588
|
marketId = marketId.replace('/', '-') # standard return different format
|
2509
2589
|
isolated = self.safe_bool(position, 'isolated')
|
2510
2590
|
marginMode = None
|
2511
2591
|
if isolated is not None:
|
2512
2592
|
marginMode = 'isolated' if isolated else 'cross'
|
2593
|
+
timestamp = self.safe_integer(position, 'openTime')
|
2513
2594
|
return self.safe_position({
|
2514
2595
|
'info': position,
|
2515
2596
|
'id': self.safe_string(position, 'positionId'),
|
@@ -2527,8 +2608,8 @@ class bingx(Exchange, ImplicitAPI):
|
|
2527
2608
|
'lastPrice': None,
|
2528
2609
|
'side': self.safe_string_lower(position, 'positionSide'),
|
2529
2610
|
'hedged': None,
|
2530
|
-
'timestamp':
|
2531
|
-
'datetime':
|
2611
|
+
'timestamp': timestamp,
|
2612
|
+
'datetime': self.iso8601(timestamp),
|
2532
2613
|
'lastUpdateTimestamp': self.safe_integer(position, 'updateTime'),
|
2533
2614
|
'maintenanceMargin': None,
|
2534
2615
|
'maintenanceMarginPercentage': None,
|
@@ -6089,7 +6170,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
6089
6170
|
body = self.json(parsedParams)
|
6090
6171
|
else:
|
6091
6172
|
query = self.urlencode(parsedParams)
|
6092
|
-
url += '?' + query + '&signature=' + signature
|
6173
|
+
url += '?' + query + '&' + 'signature=' + signature
|
6093
6174
|
return {'url': url, 'method': method, 'body': body, 'headers': headers}
|
6094
6175
|
|
6095
6176
|
def nonce(self):
|