upgrade
This commit is contained in:
parent
6cd392d1a6
commit
9313397381
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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):
|
||||
|
|
|
|||
|
|
@ -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):
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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 = ''):
|
||||
|
|
|
|||
|
|
@ -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 = ''):
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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='',
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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):
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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=''):
|
||||
|
|
|
|||
|
|
@ -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):
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -2,4 +2,4 @@
|
|||
Python SDK for the OKX API v5
|
||||
|
||||
"""
|
||||
__version__="0.3.4"
|
||||
__version__="0.3.5"
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue