diff --git a/okx/Account.py b/okx/Account.py index c66834c..be7146e 100644 --- a/okx/Account.py +++ b/okx/Account.py @@ -5,7 +5,7 @@ from .okxclient import OkxClient class AccountAPI(OkxClient): 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): + domain='https://www.okx.com', debug=False, proxy=None): OkxClient.__init__(self, api_key, api_secret_key, passphrase, use_server_time, flag, domain, debug, proxy) # Get Positions diff --git a/okx/BlockTrading.py b/okx/BlockTrading.py index 2979105..75c6b53 100644 --- a/okx/BlockTrading.py +++ b/okx/BlockTrading.py @@ -3,7 +3,7 @@ from .consts import * class BlockTradingAPI(OkxClient): - 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): + 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): OkxClient.__init__(self, api_key, api_secret_key, passphrase, use_server_time, flag, domain, debug, proxy) def counterparties(self): diff --git a/okx/Convert.py b/okx/Convert.py index fe5f5fe..075607b 100644 --- a/okx/Convert.py +++ b/okx/Convert.py @@ -3,7 +3,7 @@ from .consts import * class ConvertAPI(OkxClient): - 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): + 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): OkxClient.__init__(self, api_key, api_secret_key, passphrase, use_server_time, flag, domain, debug, proxy) def get_currencies(self): diff --git a/okx/CopyTrading.py b/okx/CopyTrading.py index 3d6725b..331b6cf 100644 --- a/okx/CopyTrading.py +++ b/okx/CopyTrading.py @@ -4,7 +4,7 @@ from .consts import * class CopyTradingAPI(OkxClient): def __init__(self, api_key='-1', api_secret_key='-1', passphrase='-1', use_server_time=False, flag='1', - domain='https://www.okx.com', debug=True, proxy=None): + domain='https://www.okx.com', debug=False, proxy=None): OkxClient.__init__(self, api_key, api_secret_key, passphrase, use_server_time, flag, domain, debug, proxy=proxy) diff --git a/okx/Earning.py b/okx/Earning.py index bd19bef..e44c5e7 100644 --- a/okx/Earning.py +++ b/okx/Earning.py @@ -3,7 +3,7 @@ from .consts import * class EarningAPI(OkxClient): - 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): + 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): OkxClient.__init__(self, api_key, api_secret_key, passphrase, use_server_time, flag, domain, debug, proxy) def get_offers(self,productId = '',protocolType = '',ccy = ''): diff --git a/okx/FDBroker.py b/okx/FDBroker.py index f2224fa..3118564 100644 --- a/okx/FDBroker.py +++ b/okx/FDBroker.py @@ -3,7 +3,7 @@ from .consts import * class FDBrokerAPI(OkxClient): - 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): + 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): OkxClient.__init__(self, api_key, api_secret_key, passphrase, use_server_time, flag, domain, debug, proxy) def generate_rebate_details_download_link(self, begin ='', end = ''): diff --git a/okx/Funding.py b/okx/Funding.py index 61cd021..92bdd83 100644 --- a/okx/Funding.py +++ b/okx/Funding.py @@ -5,7 +5,7 @@ from .consts import * class FundingAPI(OkxClient): - 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): + 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): OkxClient.__init__(self, api_key, api_secret_key, passphrase, use_server_time, flag, domain, debug, proxy) # Get Non Tradable Assets diff --git a/okx/Grid.py b/okx/Grid.py index dca8e9e..74b6a9b 100644 --- a/okx/Grid.py +++ b/okx/Grid.py @@ -3,7 +3,7 @@ from .consts import * class GridAPI(OkxClient): - 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): + 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): OkxClient.__init__(self, api_key, api_secret_key, passphrase, use_server_time, flag, domain, debug, proxy) def grid_order_algo(self, instId='', algoOrdType='', maxPx='', minPx='', gridNum='', runType='', tpTriggerPx='', diff --git a/okx/MarketData.py b/okx/MarketData.py index 0eb938b..500a1f7 100644 --- a/okx/MarketData.py +++ b/okx/MarketData.py @@ -4,7 +4,7 @@ from .consts import * class MarketAPI(OkxClient): - 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): + 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): OkxClient.__init__(self, api_key, api_secret_key, passphrase, use_server_time, flag, domain, debug, proxy) diff --git a/okx/NDBroker.py b/okx/NDBroker.py index d1db365..4341d27 100644 --- a/okx/NDBroker.py +++ b/okx/NDBroker.py @@ -1,7 +1,7 @@ from .okxclient import OkxClient from .consts import * class NDBrokerAPI(OkxClient): - 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): + 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): OkxClient.__init__(self, api_key, api_secret_key, passphrase, use_server_time, flag, domain, debug, proxy) #GET /api/v5/broker/nd/info diff --git a/okx/PublicData.py b/okx/PublicData.py index e191469..b3bb961 100644 --- a/okx/PublicData.py +++ b/okx/PublicData.py @@ -4,7 +4,7 @@ from .consts import * class PublicAPI(OkxClient): - 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): + 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): OkxClient.__init__(self, api_key, api_secret_key, passphrase, use_server_time, flag, domain, debug, proxy) # Get Instruments diff --git a/okx/SimpleEarnFixed.py b/okx/SimpleEarnFixed.py index 9b2fb5b..a7ff4b5 100644 --- a/okx/SimpleEarnFixed.py +++ b/okx/SimpleEarnFixed.py @@ -5,7 +5,7 @@ from okx.okxclient import OkxClient class SimpleEarnFixedAPI(OkxClient): 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): + domain='https://www.okx.com', debug=False, proxy=None): OkxClient.__init__(self, api_key, api_secret_key, passphrase, use_server_time, flag, domain, debug, proxy) def get_lending_offers(self, ccy=None, term=None): diff --git a/okx/SpreadTrading.py b/okx/SpreadTrading.py index 3404536..46b0b8b 100644 --- a/okx/SpreadTrading.py +++ b/okx/SpreadTrading.py @@ -4,7 +4,7 @@ from .consts import * class SpreadTradingAPI(OkxClient): - 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): + 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): OkxClient.__init__(self, api_key, api_secret_key, passphrase, use_server_time, flag, domain, debug, proxy) # Place Order diff --git a/okx/Status.py b/okx/Status.py index fa4230d..2304fb6 100644 --- a/okx/Status.py +++ b/okx/Status.py @@ -3,7 +3,7 @@ from .consts import * class StatusAPI(OkxClient): - 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): + 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): OkxClient.__init__(self, api_key, api_secret_key, passphrase, use_server_time, flag, domain, debug, proxy) def status(self, state=''): diff --git a/okx/SubAccount.py b/okx/SubAccount.py index 61af341..6428d3c 100644 --- a/okx/SubAccount.py +++ b/okx/SubAccount.py @@ -3,7 +3,7 @@ from .consts import * class SubAccountAPI(OkxClient): - 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): + 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): OkxClient.__init__(self, api_key, api_secret_key, passphrase, use_server_time, flag, domain, debug, proxy) def get_account_balance(self, subAcct): diff --git a/okx/Trade.py b/okx/Trade.py index 80f5fa9..23e6fd4 100644 --- a/okx/Trade.py +++ b/okx/Trade.py @@ -7,7 +7,7 @@ from .consts import * class TradeAPI(OkxClient): 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): + domain='https://www.okx.com', debug=False, proxy=None): OkxClient.__init__(self, api_key, api_secret_key, passphrase, use_server_time, flag, domain, debug, proxy) # Place Order diff --git a/okx/TradingData.py b/okx/TradingData.py index 8944b41..7100ef4 100644 --- a/okx/TradingData.py +++ b/okx/TradingData.py @@ -4,7 +4,7 @@ from .consts import * class TradingDataAPI(OkxClient): - 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): + 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): OkxClient.__init__(self, api_key, api_secret_key, passphrase, use_server_time, flag, domain, debug, proxy) diff --git a/okx/__init__.py b/okx/__init__.py index cedfd53..2ebfed6 100644 --- a/okx/__init__.py +++ b/okx/__init__.py @@ -2,4 +2,4 @@ Python SDK for the OKX API v5 """ -__version__="0.3.4" \ No newline at end of file +__version__="0.3.5" \ No newline at end of file diff --git a/okx/okxclient.py b/okx/okxclient.py index de33b74..e88e3a7 100644 --- a/okx/okxclient.py +++ b/okx/okxclient.py @@ -13,7 +13,7 @@ from . import consts as c, utils, exceptions class OkxClient(Client): - 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): + 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): super().__init__(base_url=base_api, http2=True, proxy=proxy) self.API_KEY = api_key self.API_SECRET_KEY = api_secret_key diff --git a/okx/websocket/WebSocketFactory.py b/okx/websocket/WebSocketFactory.py index 9ce1e3a..ff983e6 100644 --- a/okx/websocket/WebSocketFactory.py +++ b/okx/websocket/WebSocketFactory.py @@ -5,8 +5,7 @@ import ssl import certifi import websockets -logging.basicConfig(level=logging.INFO) -logger = logging.getLogger("WebSocketFactory") +logger = logging.getLogger(__name__) class WebSocketFactory: diff --git a/okx/websocket/WsPrivateAsync.py b/okx/websocket/WsPrivateAsync.py index 3fa7768..8c71c72 100644 --- a/okx/websocket/WsPrivateAsync.py +++ b/okx/websocket/WsPrivateAsync.py @@ -5,8 +5,7 @@ import logging from okx.websocket import WsUtils from okx.websocket.WebSocketFactory import WebSocketFactory -logging.basicConfig(level=logging.INFO) -logger = logging.getLogger("WsPrivate") +logger = logging.getLogger(__name__) class WsPrivateAsync: @@ -26,7 +25,7 @@ class WsPrivateAsync: async def consume(self): async for message in self.websocket: - logger.info("Received message: {%s}", message) + logger.debug("Received message: {%s}", message) if self.callback: self.callback(message) diff --git a/okx/websocket/WsPublicAsync.py b/okx/websocket/WsPublicAsync.py index c8dfcd7..be53679 100644 --- a/okx/websocket/WsPublicAsync.py +++ b/okx/websocket/WsPublicAsync.py @@ -4,8 +4,7 @@ import logging from okx.websocket.WebSocketFactory import WebSocketFactory -logging.basicConfig(level=logging.INFO) -logger = logging.getLogger("WsPublic") +logger = logging.getLogger(__name__) class WsPublicAsync: @@ -21,7 +20,7 @@ class WsPublicAsync: async def consume(self): async for message in self.websocket: - logger.info("Received message: {%s}", message) + logger.debug("Received message: {%s}", message) if self.callback: self.callback(message)