python-okx 0.3.4__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.
- {python_okx-0.3.4 → python_okx-0.3.5}/PKG-INFO +1 -1
- {python_okx-0.3.4 → python_okx-0.3.5}/okx/Account.py +1 -1
- {python_okx-0.3.4 → python_okx-0.3.5}/okx/BlockTrading.py +1 -1
- {python_okx-0.3.4 → python_okx-0.3.5}/okx/Convert.py +1 -1
- {python_okx-0.3.4 → python_okx-0.3.5}/okx/CopyTrading.py +1 -1
- {python_okx-0.3.4 → python_okx-0.3.5}/okx/Earning.py +1 -1
- {python_okx-0.3.4 → python_okx-0.3.5}/okx/FDBroker.py +1 -1
- {python_okx-0.3.4 → python_okx-0.3.5}/okx/Funding.py +1 -1
- {python_okx-0.3.4 → python_okx-0.3.5}/okx/Grid.py +1 -1
- {python_okx-0.3.4 → python_okx-0.3.5}/okx/MarketData.py +1 -1
- {python_okx-0.3.4 → python_okx-0.3.5}/okx/NDBroker.py +1 -1
- {python_okx-0.3.4 → python_okx-0.3.5}/okx/PublicData.py +1 -1
- {python_okx-0.3.4 → python_okx-0.3.5}/okx/SimpleEarnFixed.py +1 -1
- {python_okx-0.3.4 → python_okx-0.3.5}/okx/SpreadTrading.py +1 -1
- {python_okx-0.3.4 → python_okx-0.3.5}/okx/Status.py +1 -1
- {python_okx-0.3.4 → python_okx-0.3.5}/okx/SubAccount.py +1 -1
- {python_okx-0.3.4 → python_okx-0.3.5}/okx/Trade.py +1 -1
- {python_okx-0.3.4 → python_okx-0.3.5}/okx/TradingData.py +1 -1
- {python_okx-0.3.4 → python_okx-0.3.5}/okx/__init__.py +1 -1
- {python_okx-0.3.4 → python_okx-0.3.5}/okx/okxclient.py +1 -1
- {python_okx-0.3.4 → python_okx-0.3.5}/okx/websocket/WebSocketFactory.py +1 -2
- {python_okx-0.3.4 → python_okx-0.3.5}/okx/websocket/WsPrivateAsync.py +2 -3
- {python_okx-0.3.4 → python_okx-0.3.5}/okx/websocket/WsPublicAsync.py +2 -3
- {python_okx-0.3.4 → python_okx-0.3.5}/python_okx.egg-info/PKG-INFO +1 -1
- {python_okx-0.3.4 → python_okx-0.3.5}/README.md +0 -0
- {python_okx-0.3.4 → python_okx-0.3.5}/okx/consts.py +0 -0
- {python_okx-0.3.4 → python_okx-0.3.5}/okx/exceptions.py +0 -0
- {python_okx-0.3.4 → python_okx-0.3.5}/okx/utils.py +0 -0
- {python_okx-0.3.4 → python_okx-0.3.5}/okx/websocket/WsUtils.py +0 -0
- {python_okx-0.3.4 → python_okx-0.3.5}/okx/websocket/__init__.py +0 -0
- {python_okx-0.3.4 → python_okx-0.3.5}/python_okx.egg-info/SOURCES.txt +0 -0
- {python_okx-0.3.4 → python_okx-0.3.5}/python_okx.egg-info/dependency_links.txt +0 -0
- {python_okx-0.3.4 → python_okx-0.3.5}/python_okx.egg-info/requires.txt +0 -0
- {python_okx-0.3.4 → python_okx-0.3.5}/python_okx.egg-info/top_level.txt +0 -0
- {python_okx-0.3.4 → python_okx-0.3.5}/setup.cfg +0 -0
- {python_okx-0.3.4 → python_okx-0.3.5}/setup.py +0 -0
|
@@ -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=
|
|
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
|
|
@@ -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 =
|
|
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 =
|
|
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=
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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
|
|
@@ -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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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=
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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=
|
|
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 =
|
|
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
|
|
|
@@ -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=
|
|
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 logging
|
|
|
5
5
|
from okx.websocket import WsUtils
|
|
6
6
|
from okx.websocket.WebSocketFactory import WebSocketFactory
|
|
7
7
|
|
|
8
|
-
logging.
|
|
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.
|
|
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.
|
|
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.
|
|
23
|
+
logger.debug("Received message: {%s}", message)
|
|
25
24
|
if self.callback:
|
|
26
25
|
self.callback(message)
|
|
27
26
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|