python-okx 0.3.3__tar.gz → 0.3.5__tar.gz

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 (36) hide show
  1. {python_okx-0.3.3 → python_okx-0.3.5}/PKG-INFO +1 -1
  2. {python_okx-0.3.3 → python_okx-0.3.5}/okx/Account.py +23 -3
  3. {python_okx-0.3.3 → python_okx-0.3.5}/okx/BlockTrading.py +1 -1
  4. {python_okx-0.3.3 → python_okx-0.3.5}/okx/Convert.py +1 -1
  5. {python_okx-0.3.3 → python_okx-0.3.5}/okx/CopyTrading.py +1 -1
  6. {python_okx-0.3.3 → python_okx-0.3.5}/okx/Earning.py +1 -1
  7. {python_okx-0.3.3 → python_okx-0.3.5}/okx/FDBroker.py +1 -1
  8. {python_okx-0.3.3 → python_okx-0.3.5}/okx/Funding.py +3 -3
  9. {python_okx-0.3.3 → python_okx-0.3.5}/okx/Grid.py +1 -1
  10. {python_okx-0.3.3 → python_okx-0.3.5}/okx/MarketData.py +1 -1
  11. {python_okx-0.3.3 → python_okx-0.3.5}/okx/NDBroker.py +1 -1
  12. {python_okx-0.3.3 → python_okx-0.3.5}/okx/PublicData.py +1 -1
  13. {python_okx-0.3.3 → python_okx-0.3.5}/okx/SimpleEarnFixed.py +1 -1
  14. {python_okx-0.3.3 → python_okx-0.3.5}/okx/SpreadTrading.py +1 -1
  15. {python_okx-0.3.3 → python_okx-0.3.5}/okx/Status.py +1 -1
  16. {python_okx-0.3.3 → python_okx-0.3.5}/okx/SubAccount.py +1 -1
  17. {python_okx-0.3.3 → python_okx-0.3.5}/okx/Trade.py +1 -1
  18. {python_okx-0.3.3 → python_okx-0.3.5}/okx/TradingData.py +1 -1
  19. {python_okx-0.3.3 → python_okx-0.3.5}/okx/__init__.py +1 -1
  20. {python_okx-0.3.3 → python_okx-0.3.5}/okx/consts.py +3 -0
  21. {python_okx-0.3.3 → python_okx-0.3.5}/okx/okxclient.py +1 -1
  22. {python_okx-0.3.3 → python_okx-0.3.5}/okx/websocket/WebSocketFactory.py +1 -2
  23. {python_okx-0.3.3 → python_okx-0.3.5}/okx/websocket/WsPrivateAsync.py +2 -3
  24. {python_okx-0.3.3 → python_okx-0.3.5}/okx/websocket/WsPublicAsync.py +2 -3
  25. {python_okx-0.3.3 → python_okx-0.3.5}/python_okx.egg-info/PKG-INFO +1 -1
  26. {python_okx-0.3.3 → python_okx-0.3.5}/README.md +0 -0
  27. {python_okx-0.3.3 → python_okx-0.3.5}/okx/exceptions.py +0 -0
  28. {python_okx-0.3.3 → python_okx-0.3.5}/okx/utils.py +0 -0
  29. {python_okx-0.3.3 → python_okx-0.3.5}/okx/websocket/WsUtils.py +0 -0
  30. {python_okx-0.3.3 → python_okx-0.3.5}/okx/websocket/__init__.py +0 -0
  31. {python_okx-0.3.3 → python_okx-0.3.5}/python_okx.egg-info/SOURCES.txt +0 -0
  32. {python_okx-0.3.3 → python_okx-0.3.5}/python_okx.egg-info/dependency_links.txt +0 -0
  33. {python_okx-0.3.3 → python_okx-0.3.5}/python_okx.egg-info/requires.txt +0 -0
  34. {python_okx-0.3.3 → python_okx-0.3.5}/python_okx.egg-info/top_level.txt +0 -0
  35. {python_okx-0.3.3 → python_okx-0.3.5}/setup.cfg +0 -0
  36. {python_okx-0.3.3 → python_okx-0.3.5}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-okx
3
- Version: 0.3.3
3
+ Version: 0.3.5
4
4
  Summary: Python SDK for OKX
5
5
  Home-page: https://okx.com/docs-v5/
6
6
  Author: okxv5api
@@ -5,7 +5,7 @@ from .okxclient import OkxClient
5
5
  class AccountAPI(OkxClient):
6
6
 
7
7
  def __init__(self, api_key='-1', api_secret_key='-1', passphrase='-1', use_server_time=None, flag='1',
8
- domain='https://www.okx.com', debug=True, proxy=None):
8
+ domain='https://www.okx.com', debug=False, proxy=None):
9
9
  OkxClient.__init__(self, api_key, api_secret_key, passphrase, use_server_time, flag, domain, debug, proxy)
10
10
 
11
11
  # Get Positions
@@ -88,8 +88,8 @@ class AccountAPI(OkxClient):
88
88
  return self._request_with_params(POST, ADJUSTMENT_MARGIN, params)
89
89
 
90
90
  # Get Leverage
91
- def get_leverage(self, instId, mgnMode):
92
- params = {'instId': instId, 'mgnMode': mgnMode}
91
+ def get_leverage(self, mgnMode, ccy='', instId=''):
92
+ params = {'instId': instId, 'mgnMode': mgnMode, 'ccy': ccy}
93
93
  return self._request_with_params(GET, GET_LEVERAGE, params)
94
94
 
95
95
  # Get instruments
@@ -294,3 +294,23 @@ class AccountAPI(OkxClient):
294
294
  if limit is not None:
295
295
  params['limit'] = limit
296
296
  return self._request_with_params(GET, BORROWING_ORDERS_LIST, params)
297
+
298
+ def spot_manual_borrow_repay(self, ccy=None, side=None, amt=None):
299
+ params = {}
300
+ if ccy is not None:
301
+ params['ccy'] = ccy
302
+ if side is not None:
303
+ params['side'] = side
304
+ if amt is not None:
305
+ params['amt'] = amt
306
+ return self._request_with_params(POST, MANUAL_REBORROW_REPAY, params)
307
+
308
+ def set_auto_repay(self, autoRepay=False):
309
+ params = {}
310
+ if autoRepay is not None:
311
+ params['autoRepay'] = autoRepay
312
+ return self._request_with_params(POST, SET_AUTO_REPAY, params)
313
+
314
+ def spot_borrow_repay_history(self, ccy='', type='', after='', before='', limit=''):
315
+ params = {'ccy': ccy, 'type': type, 'after': after, 'before': before, 'limit': limit}
316
+ return self._request_with_params(GET, GET_BORROW_REPAY_HISTORY, params)
@@ -3,7 +3,7 @@ from .consts import *
3
3
 
4
4
 
5
5
  class BlockTradingAPI(OkxClient):
6
- def __init__(self, api_key='-1', api_secret_key='-1', passphrase='-1', use_server_time=None, flag='1', domain = 'https://www.okx.com',debug = True, proxy=None):
6
+ def __init__(self, api_key='-1', api_secret_key='-1', passphrase='-1', use_server_time=None, flag='1', domain = 'https://www.okx.com',debug = False, proxy=None):
7
7
  OkxClient.__init__(self, api_key, api_secret_key, passphrase, use_server_time, flag, domain, debug, proxy)
8
8
 
9
9
  def counterparties(self):
@@ -3,7 +3,7 @@ from .consts import *
3
3
 
4
4
 
5
5
  class ConvertAPI(OkxClient):
6
- def __init__(self, api_key='-1', api_secret_key='-1', passphrase='-1', use_server_time=None, flag='1', domain = 'https://www.okx.com',debug = True,proxy = None):
6
+ def __init__(self, api_key='-1', api_secret_key='-1', passphrase='-1', use_server_time=None, flag='1', domain = 'https://www.okx.com',debug = False,proxy = None):
7
7
  OkxClient.__init__(self, api_key, api_secret_key, passphrase, use_server_time, flag, domain, debug, proxy)
8
8
 
9
9
  def get_currencies(self):
@@ -4,7 +4,7 @@ from .consts import *
4
4
 
5
5
  class CopyTradingAPI(OkxClient):
6
6
  def __init__(self, api_key='-1', api_secret_key='-1', passphrase='-1', use_server_time=False, flag='1',
7
- domain='https://www.okx.com', debug=True, proxy=None):
7
+ domain='https://www.okx.com', debug=False, proxy=None):
8
8
  OkxClient.__init__(self, api_key, api_secret_key, passphrase, use_server_time, flag, domain, debug,
9
9
  proxy=proxy)
10
10
 
@@ -3,7 +3,7 @@ from .consts import *
3
3
 
4
4
 
5
5
  class EarningAPI(OkxClient):
6
- def __init__(self, api_key='-1', api_secret_key='-1', passphrase='-1', use_server_time=None, flag='1', domain = 'https://www.okx.com',debug = True, proxy=None):
6
+ def __init__(self, api_key='-1', api_secret_key='-1', passphrase='-1', use_server_time=None, flag='1', domain = 'https://www.okx.com',debug = False, proxy=None):
7
7
  OkxClient.__init__(self, api_key, api_secret_key, passphrase, use_server_time, flag, domain, debug, proxy)
8
8
 
9
9
  def get_offers(self,productId = '',protocolType = '',ccy = ''):
@@ -3,7 +3,7 @@ from .consts import *
3
3
 
4
4
 
5
5
  class FDBrokerAPI(OkxClient):
6
- def __init__(self, api_key='-1', api_secret_key='-1', passphrase='-1', use_server_time=None, flag='1', domain = 'https://www.okx.com',debug = True, proxy=None):
6
+ def __init__(self, api_key='-1', api_secret_key='-1', passphrase='-1', use_server_time=None, flag='1', domain = 'https://www.okx.com',debug = False, proxy=None):
7
7
  OkxClient.__init__(self, api_key, api_secret_key, passphrase, use_server_time, flag, domain, debug, proxy)
8
8
 
9
9
  def generate_rebate_details_download_link(self, begin ='', end = ''):
@@ -5,7 +5,7 @@ from .consts import *
5
5
  class FundingAPI(OkxClient):
6
6
 
7
7
 
8
- def __init__(self, api_key='-1', api_secret_key='-1', passphrase='-1', use_server_time=None, flag='1', domain = 'https://www.okx.com',debug = True, proxy=None):
8
+ def __init__(self, api_key='-1', api_secret_key='-1', passphrase='-1', use_server_time=None, flag='1', domain = 'https://www.okx.com',debug = False, proxy=None):
9
9
  OkxClient.__init__(self, api_key, api_secret_key, passphrase, use_server_time, flag, domain, debug, proxy)
10
10
 
11
11
  # Get Non Tradable Assets
@@ -35,8 +35,8 @@ class FundingAPI(OkxClient):
35
35
  return self._request_with_params(POST, FUNDS_TRANSFER, params)
36
36
 
37
37
  # Withdrawal
