ccxt 4.4.3__py2.py3-none-any.whl → 4.4.5__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.
Files changed (90) hide show
  1. ccxt/__init__.py +1 -1
  2. ccxt/abstract/binanceus.py +36 -36
  3. ccxt/async_support/__init__.py +1 -1
  4. ccxt/async_support/base/exchange.py +24 -13
  5. ccxt/async_support/base/ws/cache.py +1 -0
  6. ccxt/async_support/binance.py +43 -18
  7. ccxt/async_support/binanceus.py +1 -0
  8. ccxt/async_support/bingx.py +1 -0
  9. ccxt/async_support/bitfinex2.py +10 -9
  10. ccxt/async_support/bitget.py +55 -99
  11. ccxt/async_support/bitmex.py +14 -13
  12. ccxt/async_support/bitso.py +8 -7
  13. ccxt/async_support/bitstamp.py +12 -12
  14. ccxt/async_support/blofin.py +24 -26
  15. ccxt/async_support/bybit.py +101 -29
  16. ccxt/async_support/coinbase.py +31 -10
  17. ccxt/async_support/coinbaseexchange.py +14 -14
  18. ccxt/async_support/coinlist.py +9 -8
  19. ccxt/async_support/coinmetro.py +6 -6
  20. ccxt/async_support/cryptocom.py +10 -8
  21. ccxt/async_support/currencycom.py +9 -9
  22. ccxt/async_support/delta.py +8 -8
  23. ccxt/async_support/digifinex.py +11 -9
  24. ccxt/async_support/gate.py +9 -8
  25. ccxt/async_support/hashkey.py +12 -10
  26. ccxt/async_support/htx.py +16 -19
  27. ccxt/async_support/hyperliquid.py +70 -117
  28. ccxt/async_support/kraken.py +12 -10
  29. ccxt/async_support/kucoin.py +12 -11
  30. ccxt/async_support/luno.py +13 -12
  31. ccxt/async_support/lykke.py +2 -2
  32. ccxt/async_support/mexc.py +41 -3
  33. ccxt/async_support/ndax.py +9 -8
  34. ccxt/async_support/okcoin.py +21 -30
  35. ccxt/async_support/okx.py +21 -29
  36. ccxt/async_support/paradex.py +1 -1
  37. ccxt/async_support/woo.py +10 -9
  38. ccxt/async_support/woofipro.py +11 -9
  39. ccxt/async_support/xt.py +7 -6
  40. ccxt/async_support/zonda.py +9 -8
  41. ccxt/base/exchange.py +3 -1
  42. ccxt/binance.py +43 -18
  43. ccxt/binanceus.py +1 -0
  44. ccxt/bingx.py +1 -0
  45. ccxt/bitfinex2.py +10 -9
  46. ccxt/bitget.py +55 -99
  47. ccxt/bitmex.py +14 -13
  48. ccxt/bitso.py +8 -7
  49. ccxt/bitstamp.py +12 -12
  50. ccxt/blofin.py +24 -26
  51. ccxt/bybit.py +101 -29
  52. ccxt/coinbase.py +31 -10
  53. ccxt/coinbaseexchange.py +14 -14
  54. ccxt/coinlist.py +9 -8
  55. ccxt/coinmetro.py +6 -6
  56. ccxt/cryptocom.py +10 -8
  57. ccxt/currencycom.py +9 -9
  58. ccxt/delta.py +8 -8
  59. ccxt/digifinex.py +11 -9
  60. ccxt/gate.py +9 -8
  61. ccxt/hashkey.py +12 -10
  62. ccxt/htx.py +16 -19
  63. ccxt/hyperliquid.py +70 -117
  64. ccxt/kraken.py +12 -10
  65. ccxt/kucoin.py +12 -11
  66. ccxt/luno.py +13 -12
  67. ccxt/lykke.py +2 -2
  68. ccxt/mexc.py +40 -3
  69. ccxt/ndax.py +9 -8
  70. ccxt/okcoin.py +21 -30
  71. ccxt/okx.py +21 -29
  72. ccxt/paradex.py +1 -1
  73. ccxt/pro/__init__.py +1 -1
  74. ccxt/pro/binance.py +6 -2
  75. ccxt/pro/binanceus.py +2 -1
  76. ccxt/pro/bybit.py +51 -0
  77. ccxt/pro/hyperliquid.py +14 -1
  78. ccxt/pro/mexc.py +78 -0
  79. ccxt/pro/paradex.py +1 -0
  80. ccxt/test/tests_async.py +1 -1
  81. ccxt/test/tests_sync.py +1 -1
  82. ccxt/woo.py +10 -9
  83. ccxt/woofipro.py +11 -9
  84. ccxt/xt.py +7 -6
  85. ccxt/zonda.py +9 -8
  86. {ccxt-4.4.3.dist-info → ccxt-4.4.5.dist-info}/METADATA +5 -5
  87. {ccxt-4.4.3.dist-info → ccxt-4.4.5.dist-info}/RECORD +90 -90
  88. {ccxt-4.4.3.dist-info → ccxt-4.4.5.dist-info}/LICENSE.txt +0 -0
  89. {ccxt-4.4.3.dist-info → ccxt-4.4.5.dist-info}/WHEEL +0 -0
  90. {ccxt-4.4.3.dist-info → ccxt-4.4.5.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.3'
25
+ __version__ = '4.4.5'
26
26
 
27
27
  # ----------------------------------------------------------------------------
28
28
 
@@ -4,7 +4,7 @@ from ccxt.base.types import Entry
4
4
  class ImplicitAPI:
5
5
  sapi_get_copytrading_futures_userstatus = sapiGetCopyTradingFuturesUserStatus = Entry('copyTrading/futures/userStatus', 'sapi', 'GET', {'cost': 2})
6
6
  sapi_get_copytrading_futures_leadsymbol = sapiGetCopyTradingFuturesLeadSymbol = Entry('copyTrading/futures/leadSymbol', 'sapi', 'GET', {'cost': 2})
7
- sapi_get_system_status = sapiGetSystemStatus = Entry('system/status', 'sapi', 'GET', {'cost': 0.1})
7
+ sapi_get_system_status = sapiGetSystemStatus = Entry('system/status', 'sapi', 'GET', {'cost': 1})
8
8
  sapi_get_accountsnapshot = sapiGetAccountSnapshot = Entry('accountSnapshot', 'sapi', 'GET', {'cost': 240})
9
9
  sapi_get_account_info = sapiGetAccountInfo = Entry('account/info', 'sapi', 'GET', {'cost': 0.1})
10
10
  sapi_get_margin_asset = sapiGetMarginAsset = Entry('margin/asset', 'sapi', 'GET', {'cost': 1})
@@ -86,10 +86,10 @@ class ImplicitAPI:
86
86
  sapi_get_capital_config_getall = sapiGetCapitalConfigGetall = Entry('capital/config/getall', 'sapi', 'GET', {'cost': 1})
87
87
  sapi_get_capital_deposit_address = sapiGetCapitalDepositAddress = Entry('capital/deposit/address', 'sapi', 'GET', {'cost': 1})
88
88
  sapi_get_capital_deposit_address_list = sapiGetCapitalDepositAddressList = Entry('capital/deposit/address/list', 'sapi', 'GET', {'cost': 1})
89
- sapi_get_capital_deposit_hisrec = sapiGetCapitalDepositHisrec = Entry('capital/deposit/hisrec', 'sapi', 'GET', {'cost': 0.1})
89
+ sapi_get_capital_deposit_hisrec = sapiGetCapitalDepositHisrec = Entry('capital/deposit/hisrec', 'sapi', 'GET', {'cost': 1})
90
90
  sapi_get_capital_deposit_subaddress = sapiGetCapitalDepositSubAddress = Entry('capital/deposit/subAddress', 'sapi', 'GET', {'cost': 0.1})
91
91
  sapi_get_capital_deposit_subhisrec = sapiGetCapitalDepositSubHisrec = Entry('capital/deposit/subHisrec', 'sapi', 'GET', {'cost': 0.1})
92
- sapi_get_capital_withdraw_history = sapiGetCapitalWithdrawHistory = Entry('capital/withdraw/history', 'sapi', 'GET', {'cost': 2})
92
+ sapi_get_capital_withdraw_history = sapiGetCapitalWithdrawHistory = Entry('capital/withdraw/history', 'sapi', 'GET', {'cost': 1})
93
93
  sapi_get_capital_withdraw_address_list = sapiGetCapitalWithdrawAddressList = Entry('capital/withdraw/address/list', 'sapi', 'GET', {'cost': 10})
94
94
  sapi_get_capital_contract_convertible_coins = sapiGetCapitalContractConvertibleCoins = Entry('capital/contract/convertible-coins', 'sapi', 'GET', {'cost': 4.0002})
95
95
  sapi_get_convert_tradeflow = sapiGetConvertTradeFlow = Entry('convert/tradeFlow', 'sapi', 'GET', {'cost': 20.001})
@@ -108,7 +108,7 @@ class ImplicitAPI:
108
108
  sapi_get_sub_account_list = sapiGetSubAccountList = Entry('sub-account/list', 'sapi', 'GET', {'cost': 0.1})
109
109
  sapi_get_sub_account_margin_account = sapiGetSubAccountMarginAccount = Entry('sub-account/margin/account', 'sapi', 'GET', {'cost': 1})
110
110
  sapi_get_sub_account_margin_accountsummary = sapiGetSubAccountMarginAccountSummary = Entry('sub-account/margin/accountSummary', 'sapi', 'GET', {'cost': 1})
111
- sapi_get_sub_account_spotsummary = sapiGetSubAccountSpotSummary = Entry('sub-account/spotSummary', 'sapi', 'GET', {'cost': 0.1})
111
+ sapi_get_sub_account_spotsummary = sapiGetSubAccountSpotSummary = Entry('sub-account/spotSummary', 'sapi', 'GET', {'cost': 1})
112
112
  sapi_get_sub_account_status = sapiGetSubAccountStatus = Entry('sub-account/status', 'sapi', 'GET', {'cost': 1})
113
113
  sapi_get_sub_account_sub_transfer_history = sapiGetSubAccountSubTransferHistory = Entry('sub-account/sub/transfer/history', 'sapi', 'GET', {'cost': 0.1})
114
114
  sapi_get_sub_account_transfer_subuserhistory = sapiGetSubAccountTransferSubUserHistory = Entry('sub-account/transfer/subUserHistory', 'sapi', 'GET', {'cost': 0.1})
@@ -280,14 +280,14 @@ class ImplicitAPI:
280
280
  sapi_get_cl_transferhistory = sapiGetClTransferHistory = Entry('cl/transferHistory', 'sapi', 'GET', {'cost': 1})
281
281
  sapi_get_apipartner_checkeligibility = sapiGetApipartnerCheckEligibility = Entry('apipartner/checkEligibility', 'sapi', 'GET', {'cost': 1})
282
282
  sapi_get_apipartner_rebatehistory = sapiGetApipartnerRebateHistory = Entry('apipartner/rebateHistory', 'sapi', 'GET', {'cost': 1})
283
- sapi_post_asset_dust = sapiPostAssetDust = Entry('asset/dust', 'sapi', 'POST', {'cost': 0.06667})
283
+ sapi_post_asset_dust = sapiPostAssetDust = Entry('asset/dust', 'sapi', 'POST', {'cost': 10})
284
284
  sapi_post_asset_dust_btc = sapiPostAssetDustBtc = Entry('asset/dust-btc', 'sapi', 'POST', {'cost': 0.1})
285
285
  sapi_post_asset_transfer = sapiPostAssetTransfer = Entry('asset/transfer', 'sapi', 'POST', {'cost': 6.0003})
286
286
  sapi_post_asset_get_funding_asset = sapiPostAssetGetFundingAsset = Entry('asset/get-funding-asset', 'sapi', 'POST', {'cost': 0.1})
287
287
  sapi_post_asset_convert_transfer = sapiPostAssetConvertTransfer = Entry('asset/convert-transfer', 'sapi', 'POST', {'cost': 0.033335})
288
288
  sapi_post_account_disablefastwithdrawswitch = sapiPostAccountDisableFastWithdrawSwitch = Entry('account/disableFastWithdrawSwitch', 'sapi', 'POST', {'cost': 0.1})
289
289
  sapi_post_account_enablefastwithdrawswitch = sapiPostAccountEnableFastWithdrawSwitch = Entry('account/enableFastWithdrawSwitch', 'sapi', 'POST', {'cost': 0.1})
290
- sapi_post_capital_withdraw_apply = sapiPostCapitalWithdrawApply = Entry('capital/withdraw/apply', 'sapi', 'POST', {'cost': 4.0002})
290
+ sapi_post_capital_withdraw_apply = sapiPostCapitalWithdrawApply = Entry('capital/withdraw/apply', 'sapi', 'POST', {'cost': 1})
291
291
  sapi_post_capital_contract_convertible_coins = sapiPostCapitalContractConvertibleCoins = Entry('capital/contract/convertible-coins', 'sapi', 'POST', {'cost': 4.0002})
292
292
  sapi_post_capital_deposit_credit_apply = sapiPostCapitalDepositCreditApply = Entry('capital/deposit/credit-apply', 'sapi', 'POST', {'cost': 0.1})
293
293
  sapi_post_margin_borrow_repay = sapiPostMarginBorrowRepay = Entry('margin/borrow-repay', 'sapi', 'POST', {'cost': 20.001})
@@ -439,7 +439,7 @@ class ImplicitAPI:
439
439
  sapiv2_post_loan_flexible_borrow = sapiV2PostLoanFlexibleBorrow = Entry('loan/flexible/borrow', 'sapiV2', 'POST', {'cost': 40.002})
440
440
  sapiv2_post_loan_flexible_repay = sapiV2PostLoanFlexibleRepay = Entry('loan/flexible/repay', 'sapiV2', 'POST', {'cost': 40.002})
441
441
  sapiv2_post_loan_flexible_adjust_ltv = sapiV2PostLoanFlexibleAdjustLtv = Entry('loan/flexible/adjust/ltv', 'sapiV2', 'POST', {'cost': 40.002})
442
- sapiv3_get_sub_account_assets = sapiV3GetSubAccountAssets = Entry('sub-account/assets', 'sapiV3', 'GET', {'cost': 0.40002})
442
+ sapiv3_get_sub_account_assets = sapiV3GetSubAccountAssets = Entry('sub-account/assets', 'sapiV3', 'GET', {'cost': 1})
443
443
  sapiv3_get_accountstatus = sapiV3GetAccountStatus = Entry('accountStatus', 'sapiV3', 'GET', {'cost': 1})
444
444
  sapiv3_get_apitradingstatus = sapiV3GetApiTradingStatus = Entry('apiTradingStatus', 'sapiV3', 'GET', {'cost': 1})
445
445
  sapiv3_get_sub_account_list = sapiV3GetSubAccountList = Entry('sub-account/list', 'sapiV3', 'GET', {'cost': 1})
@@ -641,48 +641,48 @@ class ImplicitAPI:
641
641
  eapiprivate_delete_allopenorders = eapiPrivateDeleteAllOpenOrders = Entry('allOpenOrders', 'eapiPrivate', 'DELETE', {'cost': 1})
642
642
  eapiprivate_delete_allopenordersbyunderlying = eapiPrivateDeleteAllOpenOrdersByUnderlying = Entry('allOpenOrdersByUnderlying', 'eapiPrivate', 'DELETE', {'cost': 1})
643
643
  eapiprivate_delete_listenkey = eapiPrivateDeleteListenKey = Entry('listenKey', 'eapiPrivate', 'DELETE', {'cost': 1})
644
- public_get_ping = publicGetPing = Entry('ping', 'public', 'GET', {'cost': 0.2})
645
- public_get_time = publicGetTime = Entry('time', 'public', 'GET', {'cost': 0.2})
644
+ public_get_ping = publicGetPing = Entry('ping', 'public', 'GET', {'cost': 1})
645
+ public_get_time = publicGetTime = Entry('time', 'public', 'GET', {'cost': 1})
646
646
  public_get_depth = publicGetDepth = Entry('depth', 'public', 'GET', {'cost': 1, 'byLimit': [[100, 1], [500, 5], [1000, 10], [5000, 50]]})
647
- public_get_trades = publicGetTrades = Entry('trades', 'public', 'GET', {'cost': 2})
648
- public_get_aggtrades = publicGetAggTrades = Entry('aggTrades', 'public', 'GET', {'cost': 0.4})
649
- public_get_historicaltrades = publicGetHistoricalTrades = Entry('historicalTrades', 'public', 'GET', {'cost': 2})
650
- public_get_klines = publicGetKlines = Entry('klines', 'public', 'GET', {'cost': 0.4})
647
+ public_get_trades = publicGetTrades = Entry('trades', 'public', 'GET', {'cost': 1})
648
+ public_get_aggtrades = publicGetAggTrades = Entry('aggTrades', 'public', 'GET', {'cost': 1})
649
+ public_get_historicaltrades = publicGetHistoricalTrades = Entry('historicalTrades', 'public', 'GET', {'cost': 5})
650
+ public_get_klines = publicGetKlines = Entry('klines', 'public', 'GET', {'cost': 1})
651
651
  public_get_uiklines = publicGetUiKlines = Entry('uiKlines', 'public', 'GET', {'cost': 0.4})
652
- public_get_ticker_24hr = publicGetTicker24hr = Entry('ticker/24hr', 'public', 'GET', {'cost': 0.4, 'noSymbol': 16})
653
- public_get_ticker = publicGetTicker = Entry('ticker', 'public', 'GET', {'cost': 0.4, 'noSymbol': 16})
652
+ public_get_ticker_24hr = publicGetTicker24hr = Entry('ticker/24hr', 'public', 'GET', {'cost': 1, 'noSymbol': 40})
653
+ public_get_ticker = publicGetTicker = Entry('ticker', 'public', 'GET', {'cost': 2, 'noSymbol': 100})
654
654
  public_get_ticker_tradingday = publicGetTickerTradingDay = Entry('ticker/tradingDay', 'public', 'GET', {'cost': 0.8})
655
- public_get_ticker_price = publicGetTickerPrice = Entry('ticker/price', 'public', 'GET', {'cost': 0.4, 'noSymbol': 0.8})
656
- public_get_ticker_bookticker = publicGetTickerBookTicker = Entry('ticker/bookTicker', 'public', 'GET', {'cost': 0.4, 'noSymbol': 0.8})
657
- public_get_exchangeinfo = publicGetExchangeInfo = Entry('exchangeInfo', 'public', 'GET', {'cost': 4})
658
- public_get_avgprice = publicGetAvgPrice = Entry('avgPrice', 'public', 'GET', {'cost': 0.4})
655
+ public_get_ticker_price = publicGetTickerPrice = Entry('ticker/price', 'public', 'GET', {'cost': 1, 'noSymbol': 2})
656
+ public_get_ticker_bookticker = publicGetTickerBookTicker = Entry('ticker/bookTicker', 'public', 'GET', {'cost': 1, 'noSymbol': 2})
657
+ public_get_exchangeinfo = publicGetExchangeInfo = Entry('exchangeInfo', 'public', 'GET', {'cost': 10})
658
+ public_get_avgprice = publicGetAvgPrice = Entry('avgPrice', 'public', 'GET', {'cost': 1})
659
659
  public_put_userdatastream = publicPutUserDataStream = Entry('userDataStream', 'public', 'PUT', {'cost': 0.4})
660
660
  public_post_userdatastream = publicPostUserDataStream = Entry('userDataStream', 'public', 'POST', {'cost': 0.4})
661
661
  public_delete_userdatastream = publicDeleteUserDataStream = Entry('userDataStream', 'public', 'DELETE', {'cost': 0.4})
662
- private_get_allorderlist = privateGetAllOrderList = Entry('allOrderList', 'private', 'GET', {'cost': 4})
663
- private_get_openorderlist = privateGetOpenOrderList = Entry('openOrderList', 'private', 'GET', {'cost': 1.2})
664
- private_get_orderlist = privateGetOrderList = Entry('orderList', 'private', 'GET', {'cost': 0.8})
665
- private_get_order = privateGetOrder = Entry('order', 'private', 'GET', {'cost': 0.8})
666
- private_get_openorders = privateGetOpenOrders = Entry('openOrders', 'private', 'GET', {'cost': 1.2, 'noSymbol': 16})
667
- private_get_allorders = privateGetAllOrders = Entry('allOrders', 'private', 'GET', {'cost': 4})
668
- private_get_account = privateGetAccount = Entry('account', 'private', 'GET', {'cost': 4})
669
- private_get_mytrades = privateGetMyTrades = Entry('myTrades', 'private', 'GET', {'cost': 4})
670
- private_get_ratelimit_order = privateGetRateLimitOrder = Entry('rateLimit/order', 'private', 'GET', {'cost': 8})
671
- private_get_mypreventedmatches = privateGetMyPreventedMatches = Entry('myPreventedMatches', 'private', 'GET', {'cost': 4})
662
+ private_get_allorderlist = privateGetAllOrderList = Entry('allOrderList', 'private', 'GET', {'cost': 10})
663
+ private_get_openorderlist = privateGetOpenOrderList = Entry('openOrderList', 'private', 'GET', {'cost': 3})
664
+ private_get_orderlist = privateGetOrderList = Entry('orderList', 'private', 'GET', {'cost': 2})
665
+ private_get_order = privateGetOrder = Entry('order', 'private', 'GET', {'cost': 2})
666
+ private_get_openorders = privateGetOpenOrders = Entry('openOrders', 'private', 'GET', {'cost': 3, 'noSymbol': 40})
667
+ private_get_allorders = privateGetAllOrders = Entry('allOrders', 'private', 'GET', {'cost': 10})
668
+ private_get_account = privateGetAccount = Entry('account', 'private', 'GET', {'cost': 10})
669
+ private_get_mytrades = privateGetMyTrades = Entry('myTrades', 'private', 'GET', {'cost': 10})
670
+ private_get_ratelimit_order = privateGetRateLimitOrder = Entry('rateLimit/order', 'private', 'GET', {'cost': 20})
671
+ private_get_mypreventedmatches = privateGetMyPreventedMatches = Entry('myPreventedMatches', 'private', 'GET', {'cost': 10})
672
672
  private_get_myallocations = privateGetMyAllocations = Entry('myAllocations', 'private', 'GET', {'cost': 4})
673
673
  private_get_account_commission = privateGetAccountCommission = Entry('account/commission', 'private', 'GET', {'cost': 4})
674
- private_post_order_oco = privatePostOrderOco = Entry('order/oco', 'private', 'POST', {'cost': 0.2})
674
+ private_post_order_oco = privatePostOrderOco = Entry('order/oco', 'private', 'POST', {'cost': 1})
675
675
  private_post_orderlist_oco = privatePostOrderListOco = Entry('orderList/oco', 'private', 'POST', {'cost': 0.2})
676
676
  private_post_orderlist_oto = privatePostOrderListOto = Entry('orderList/oto', 'private', 'POST', {'cost': 0.2})
677
677
  private_post_orderlist_otoco = privatePostOrderListOtoco = Entry('orderList/otoco', 'private', 'POST', {'cost': 0.2})
678
678
  private_post_sor_order = privatePostSorOrder = Entry('sor/order', 'private', 'POST', {'cost': 0.2})
679
679
  private_post_sor_order_test = privatePostSorOrderTest = Entry('sor/order/test', 'private', 'POST', {'cost': 0.2})
680
- private_post_order = privatePostOrder = Entry('order', 'private', 'POST', {'cost': 0.2})
681
- private_post_order_cancelreplace = privatePostOrderCancelReplace = Entry('order/cancelReplace', 'private', 'POST', {'cost': 0.2})
682
- private_post_order_test = privatePostOrderTest = Entry('order/test', 'private', 'POST', {'cost': 0.2})
683
- private_delete_openorders = privateDeleteOpenOrders = Entry('openOrders', 'private', 'DELETE', {'cost': 0.2})
684
- private_delete_orderlist = privateDeleteOrderList = Entry('orderList', 'private', 'DELETE', {'cost': 0.2})
685
- private_delete_order = privateDeleteOrder = Entry('order', 'private', 'DELETE', {'cost': 0.2})
680
+ private_post_order = privatePostOrder = Entry('order', 'private', 'POST', {'cost': 1})
681
+ private_post_order_cancelreplace = privatePostOrderCancelReplace = Entry('order/cancelReplace', 'private', 'POST', {'cost': 1})
682
+ private_post_order_test = privatePostOrderTest = Entry('order/test', 'private', 'POST', {'cost': 1})
683
+ private_delete_openorders = privateDeleteOpenOrders = Entry('openOrders', 'private', 'DELETE', {'cost': 1})
684
+ private_delete_orderlist = privateDeleteOrderList = Entry('orderList', 'private', 'DELETE', {'cost': 1})
685
+ private_delete_order = privateDeleteOrder = Entry('order', 'private', 'DELETE', {'cost': 1})
686
686
  papi_get_ping = papiGetPing = Entry('ping', 'papi', 'GET', {'cost': 1})
687
687
  papi_get_um_order = papiGetUmOrder = Entry('um/order', 'papi', 'GET', {'cost': 1})
688
688
  papi_get_um_openorder = papiGetUmOpenOrder = Entry('um/openOrder', 'papi', 'GET', {'cost': 1})
@@ -4,7 +4,7 @@
4
4
 
5
5
  # -----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.4.3'
7
+ __version__ = '4.4.5'
8
8
 
9
9
  # -----------------------------------------------------------------------------
10
10
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  # -----------------------------------------------------------------------------
4
4
 
5
- __version__ = '4.4.3'
5
+ __version__ = '4.4.5'
6
6
 
7
7
  # -----------------------------------------------------------------------------
8
8
 
@@ -65,6 +65,7 @@ class Exchange(BaseExchange):
65
65
  ping = None
66
66
  newUpdates = True
67
67
  clients = {}
68
+ timeout_on_exit = 250 # needed for: https://github.com/ccxt/ccxt/pull/23470
68
69
 
69
70
  def __init__(self, config={}):
70
71
  if 'asyncio_loop' in config:
@@ -114,8 +115,8 @@ class Exchange(BaseExchange):
114
115
 
115
116
  if self.own_session and self.session is None:
116
117
  # Pass this SSL context to aiohttp and create a TCPConnector
117
- connector = aiohttp.TCPConnector(ssl=self.ssl_context, loop=self.asyncio_loop, enable_cleanup_closed=True)
118
- self.session = aiohttp.ClientSession(loop=self.asyncio_loop, connector=connector, trust_env=self.aiohttp_trust_env)
118
+ self.tcp_connector = aiohttp.TCPConnector(ssl=self.ssl_context, loop=self.asyncio_loop, enable_cleanup_closed=True)
119
+ self.session = aiohttp.ClientSession(loop=self.asyncio_loop, connector=self.tcp_connector, trust_env=self.aiohttp_trust_env)
119
120
 
120
121
  async def close(self):
121
122
  await self.ws_close()
@@ -123,7 +124,17 @@ class Exchange(BaseExchange):
123
124
  if self.own_session:
124
125
  await self.session.close()
125
126
  self.session = None
127
+ await self.close_connector()
126
128
  await self.close_proxy_sessions()
129
+ await self.sleep(self.timeout_on_exit)
130
+
131
+ async def close_connector(self):
132
+ if self.tcp_connector is not None:
133
+ await self.tcp_connector.close()
134
+ self.tcp_connector = None
135
+ if self.aiohttp_socks_connector is not None:
136
+ await self.aiohttp_socks_connector.close()
137
+ self.aiohttp_socks_connector = None
127
138
 
128
139
  async def close_proxy_sessions(self):
129
140
  if self.socks_proxy_sessions is not None:
@@ -153,20 +164,20 @@ class Exchange(BaseExchange):
153
164
  elif socksProxy:
154
165
  if ProxyConnector is None:
155
166
  raise NotSupported(self.id + ' - to use SOCKS proxy with ccxt, you need "aiohttp_socks" module that can be installed by "pip install aiohttp_socks"')
156
- # Create our SSL context object with our CA cert file
157
- self.open() # ensure `asyncio_loop` is set
158
- connector = ProxyConnector.from_url(
159
- socksProxy,
160
- # extra args copied from self.open()
161
- ssl=self.ssl_context,
162
- loop=self.asyncio_loop,
163
- enable_cleanup_closed=True
164
- )
165
167
  # override session
166
168
  if (self.socks_proxy_sessions is None):
167
169
  self.socks_proxy_sessions = {}
168
170
  if (socksProxy not in self.socks_proxy_sessions):
169
- self.socks_proxy_sessions[socksProxy] = aiohttp.ClientSession(loop=self.asyncio_loop, connector=connector, trust_env=self.aiohttp_trust_env)
171
+ # Create our SSL context object with our CA cert file
172
+ self.open() # ensure `asyncio_loop` is set
173
+ self.aiohttp_socks_connector = ProxyConnector.from_url(
174
+ socksProxy,
175
+ # extra args copied from self.open()
176
+ ssl=self.ssl_context,
177
+ loop=self.asyncio_loop,
178
+ enable_cleanup_closed=True
179
+ )
180
+ self.socks_proxy_sessions[socksProxy] = aiohttp.ClientSession(loop=self.asyncio_loop, connector=self.aiohttp_socks_connector, trust_env=self.aiohttp_trust_env)
170
181
  proxy_session = self.socks_proxy_sessions[socksProxy]
171
182
  # add aiohttp_proxy for python as exclusion
172
183
  elif self.aiohttp_proxy:
@@ -23,6 +23,7 @@ class BaseCache(list):
23
23
  __contains__ = Delegate('__contains__', '_deque')
24
24
  __reversed__ = Delegate('__reversed__', '_deque')
25
25
  clear = Delegate('clear', '_deque')
26
+ pop = Delegate('pop', '_deque')
26
27
 
27
28
  def __init__(self, max_size=None):
28
29
  super(BaseCache, self).__init__()
@@ -8,7 +8,7 @@ from ccxt.abstract.binance import ImplicitAPI
8
8
  import asyncio
9
9
  import hashlib
10
10
  import json
11
- from ccxt.base.types import Balances, Conversion, CrossBorrowRate, Currencies, Currency, Greeks, Int, IsolatedBorrowRate, IsolatedBorrowRates, Leverage, Leverages, LeverageTier, LeverageTiers, MarginMode, MarginModes, MarginModification, Market, MarketInterface, Num, Option, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, TradingFees, Transaction, TransferEntry
11
+ from ccxt.base.types import Balances, Conversion, CrossBorrowRate, Currencies, Currency, Greeks, Int, IsolatedBorrowRate, IsolatedBorrowRates, LedgerEntry, Leverage, Leverages, LeverageTier, LeverageTiers, MarginMode, MarginModes, MarginModification, Market, MarketInterface, Num, Option, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, TradingFees, Transaction, TransferEntry
12
12
  from typing import List
13
13
  from ccxt.base.errors import ExchangeError
14
14
  from ccxt.base.errors import AuthenticationError
@@ -1223,6 +1223,7 @@ class binance(Exchange, ImplicitAPI):
1223
1223
  # exchange-specific options
1224
1224
  'options': {
1225
1225
  'sandboxMode': False,
1226
+ 'fetchMargins': True,
1226
1227
  'fetchMarkets': [
1227
1228
  'spot', # allows CORS in browsers
1228
1229
  'linear', # allows CORS in browsers
@@ -2854,13 +2855,12 @@ class binance(Exchange, ImplicitAPI):
2854
2855
  if type == 'option' and sandboxMode:
2855
2856
  continue
2856
2857
  fetchMarkets.append(type)
2857
- fetchMargins = False
2858
+ fetchMargins = self.safe_bool(self.options, 'fetchMargins', False)
2858
2859
  for i in range(0, len(fetchMarkets)):
2859
2860
  marketType = fetchMarkets[i]
2860
2861
  if marketType == 'spot':
2861
2862
  promisesRaw.append(self.publicGetExchangeInfo(params))
2862
- if self.check_required_credentials(False) and not sandboxMode:
2863
- fetchMargins = True
2863
+ if fetchMargins and self.check_required_credentials(False) and not sandboxMode:
2864
2864
  promisesRaw.append(self.sapiGetMarginAllPairs(params))
2865
2865
  promisesRaw.append(self.sapiGetMarginIsolatedAllPairs(params))
2866
2866
  elif marketType == 'linear':
@@ -10362,19 +10362,42 @@ class binance(Exchange, ImplicitAPI):
10362
10362
  result.append(self.parse_settlement(settlements[i], market))
10363
10363
  return result
10364
10364
 
10365
- async def fetch_ledger_entry(self, id: str, code: Str = None, params={}):
10365
+ async def fetch_ledger_entry(self, id: str, code: Str = None, params={}) -> LedgerEntry:
10366
+ """
10367
+ fetch the history of changes, actions done by the user or operations that altered the balance of the user
10368
+ :see: https://developers.binance.com/docs/derivatives/option/account/Account-Funding-Flow
10369
+ :param str id: the identification number of the ledger entry
10370
+ :param str code: unified currency code
10371
+ :param dict [params]: extra parameters specific to the exchange API endpoint
10372
+ :returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger-structure>`
10373
+ """
10366
10374
  await self.load_markets()
10367
10375
  type = None
10368
10376
  type, params = self.handle_market_type_and_params('fetchLedgerEntry', None, params)
10369
- query: dict = {
10370
- 'recordId': id,
10371
- 'type': type,
10372
- }
10373
10377
  if type != 'option':
10374
10378
  raise BadRequest(self.id + ' fetchLedgerEntry() can only be used for type option')
10375
- return await self.fetch_ledger(code, None, None, self.extend(query, params))
10379
+ self.check_required_argument('fetchLedgerEntry', code, 'code')
10380
+ currency = self.currency(code)
10381
+ request: dict = {
10382
+ 'recordId': id,
10383
+ 'currency': currency['id'],
10384
+ }
10385
+ response = await self.eapiPrivateGetBill(self.extend(request, params))
10386
+ #
10387
+ # [
10388
+ # {
10389
+ # "id": "1125899906845701870",
10390
+ # "asset": "USDT",
10391
+ # "amount": "-0.16518203",
10392
+ # "type": "FEE",
10393
+ # "createDate": 1676621042489
10394
+ # }
10395
+ # ]
10396
+ #
10397
+ first = self.safe_dict(response, 0, response)
10398
+ return self.parse_ledger_entry(first, currency)
10376
10399
 
10377
- async def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
10400
+ async def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[LedgerEntry]:
10378
10401
  """
10379
10402
  fetch the history of changes, actions done by the user or operations that altered the balance of the user
10380
10403
  :see: https://developers.binance.com/docs/derivatives/option/account/Account-Funding-Flow
@@ -10382,9 +10405,9 @@ class binance(Exchange, ImplicitAPI):
10382
10405
  :see: https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Get-Income-History
10383
10406
  :see: https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Income-History
10384
10407
  :see: https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-CM-Income-History
10385
- :param str code: unified currency code
10408
+ :param str [code]: unified currency code
10386
10409
  :param int [since]: timestamp in ms of the earliest ledger entry
10387
- :param int [limit]: max number of ledger entrys to return
10410
+ :param int [limit]: max number of ledger entries to return
10388
10411
  :param dict [params]: extra parameters specific to the exchange API endpoint
10389
10412
  :param int [params.until]: timestamp in ms of the latest ledger entry
10390
10413
  :param boolean [params.paginate]: default False, when True will automatically paginate by calling self endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
@@ -10462,7 +10485,7 @@ class binance(Exchange, ImplicitAPI):
10462
10485
  #
10463
10486
  return self.parse_ledger(response, currency, since, limit)
10464
10487
 
10465
- def parse_ledger_entry(self, item: dict, currency: Currency = None):
10488
+ def parse_ledger_entry(self, item: dict, currency: Currency = None) -> LedgerEntry:
10466
10489
  #
10467
10490
  # options(eapi)
10468
10491
  #
@@ -10495,16 +10518,19 @@ class binance(Exchange, ImplicitAPI):
10495
10518
  else:
10496
10519
  direction = 'in'
10497
10520
  currencyId = self.safe_string(item, 'asset')
10521
+ code = self.safe_currency_code(currencyId, currency)
10522
+ currency = self.safe_currency(currencyId, currency)
10498
10523
  timestamp = self.safe_integer_2(item, 'createDate', 'time')
10499
10524
  type = self.safe_string_2(item, 'type', 'incomeType')
10500
- return {
10525
+ return self.safe_ledger_entry({
10526
+ 'info': item,
10501
10527
  'id': self.safe_string_2(item, 'id', 'tranId'),
10502
10528
  'direction': direction,
10503
10529
  'account': None,
10504
10530
  'referenceAccount': None,
10505
10531
  'referenceId': self.safe_string(item, 'tradeId'),
10506
10532
  'type': self.parse_ledger_entry_type(type),
10507
- 'currency': self.safe_currency_code(currencyId, currency),
10533
+ 'currency': code,
10508
10534
  'amount': self.parse_number(amount),
10509
10535
  'timestamp': timestamp,
10510
10536
  'datetime': self.iso8601(timestamp),
@@ -10512,8 +10538,7 @@ class binance(Exchange, ImplicitAPI):
10512
10538
  'after': None,
10513
10539
  'status': None,
10514
10540
  'fee': None,
10515
- 'info': item,
10516
- }
10541
+ }, currency)
10517
10542
 
10518
10543
  def parse_ledger_entry_type(self, type):
10519
10544
  ledgerType: dict = {
@@ -44,6 +44,7 @@ class binanceus(binance, ImplicitAPI):
44
44
  'options': {
45
45
  'fetchMarkets': ['spot'],
46
46
  'defaultType': 'spot',
47
+ 'fetchMargins': False,
47
48
  'quoteOrderQty': False,
48
49
  },
49
50
  'has': {
@@ -481,6 +481,7 @@ class bingx(Exchange, ImplicitAPI):
481
481
  'commonCurrencies': {
482
482
  'SNOW': 'Snowman', # Snowman vs SnowSwap conflict
483
483
  'OMNI': 'OmniCat',
484
+ 'NAP': '$NAP', # NAP on SOL = SNAP
484
485
  },
485
486
  'options': {
486
487
  'defaultType': 'spot',
@@ -7,7 +7,7 @@ from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.bitfinex2 import ImplicitAPI
8
8
  import asyncio
9
9
  import hashlib
10
- from ccxt.base.types import Balances, Currencies, Currency, Int, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFees, Transaction, TransferEntry
10
+ from ccxt.base.types import Balances, Currencies, Currency, Int, LedgerEntry, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, 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
@@ -2730,7 +2730,7 @@ class bitfinex2(Exchange, ImplicitAPI):
2730
2730
  else:
2731
2731
  return type
2732
2732
 
2733
- def parse_ledger_entry(self, item: dict, currency: Currency = None):
2733
+ def parse_ledger_entry(self, item: dict, currency: Currency = None) -> LedgerEntry:
2734
2734
  #
2735
2735
  # [
2736
2736
  # [
@@ -2751,6 +2751,7 @@ class bitfinex2(Exchange, ImplicitAPI):
2751
2751
  id = self.safe_string(itemList, 0)
2752
2752
  currencyId = self.safe_string(itemList, 1)
2753
2753
  code = self.safe_currency_code(currencyId, currency)
2754
+ currency = self.safe_currency(currencyId, currency)
2754
2755
  timestamp = self.safe_integer(itemList, 3)
2755
2756
  amount = self.safe_number(itemList, 5)
2756
2757
  after = self.safe_number(itemList, 6)
@@ -2759,7 +2760,8 @@ class bitfinex2(Exchange, ImplicitAPI):
2759
2760
  parts = description.split(' @ ')
2760
2761
  first = self.safe_string_lower(parts, 0)
2761
2762
  type = self.parse_ledger_entry_type(first)
2762
- return {
2763
+ return self.safe_ledger_entry({
2764
+ 'info': item,
2763
2765
  'id': id,
2764
2766
  'direction': None,
2765
2767
  'account': None,
@@ -2774,16 +2776,15 @@ class bitfinex2(Exchange, ImplicitAPI):
2774
2776
  'after': after,
2775
2777
  'status': None,
2776
2778
  'fee': None,
2777
- 'info': item,
2778
- }
2779
+ }, currency)
2779
2780
 
2780
- async def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
2781
+ async def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[LedgerEntry]:
2781
2782
  """
2782
- fetch the history of changes, actions done by the user or operations that altered balance of the user
2783
+ fetch the history of changes, actions done by the user or operations that altered the balance of the user
2783
2784
  :see: https://docs.bitfinex.com/reference/rest-auth-ledgers
2784
- :param str code: unified currency code, default is None
2785
+ :param str [code]: unified currency code, default is None
2785
2786
  :param int [since]: timestamp in ms of the earliest ledger entry, default is None
2786
- :param int [limit]: max number of ledger entrys to return, default is None max is 2500
2787
+ :param int [limit]: max number of ledger entries to return, default is None, max is 2500
2787
2788
  :param dict [params]: extra parameters specific to the exchange API endpoint
2788
2789
  :param int [params.until]: timestamp in ms of the latest ledger entry
2789
2790
  :param boolean [params.paginate]: default False, when True will automatically paginate by calling self endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)