38
- def withdrawal(self, ccy, amt, dest, toAddr, fee, chain='', areaCode='', clientId=''):
39
- params = {'ccy': ccy, 'amt': amt, 'dest': dest, 'toAddr': toAddr, 'fee': fee, 'chain': chain,
38
+ def withdrawal(self, ccy, amt, dest, toAddr, chain='', areaCode='', clientId=''):
39
+ params = {'ccy': ccy, 'amt': amt, 'dest': dest, 'toAddr': toAddr, 'chain': chain,
40
40
  'areaCode': areaCode, 'clientId': clientId}
41
41
  return self._request_with_params(POST, WITHDRAWAL_COIN, params)
42
42
 
@@ -3,7 +3,7 @@ from .consts import *
3
3
 
4
4
 
5
5
  class GridAPI(OkxClient):
6
- def __init__(self, api_key='-1', api_secret_key='-1', passphrase='-1', use_server_time=None, flag='1', domain = 'https://www.okx.com',debug = True, proxy=None):
6
+ def __init__(self, api_key='-1', api_secret_key='-1', passphrase='-1', use_server_time=None, flag='1', domain = 'https://www.okx.com',debug = False, proxy=None):
7
7
  OkxClient.__init__(self, api_key, api_secret_key, passphrase, use_server_time, flag, domain, debug, proxy)
8
8
 
9
9
  def grid_order_algo(self, instId='', algoOrdType='', maxPx='', minPx='', gridNum='', runType='', tpTriggerPx='',
@@ -4,7 +4,7 @@ from .consts import *
4
4
 
5
5
  class MarketAPI(OkxClient):
6
6
 
7
- def __init__(self, api_key='-1', api_secret_key='-1', passphrase='-1', use_server_time=None, flag='1', domain = 'https://www.okx.com',debug = True, proxy=None):
7
+ def __init__(self, api_key='-1', api_secret_key='-1', passphrase='-1', use_server_time=None, flag='1', domain = 'https://www.okx.com',debug = False, proxy=None):
8
8
  OkxClient.__init__(self, api_key, api_secret_key, passphrase, use_server_time, flag, domain, debug, proxy)
9
9
 
10
10
 
@@ -1,7 +1,7 @@
1
1
  from .okxclient import OkxClient
2
2
  from .consts import *
3
3
  class NDBrokerAPI(OkxClient):
4
- def __init__(self, api_key='-1', api_secret_key='-1', passphrase='-1', use_server_time=None, flag='1', domain = 'https://www.okx.com',debug = True, proxy=None):
4
+ def __init__(self, api_key='-1', api_secret_key='-1', passphrase='-1', use_server_time=None, flag='1', domain = 'https://www.okx.com',debug = False, proxy=None):
5
5
  OkxClient.__init__(self, api_key, api_secret_key, passphrase, use_server_time, flag, domain, debug, proxy)
6
6
 
7
7
  #GET /api/v5/broker/nd/info
@@ -4,7 +4,7 @@ from .consts import *
4
4
 
5
5
  class PublicAPI(OkxClient):
6
6
 
7
- def __init__(self, api_key='-1', api_secret_key='-1', passphrase='-1', use_server_time=None, flag='1', domain = 'https://www.okx.com',debug = True, proxy=None):
7
+ def __init__(self, api_key='-1', api_secret_key='-1', passphrase='-1', use_server_time=None, flag='1', domain = 'https://www.okx.com',debug = False, proxy=None):
8
8
  OkxClient.__init__(self, api_key, api_secret_key, passphrase, use_server_time, flag, domain, debug, proxy)
9
9
 
10
10
  # Get Instruments
@@ -5,7 +5,7 @@ from okx.okxclient import OkxClient
5
5
 
6
6
  class SimpleEarnFixedAPI(OkxClient):
7
7
  def __init__(self, api_key='-1', api_secret_key='-1', passphrase='-1', use_server_time=None, flag='1',
8
- domain='https://www.okx.com', debug=True, proxy=None):
8
+ domain='https://www.okx.com', debug=False, proxy=None):
9
9
  OkxClient.__init__(self, api_key, api_secret_key, passphrase, use_server_time, flag, domain, debug, proxy)
10
10
 
11
11
  def get_lending_offers(self, ccy=None, term=None):
@@ -4,7 +4,7 @@ from .consts import *
4
4
 
5
5
  class SpreadTradingAPI(OkxClient):
6
6
 
7
- def __init__(self, api_key='-1', api_secret_key='-1', passphrase='-1', use_server_time=None, flag='1', domain = 'https://www.okx.com',debug = True, proxy=None):
7
+ def __init__(self, api_key='-1', api_secret_key='-1', passphrase='-1', use_server_time=None, flag='1', domain = 'https://www.okx.com',debug = False, proxy=None):
8
8
  OkxClient.__init__(self, api_key, api_secret_key, passphrase, use_server_time, flag, domain, debug, proxy)
9
9
 
10
10
  # Place Order
@@ -3,7 +3,7 @@ from .consts import *
3
3
 
4
4
 
5
5
  class StatusAPI(OkxClient):
6
- def __init__(self, api_key='-1', api_secret_key='-1', passphrase='-1', use_server_time=None, flag='1', domain = 'https://www.okx.com',debug = True, proxy=None):
6
+ def __init__(self, api_key='-1', api_secret_key='-1', passphrase='-1', use_server_time=None, flag='1', domain = 'https://www.okx.com',debug = False, proxy=None):
7
7
  OkxClient.__init__(self, api_key, api_secret_key, passphrase, use_server_time, flag, domain, debug, proxy)
8
8
 
9
9
  def status(self, state=''):
@@ -3,7 +3,7 @@ from .consts import *
3
3
 
4
4
 
5
5
  class SubAccountAPI(OkxClient):
6
- def __init__(self, api_key='-1', api_secret_key='-1', passphrase='-1', use_server_time=None, flag='1', domain = 'https://www.okx.com',debug = True, proxy=None):
6
+ def __init__(self, api_key='-1', api_secret_key='-1', passphrase='-1', use_server_time=None, flag='1', domain = 'https://www.okx.com',debug = False, proxy=None):
7
7
  OkxClient.__init__(self, api_key, api_secret_key, passphrase, use_server_time, flag, domain, debug, proxy)
8
8
 
9
9
  def get_account_balance(self, subAcct):
@@ -7,7 +7,7 @@ from .consts import *
7
7
  class TradeAPI(OkxClient):
8
8
 
9
9
  def __init__(self, api_key='-1', api_secret_key='-1', passphrase='-1', use_server_time=None, flag='1',
10
- domain='https://www.okx.com', debug=True, proxy=None):
10
+ domain='https://www.okx.com', debug=False, proxy=None):
11
11
  OkxClient.__init__(self, api_key, api_secret_key, passphrase, use_server_time, flag, domain, debug, proxy)
12
12
 
13
13
  # Place Order
@@ -4,7 +4,7 @@ from .consts import *
4
4
 
5
5
  class TradingDataAPI(OkxClient):
6
6
 
7
- def __init__(self, api_key='-1', api_secret_key='-1', passphrase='-1', use_server_time=None, flag='1', domain = 'https://www.okx.com',debug = True, proxy=None):
7
+ def __init__(self, api_key='-1', api_secret_key='-1', passphrase='-1', use_server_time=None, flag='1', domain = 'https://www.okx.com',debug = False, proxy=None):
8
8
  OkxClient.__init__(self, api_key, api_secret_key, passphrase, use_server_time, flag, domain, debug, proxy)
9
9
 
10
10
 
@@ -2,4 +2,4 @@
2
2
  Python SDK for the OKX API v5
3
3
 
4
4
  """
5
- __version__="0.3.3"
5
+ __version__="0.3.5"
@@ -62,6 +62,9 @@ AMEND_BORROWING_ORDER='/api/v5/account/fixed-loan/amend-borrowing-order'
62
62
  MANUAL_REBORROW = '/api/v5/account/fixed-loan/manual-reborrow'
63
63
  REPAY_BORROWING_ORDER='/api/v5/account/fixed-loan/repay-borrowing-order'
64
64
  BORROWING_ORDERS_LIST='/api/v5/account/fixed-loan/borrowing-orders-list'
65
+ MANUAL_REBORROW_REPAY = '/api/v5/account/spot-manual-borrow-repay'
66
+ SET_AUTO_REPAY='/api/v5/account/set-auto-repay'
67
+ GET_BORROW_REPAY_HISTORY='/api/v5/account/spot-borrow-repay-history'
65
68
 
66
69
  # funding-complete-testcomplete
67
70
  NON_TRADABLE_ASSETS = '/api/v5/asset/non-tradable-assets'
@@ -13,7 +13,7 @@ from . import consts as c, utils, exceptions
13
13
 
14
14
  class OkxClient(Client):
15
15
 
16
- def __init__(self, api_key='-1', api_secret_key='-1', passphrase='-1', use_server_time=None, flag='1',base_api=c.API_URL, debug='True', proxy=None):
16
+ def __init__(self, api_key='-1', api_secret_key='-1', passphrase='-1', use_server_time=None, flag='1',base_api=c.API_URL, debug=False, proxy=None):
17
17
  super().__init__(base_url=base_api, http2=True, proxy=proxy)
18
18
  self.API_KEY = api_key
19
19
  self.API_SECRET_KEY = api_secret_key
@@ -5,8 +5,7 @@ import ssl
5
5
  import certifi
6
6
  import websockets
7
7
 
8
- logging.basicConfig(level=logging.INFO)
9
- logger = logging.getLogger("WebSocketFactory")
8
+ logger = logging.getLogger(__name__)
10
9
 
11
10
 
12
11
  class WebSocketFactory:
@@ -5,8 +5,7 @@ import logging
5
5
  from okx.websocket import WsUtils
6
6
  from okx.websocket.WebSocketFactory import WebSocketFactory
7
7
 
8
- logging.basicConfig(level=logging.INFO)
9
- logger = logging.getLogger("WsPrivate")
8
+ logger = logging.getLogger(__name__)
10
9
 
11
10
 
12
11
  class WsPrivateAsync:
@@ -26,7 +25,7 @@ class WsPrivateAsync:
26
25
 
27
26
  async def consume(self):
28
27
  async for message in self.websocket:
29
- logger.info("Received message: {%s}", message)
28
+ logger.debug("Received message: {%s}", message)
30
29
  if self.callback:
31
30
  self.callback(message)
32
31
 
@@ -4,8 +4,7 @@ import logging
4
4
 
5
5
  from okx.websocket.WebSocketFactory import WebSocketFactory
6
6
 
7
- logging.basicConfig(level=logging.INFO)
8
- logger = logging.getLogger("WsPublic")
7
+ logger = logging.getLogger(__name__)
9
8
 
10
9
 
11
10
  class WsPublicAsync:
@@ -21,7 +20,7 @@ class WsPublicAsync:
21
20
 
22
21
  async def consume(self):
23
22
  async for message in self.websocket:
24
- logger.info("Received message: {%s}", message)
23
+ logger.debug("Received message: {%s}", message)
25
24
  if self.callback:
26
25
  self.callback(message)
27
26
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-okx
3
- Version: 0.3.3
3
+ Version: 0.3.5
4
4
  Summary: Python SDK for OKX
5
5
  Home-page: https://okx.com/docs-v5/
6
6
  Author: okxv5api
File without changes
File without changes
File without changes
File without changes
File without changes