python-okx 0.3.4__py3-none-any.whl → 0.3.6__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.
- okx/Account.py +8 -1
- okx/BlockTrading.py +1 -1
- okx/Convert.py +1 -1
- okx/CopyTrading.py +1 -1
- okx/FDBroker.py +1 -1
- okx/Finance/EthStaking.py +52 -0
- okx/Finance/Savings.py +62 -0
- okx/Finance/SolStaking.py +48 -0
- okx/Finance/StakingDefi.py +63 -0
- okx/Finance/__init__.py +0 -0
- okx/Funding.py +3 -3
- okx/Grid.py +1 -1
- okx/MarketData.py +1 -1
- okx/PublicData.py +1 -1
- okx/SimpleEarnFixed.py +1 -1
- okx/SpreadTrading.py +1 -1
- okx/Status.py +1 -1
- okx/SubAccount.py +1 -1
- okx/Trade.py +3 -3
- okx/TradingData.py +1 -1
- okx/__init__.py +1 -1
- okx/consts.py +12 -19
- okx/okxclient.py +1 -1
- okx/websocket/WebSocketFactory.py +1 -2
- okx/websocket/WsPrivateAsync.py +2 -3
- okx/websocket/WsPublicAsync.py +2 -3
- {python_okx-0.3.4.dist-info → python_okx-0.3.6.dist-info}/METADATA +1 -1
- python_okx-0.3.6.dist-info/RECORD +34 -0
- okx/Earning.py +0 -115
- okx/NDBroker.py +0 -150
- python_okx-0.3.4.dist-info/RECORD +0 -31
- {python_okx-0.3.4.dist-info → python_okx-0.3.6.dist-info}/WHEEL +0 -0
- {python_okx-0.3.4.dist-info → python_okx-0.3.6.dist-info}/top_level.txt +0 -0
okx/Account.py
CHANGED
|
@@ -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
|
|
@@ -217,6 +217,13 @@ class AccountAPI(OkxClient):
|
|
|
217
217
|
}
|
|
218
218
|
return self._request_with_params(POST, SET_AUTO_LOAN, params)
|
|
219
219
|
|
|
220
|
+
# - Set auto loan
|
|
221
|
+
def set_account_level(self, acctLv):
|
|
222
|
+
params = {
|
|
223
|
+
'acctLv': acctLv
|
|
224
|
+
}
|
|
225
|
+
return self._request_with_params(POST, SET_ACCOUNT_LEVEL, params)
|
|
226
|
+
|
|
220
227
|
# - Activate option
|
|
221
228
|
def activate_option(self):
|
|
222
229
|
return self._request_without_params(POST, ACTIVSTE_OPTION)
|
okx/BlockTrading.py
CHANGED
|
@@ -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):
|
okx/Convert.py
CHANGED
|
@@ -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):
|
okx/CopyTrading.py
CHANGED
|
@@ -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
|
|
okx/FDBroker.py
CHANGED
|
@@ -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 = ''):
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
from okx.okxclient import OkxClient
|
|
2
|
+
from okx.consts import *
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class EthStakingAPI(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 = False, proxy=None):
|
|
7
|
+
OkxClient.__init__(self, api_key, api_secret_key, passphrase, use_server_time, flag, domain, debug, proxy)
|
|
8
|
+
|
|
9
|
+
def eth_product_info(self):
|
|
10
|
+
|
|
11
|
+
return self._request_without_params(GET, STACK_ETH_PRODUCT_INFO)
|
|
12
|
+
|
|
13
|
+
def eth_purchase(self, amt=''):
|
|
14
|
+
|
|
15
|
+
params = {
|
|
16
|
+
'amt': amt,
|
|
17
|
+
}
|
|
18
|
+
return self._request_with_params(POST, STACK_ETH_PURCHASE, params)
|
|
19
|
+
|
|
20
|
+
def eth_redeem(self, amt=''):
|
|
21
|
+
|
|
22
|
+
params = {
|
|
23
|
+
'amt': amt,
|
|
24
|
+
}
|
|
25
|
+
return self._request_with_params(POST, STACK_ETH_REDEEM, params)
|
|
26
|
+
|
|
27
|
+
def eth_balance(self):
|
|
28
|
+
|
|
29
|
+
params = {}
|
|
30
|
+
return self._request_with_params(GET, STACK_ETH_BALANCE, params)
|
|
31
|
+
|
|
32
|
+
def eth_purchase_redeem_history(self, type='', status='', after='', before='', limit=''):
|
|
33
|
+
|
|
34
|
+
params = {}
|
|
35
|
+
if type != '':
|
|
36
|
+
params['type'] = type
|
|
37
|
+
if status != '':
|
|
38
|
+
params['status'] = status
|
|
39
|
+
if after != '':
|
|
40
|
+
params['after'] = after
|
|
41
|
+
if before != '':
|
|
42
|
+
params['before'] = before
|
|
43
|
+
if limit != '':
|
|
44
|
+
params['limit'] = limit
|
|
45
|
+
return self._request_with_params(GET, STACK_ETH_PURCHASE_REDEEM_HISTORY, params)
|
|
46
|
+
|
|
47
|
+
def eth_apy_history(self, days):
|
|
48
|
+
|
|
49
|
+
params = {
|
|
50
|
+
'days': days,
|
|
51
|
+
}
|
|
52
|
+
return self._request_with_params(GET, STACK_ETH_APY_HISTORY, params)
|
okx/Finance/Savings.py
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
from okx.okxclient import OkxClient
|
|
2
|
+
from okx.consts import *
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class SavingsAPI(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 = False, proxy=None):
|
|
7
|
+
OkxClient.__init__(self, api_key, api_secret_key, passphrase, use_server_time, flag, domain, debug, proxy)
|
|
8
|
+
|
|
9
|
+
# - Get saving balance
|
|
10
|
+
def get_saving_balance(self, ccy=''):
|
|
11
|
+
params = {
|
|
12
|
+
'ccy': ccy
|
|
13
|
+
}
|
|
14
|
+
return self._request_with_params(GET, GET_SAVING_BALANCE, params)
|
|
15
|
+
|
|
16
|
+
# - Savings purchase/redemption
|
|
17
|
+
def savings_purchase_redemption(self, ccy='', amt='', side='', rate=''):
|
|
18
|
+
|
|
19
|
+
params = {
|
|
20
|
+
'ccy': ccy,
|
|
21
|
+
'amt': amt,
|
|
22
|
+
'side': side,
|
|
23
|
+
'rate': rate
|
|
24
|
+
}
|
|
25
|
+
return self._request_with_params(POST, SAVING_PURCHASE_REDEMPTION, params)
|
|
26
|
+
|
|
27
|
+
# - Set lending rate
|
|
28
|
+
def set_lending_rate(self, ccy='', rate=''):
|
|
29
|
+
params = {
|
|
30
|
+
'ccy': ccy,
|
|
31
|
+
'rate': rate
|
|
32
|
+
}
|
|
33
|
+
return self._request_with_params(POST, SET_LENDING_RATE, params)
|
|
34
|
+
|
|
35
|
+
# - Get lending history
|
|
36
|
+
def get_lending_history(self, ccy='', after='', before='', limit=''):
|
|
37
|
+
params = {
|
|
38
|
+
'ccy': ccy,
|
|
39
|
+
'after': after,
|
|
40
|
+
'before': before,
|
|
41
|
+
'limit': limit
|
|
42
|
+
}
|
|
43
|
+
return self._request_with_params(GET, GET_LENDING_HISTORY, params)
|
|
44
|
+
|
|
45
|
+
# - Get public borrow history (public)
|
|
46
|
+
def get_public_borrow_history(self, ccy='', after='', before='', limit=''):
|
|
47
|
+
params = {
|
|
48
|
+
'ccy': ccy,
|
|
49
|
+
'after': after,
|
|
50
|
+
'before': before,
|
|
51
|
+
'limit': limit
|
|
52
|
+
}
|
|
53
|
+
return self._request_with_params(GET, GET_PUBLIC_BORROW_HISTORY, params)
|
|
54
|
+
|
|
55
|
+
# GET / Public borrow info (public)
|
|
56
|
+
def get_public_borrow_info(self, ccy=''):
|
|
57
|
+
params = {
|
|
58
|
+
'ccy': ccy
|
|
59
|
+
}
|
|
60
|
+
return self._request_with_params(GET, GET_PUBLIC_BORROW_INFO, params)
|
|
61
|
+
|
|
62
|
+
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
from okx.okxclient import OkxClient
|
|
2
|
+
from okx.consts import *
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class SolStakingAPI(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 = False, proxy=None):
|
|
7
|
+
OkxClient.__init__(self, api_key, api_secret_key, passphrase, use_server_time, flag, domain, debug, proxy)
|
|
8
|
+
|
|
9
|
+
def sol_purchase(self, amt):
|
|
10
|
+
|
|
11
|
+
params = {
|
|
12
|
+
'amt': amt,
|
|
13
|
+
}
|
|
14
|
+
return self._request_with_params(POST, STACK_SOL_PURCHASE, params)
|
|
15
|
+
|
|
16
|
+
def sol_redeem(self, amt=''):
|
|
17
|
+
|
|
18
|
+
params = {
|
|
19
|
+
'amt': amt,
|
|
20
|
+
}
|
|
21
|
+
return self._request_with_params(POST, STACK_SOL_REDEEM, params)
|
|
22
|
+
|
|
23
|
+
def sol_balance(self):
|
|
24
|
+
|
|
25
|
+
params = {}
|
|
26
|
+
return self._request_with_params(GET, STACK_SOL_BALANCE, params)
|
|
27
|
+
|
|
28
|
+
def sol_purchase_redeem_history(self, type='', status='', after='', before='', limit=''):
|
|
29
|
+
|
|
30
|
+
params = {}
|
|
31
|
+
if type != '':
|
|
32
|
+
params['type'] = type
|
|
33
|
+
if status != '':
|
|
34
|
+
params['status'] = status
|
|
35
|
+
if after != '':
|
|
36
|
+
params['after'] = after
|
|
37
|
+
if before != '':
|
|
38
|
+
params['before'] = before
|
|
39
|
+
if limit != '':
|
|
40
|
+
params['limit'] = limit
|
|
41
|
+
return self._request_with_params(GET, STACK_SOL_PURCHASE_REDEEM_HISTORY, params)
|
|
42
|
+
|
|
43
|
+
def sol_apy_history(self, days):
|
|
44
|
+
|
|
45
|
+
params = {
|
|
46
|
+
'days': days,
|
|
47
|
+
}
|
|
48
|
+
return self._request_with_params(GET, STACK_SOL_APY_HISTORY, params)
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
from okx.okxclient import OkxClient
|
|
2
|
+
from okx.consts import *
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class StakingDefiAPI(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 = False, proxy=None):
|
|
7
|
+
OkxClient.__init__(self, api_key, api_secret_key, passphrase, use_server_time, flag, domain, debug, proxy)
|
|
8
|
+
|
|
9
|
+
def get_offers(self, productId='', protocolType='', ccy=''):
|
|
10
|
+
params = {
|
|
11
|
+
'productId': productId,
|
|
12
|
+
'protocolType': protocolType,
|
|
13
|
+
'ccy': ccy
|
|
14
|
+
}
|
|
15
|
+
return self._request_with_params(GET, STACK_DEFI_OFFERS, params)
|
|
16
|
+
|
|
17
|
+
def purchase(self, productId='', investData=[], term='', tag=''):
|
|
18
|
+
|
|
19
|
+
params = {
|
|
20
|
+
'productId': productId,
|
|
21
|
+
'investData': investData
|
|
22
|
+
}
|
|
23
|
+
if term != '':
|
|
24
|
+
params['term'] = term
|
|
25
|
+
if tag != '':
|
|
26
|
+
params['tag'] = tag
|
|
27
|
+
return self._request_with_params(POST, STACK_DEFI_PURCHASE, params)
|
|
28
|
+
|
|
29
|
+
def redeem(self, ordId='', protocolType='', allowEarlyRedeem=''):
|
|
30
|
+
params = {
|
|
31
|
+
'ordId': ordId,
|
|
32
|
+
'protocolType': protocolType,
|
|
33
|
+
'allowEarlyRedeem': allowEarlyRedeem
|
|
34
|
+
}
|
|
35
|
+
return self._request_with_params(POST, STACK_DEFI_REDEEM, params)
|
|
36
|
+
|
|
37
|
+
def cancel(self, ordId='', protocolType=''):
|
|
38
|
+
params = {
|
|
39
|
+
'ordId': ordId,
|
|
40
|
+
'protocolType': protocolType
|
|
41
|
+
}
|
|
42
|
+
return self._request_with_params(POST, STACK_DEFI_CANCEL, params)
|
|
43
|
+
|
|
44
|
+
def get_activity_orders(self, productId='', protocolType='', ccy='', state=''):
|
|
45
|
+
params = {
|
|
46
|
+
'productId': productId,
|
|
47
|
+
'protocolType': protocolType,
|
|
48
|
+
'ccy': ccy,
|
|
49
|
+
'state': state
|
|
50
|
+
}
|
|
51
|
+
return self._request_with_params(GET, STACK_DEFI_ORDERS_ACTIVITY, params)
|
|
52
|
+
|
|
53
|
+
def get_orders_history(self, productId='', protocolType='', ccy='', after='', before='', limit=''):
|
|
54
|
+
params = {
|
|
55
|
+
'productId': productId,
|
|
56
|
+
'protocolType': protocolType,
|
|
57
|
+
'ccy': ccy,
|
|
58
|
+
'after': after,
|
|
59
|
+
'before': before,
|
|
60
|
+
'limit': limit
|
|
61
|
+
}
|
|
62
|
+
return self._request_with_params(GET, STACK_DEFI_ORDERS_HISTORY, params)
|
|
63
|
+
|
okx/Finance/__init__.py
ADDED
|
File without changes
|
okx/Funding.py
CHANGED
|
@@ -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
|
|
@@ -41,8 +41,8 @@ class FundingAPI(OkxClient):
|
|
|
41
41
|
return self._request_with_params(POST, WITHDRAWAL_COIN, params)
|
|
42
42
|
|
|
43
43
|
# Get Deposit History
|
|
44
|
-
def get_deposit_history(self, ccy='', state='', after='', before='', limit='', txId='', depId='', fromWdId=''):
|
|
45
|
-
params = {'ccy': ccy, 'state': state, 'after': after, 'before': before, 'limit': limit, 'txId': txId,
|
|
44
|
+
def get_deposit_history(self, ccy='', type='', state='', after='', before='', limit='', txId='', depId='', fromWdId=''):
|
|
45
|
+
params = {'ccy': ccy, 'type': type, 'state': state, 'after': after, 'before': before, 'limit': limit, 'txId': txId,
|
|
46
46
|
'depId': depId, 'fromWdId': fromWdId}
|
|
47
47
|
return self._request_with_params(GET, DEPOSIT_HISTORY, params)
|
|
48
48
|
|
okx/Grid.py
CHANGED
|
@@ -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='',
|
okx/MarketData.py
CHANGED
|
@@ -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
|
|
okx/PublicData.py
CHANGED
|
@@ -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
|
okx/SimpleEarnFixed.py
CHANGED
|
@@ -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):
|
okx/SpreadTrading.py
CHANGED
|
@@ -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
|
okx/Status.py
CHANGED
|
@@ -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=''):
|
okx/SubAccount.py
CHANGED
|
@@ -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):
|
okx/Trade.py
CHANGED
|
@@ -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
|
|
@@ -39,11 +39,11 @@ class TradeAPI(OkxClient):
|
|
|
39
39
|
# Amend Order
|
|
40
40
|
def amend_order(self, instId, cxlOnFail='', ordId='', clOrdId='', reqId='', newSz='', newPx='', newTpTriggerPx='',
|
|
41
41
|
newTpOrdPx='', newSlTriggerPx='', newSlOrdPx='', newTpTriggerPxType='', newSlTriggerPxType='',
|
|
42
|
-
attachAlgoOrds=''):
|
|
42
|
+
attachAlgoOrds='', newTriggerPx='', newOrdPx=''):
|
|
43
43
|
params = {'instId': instId, 'cxlOnFail': cxlOnFail, 'ordId': ordId, 'clOrdId': clOrdId, 'reqId': reqId,
|
|
44
44
|
'newSz': newSz, 'newPx': newPx, 'newTpTriggerPx': newTpTriggerPx, 'newTpOrdPx': newTpOrdPx,
|
|
45
45
|
'newSlTriggerPx': newSlTriggerPx, 'newSlOrdPx': newSlOrdPx, 'newTpTriggerPxType': newTpTriggerPxType,
|
|
46
|
-
'newSlTriggerPxType': newSlTriggerPxType}
|
|
46
|
+
'newSlTriggerPxType': newSlTriggerPxType, 'newTriggerPx': newTriggerPx, 'newOrdPx': newOrdPx}
|
|
47
47
|
params['attachAlgoOrds'] = attachAlgoOrds
|
|
48
48
|
return self._request_with_params(POST, AMEND_ORDER, params)
|
|
49
49
|
|
okx/TradingData.py
CHANGED
|
@@ -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
|
|
okx/__init__.py
CHANGED
okx/consts.py
CHANGED
|
@@ -52,6 +52,7 @@ GET_VIP_LOAN_ORDER_LIST= '/api/v5/account/vip-loan-order-list'
|
|
|
52
52
|
GET_VIP_LOAN_ORDER_DETAIL= '/api/v5/account/vip-loan-order-detail'
|
|
53
53
|
SET_RISK_OFFSET_TYPE = '/api/v5/account/set-riskOffset-type'
|
|
54
54
|
SET_AUTO_LOAN = '/api/v5/account/set-auto-loan'
|
|
55
|
+
SET_ACCOUNT_LEVEL = '/api/v5/account/set-account-level'
|
|
55
56
|
ACTIVSTE_OPTION = '/api/v5/account/activate-option'
|
|
56
57
|
POSITION_BUILDER = '/api/v5/account/position-builder'
|
|
57
58
|
GET_INSTRUMENTS = '/api/v5/account/instruments'
|
|
@@ -191,25 +192,6 @@ GET_THE_USER_AFFILIATE_REBATE = '/api/v5/users/partner/if-rebate'
|
|
|
191
192
|
SET_SUB_ACCOUNTS_VIP_LOAN = '/api/v5/account/subaccount/set-loan-allocation'
|
|
192
193
|
GET_SUB_ACCOUNT_BORROW_INTEREST_AND_LIMIT = '/api/v5/account/subaccount/interest-limits'
|
|
193
194
|
|
|
194
|
-
# Broker-all need to implmented-completed
|
|
195
|
-
BROKER_INFO = '/api/v5/broker/nd/info'
|
|
196
|
-
CREATE_SUBACCOUNT = '/api/v5/broker/nd/create-subaccount'
|
|
197
|
-
DELETE_SUBACCOUNT = '/api/v5/broker/nd/delete-subaccount'
|
|
198
|
-
SUBACCOUNT_INFO = '/api/v5/broker/nd/subaccount-info'
|
|
199
|
-
SET_SUBACCOUNT_LEVEL = '/api/v5/broker/nd/set-subaccount-level'
|
|
200
|
-
SET_SUBACCOUNT_FEE_REAT = '/api/v5/broker/nd/set-subaccount-fee-rate'
|
|
201
|
-
SUBACCOUNT_DEPOSIT_ADDRESS = '/api/v5/asset/broker/nd/subaccount-deposit-address'
|
|
202
|
-
SUBACCOUNT_DEPOSIT_HISTORY = '/api/v5/asset/broker/nd/subaccount-deposit-history'
|
|
203
|
-
REBATE_DAILY = '/api/v5/broker/nd/rebate-daily'
|
|
204
|
-
ND_CREAET_APIKEY = '/api/v5/broker/nd/subaccount/apikey'
|
|
205
|
-
ND_SELECT_APIKEY = '/api/v5/broker/nd/subaccount/apikey'
|
|
206
|
-
ND_MODIFY_APIKEY = '/api/v5/broker/nd/subaccount/modify-apikey'
|
|
207
|
-
ND_DELETE_APIKEY = '/api/v5/broker/nd/subaccount/delete-apikey'
|
|
208
|
-
GET_REBATE_PER_ORDERS = '/api/v5/broker/nd/rebate-per-orders'
|
|
209
|
-
REBATE_PER_ORDERS = '/api/v5/broker/nd/rebate-per-orders'
|
|
210
|
-
MODIFY_SUBACCOUNT_DEPOSIT_ADDRESS = '/api/v5/asset/broker/nd/modify-subaccount-deposit-address'
|
|
211
|
-
GET_SUBACCOUNT_DEPOSIT='/api/v5/asset/broker/nd/subaccount-deposit-address'
|
|
212
|
-
|
|
213
195
|
# Convert-Complete
|
|
214
196
|
GET_CURRENCIES = '/api/v5/asset/convert/currencies'
|
|
215
197
|
GET_CURRENCY_PAIR = '/api/v5/asset/convert/currency-pair'
|
|
@@ -275,6 +257,17 @@ SET_LENDING_RATE = '/api/v5/finance/savings/set-lending-rate'
|
|
|
275
257
|
GET_LENDING_HISTORY = '/api/v5/finance/savings/lending-history'
|
|
276
258
|
GET_PUBLIC_BORROW_INFO = '/api/v5/finance/savings/lending-rate-summary'
|
|
277
259
|
GET_PUBLIC_BORROW_HISTORY = '/api/v5/finance/savings/lending-rate-history'
|
|
260
|
+
STACK_ETH_PRODUCT_INFO = '/api/v5/finance/staking-defi/eth/product-info'
|
|
261
|
+
STACK_ETH_PURCHASE = '/api/v5/finance/staking-defi/eth/purchase'
|
|
262
|
+
STACK_ETH_REDEEM = '/api/v5/finance/staking-defi/eth/redeem'
|
|
263
|
+
STACK_ETH_BALANCE = '/api/v5/finance/staking-defi/eth/balance'
|
|
264
|
+
STACK_ETH_PURCHASE_REDEEM_HISTORY = '/api/v5/finance/staking-defi/eth/purchase-redeem-history'
|
|
265
|
+
STACK_ETH_APY_HISTORY = '/api/v5/finance/staking-defi/eth/apy-history'
|
|
266
|
+
STACK_SOL_PURCHASE = '/api/v5/finance/staking-defi/sol/purchase'
|
|
267
|
+
STACK_SOL_REDEEM = '/api/v5/finance/staking-defi/sol/redeem'
|
|
268
|
+
STACK_SOL_BALANCE = '/api/v5/finance/staking-defi/sol/balance'
|
|
269
|
+
STACK_SOL_PURCHASE_REDEEM_HISTORY = '/api/v5/finance/staking-defi/sol/purchase-redeem-history'
|
|
270
|
+
STACK_SOL_APY_HISTORY = '/api/v5/finance/staking-defi/sol/apy-history'
|
|
278
271
|
|
|
279
272
|
# status-complete
|
|
280
273
|
STATUS = '/api/v5/system/status'
|
okx/okxclient.py
CHANGED
|
@@ -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
|
okx/websocket/WsPrivateAsync.py
CHANGED
|
@@ -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
|
|
okx/websocket/WsPublicAsync.py
CHANGED
|
@@ -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
|
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
okx/Account.py,sha256=7hMU6Bt-5ogC-FUGAyiPDLsvQQsB8Tvm7K8AZdnSzaE,14080
|
|
2
|
+
okx/BlockTrading.py,sha256=A4OcuLuEHucAIhc8doPGr2o6dsCjVbv-a6YiTlzwdEw,4128
|
|
3
|
+
okx/Convert.py,sha256=xEB2pwEUpc-k23hA3mYIe3EKB5szIXlEe96JFiRSPpc,1575
|
|
4
|
+
okx/CopyTrading.py,sha256=Mso5GE9UQTJVrL4V3jIyU1QWBtzr-m32edrGDoRHk84,2751
|
|
5
|
+
okx/FDBroker.py,sha256=nUpcR_XtUcKa1Jk_B1OUZCjiv9ifQnxGRsLNHDxdGno,788
|
|
6
|
+
okx/Funding.py,sha256=7LqfuqIXm_fP4Drd8IyCmx_x0RX1KfuwMLoIUlqQrv8,6284
|
|
7
|
+
okx/Grid.py,sha256=r8cZidY2okqrb-zpyTsFJrecPzw2s25ySH3tOBDnDtA,6691
|
|
8
|
+
okx/MarketData.py,sha256=n9AgxmFyr4GoDQjxkKdryInDhnYfGcxeBrWZSMHu8kI,4928
|
|
9
|
+
okx/PublicData.py,sha256=HEq4cNCk5P1mhLaMewJhVJTvHm0I2bdrL8Z6pH3yYn0,5136
|
|
10
|
+
okx/SimpleEarnFixed.py,sha256=DKROSJV_WTlHalCY0BoBG4euruBVKUn-2xTIu9XYCWE,3435
|
|
11
|
+
okx/SpreadTrading.py,sha256=Dy7VZ8WK4HyxhMvLY1G5RukRHI_T3d0fnrHZifv9Uyw,3227
|
|
12
|
+
okx/Status.py,sha256=hGnn-tw302xXCDWly7LssaG3-29HcHZRhrBFUuGrSS0,495
|
|
13
|
+
okx/SubAccount.py,sha256=SMMPdkatDyRE0_7mDqK8orzt29hti2TTTWNayLT3F0g,3528
|
|
14
|
+
okx/Trade.py,sha256=jn06cUm3LkFvksn3O8WuiQH7t7npkEf30Z8CFsFMcKI,10921
|
|
15
|
+
okx/TradingData.py,sha256=ig9Y3f-CH_nyBvoZCF4M9z2_wQXF-r0On7p9EMMuDMo,2331
|
|
16
|
+
okx/__init__.py,sha256=4wN5G40NuTJe6tNwmnwQoT0Ilf_vNFcpR208BwoBPJs,58
|
|
17
|
+
okx/consts.py,sha256=BmkSlLGhiwgCXQO_xIeQ1e6QbP0UO_jumQvMXyIxRAs,15301
|
|
18
|
+
okx/exceptions.py,sha256=ERuCnvnudJNBNACh3LNE3km5GJy0BGC5C3OKjgHXFaU,1182
|
|
19
|
+
okx/okxclient.py,sha256=wJD8gTyHs92WjLffANbWLCgfX4Mnxh-IKnnJ2nUYHsI,2597
|
|
20
|
+
okx/utils.py,sha256=FTXSW73yXV6Hc4-9O22WFmkhayASYo7WQHIc_bTyc6g,1858
|
|
21
|
+
okx/Finance/EthStaking.py,sha256=hOl_i4VOBjejeyBboG1-37rhVnlSoOZ44e-Jzger-bQ,1612
|
|
22
|
+
okx/Finance/Savings.py,sha256=qZbv-KzgGt_me8RZePDSUiRCI1mbz692EK2ZhfYiH8c,1999
|
|
23
|
+
okx/Finance/SolStaking.py,sha256=XuGFFonpRpMQkrhNlpyOb644EApb3joQ74PRabN0PTs,1502
|
|
24
|
+
okx/Finance/StakingDefi.py,sha256=eWyAAmMDht4B4N5VWf3bj3FxSBETMXaay-Luu4GN3ls,2250
|
|
25
|
+
okx/Finance/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
26
|
+
okx/websocket/WebSocketFactory.py,sha256=ba0ZNUggghZ_YlWYB7g8UCv6MewqVr9wn75YOtIU5kE,845
|
|
27
|
+
okx/websocket/WsPrivateAsync.py,sha256=zmZuInowW9_YWpQoZoicbbff-UwWvWxOluKclomNcXA,2240
|
|
28
|
+
okx/websocket/WsPublicAsync.py,sha256=yDk_2jkgM4M_sq6zSL6i-KfdoSOaSd5KsmA1wqbIx3E,1520
|
|
29
|
+
okx/websocket/WsUtils.py,sha256=ynkCtfvkrwBUiCi-_yqp1xTn3hhVd_o5ITIhD1xLdBo,2199
|
|
30
|
+
okx/websocket/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
31
|
+
python_okx-0.3.6.dist-info/METADATA,sha256=4T8s6gigyq0tHZN-KBTU6qlOSjbNA5Zjw8UUZF9Ri08,3145
|
|
32
|
+
python_okx-0.3.6.dist-info/WHEEL,sha256=OVMc5UfuAQiSplgO0_WdW7vXVGAt9Hdd6qtN4HotdyA,91
|
|
33
|
+
python_okx-0.3.6.dist-info/top_level.txt,sha256=rrbhHZwiw4YlhG1LWWaAODvRxyZr3onxFnqwsHdikDc,4
|
|
34
|
+
python_okx-0.3.6.dist-info/RECORD,,
|
okx/Earning.py
DELETED
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
from .okxclient import OkxClient
|
|
2
|
-
from .consts import *
|
|
3
|
-
|
|
4
|
-
|
|
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):
|
|
7
|
-
OkxClient.__init__(self, api_key, api_secret_key, passphrase, use_server_time, flag, domain, debug, proxy)
|
|
8
|
-
|
|
9
|
-
def get_offers(self,productId = '',protocolType = '',ccy = ''):
|
|
10
|
-
params = {
|
|
11
|
-
'productId':productId,
|
|
12
|
-
'protocolType':protocolType,
|
|
13
|
-
'ccy':ccy
|
|
14
|
-
}
|
|
15
|
-
return self._request_with_params(GET,STACK_DEFI_OFFERS,params)
|
|
16
|
-
|
|
17
|
-
def purchase(self, productId='', investData=[], term='', tag=''):
|
|
18
|
-
|
|
19
|
-
params = {
|
|
20
|
-
'productId': productId,
|
|
21
|
-
'investData': investData
|
|
22
|
-
}
|
|
23
|
-
if term != '':
|
|
24
|
-
params['term'] = term
|
|
25
|
-
if tag != '':
|
|
26
|
-
params['tag'] = tag
|
|
27
|
-
return self._request_with_params(POST, STACK_DEFI_PURCHASE, params)
|
|
28
|
-
|
|
29
|
-
def redeem(self,ordId = '',protocolType = '',allowEarlyRedeem = ''):
|
|
30
|
-
params = {
|
|
31
|
-
'ordId':ordId,
|
|
32
|
-
'protocolType':protocolType,
|
|
33
|
-
'allowEarlyRedeem':allowEarlyRedeem
|
|
34
|
-
}
|
|
35
|
-
return self._request_with_params(POST,STACK_DEFI_REDEEM,params)
|
|
36
|
-
|
|
37
|
-
def cancel(self,ordId = '',protocolType = ''):
|
|
38
|
-
params = {
|
|
39
|
-
'ordId':ordId,
|
|
40
|
-
'protocolType':protocolType
|
|
41
|
-
}
|
|
42
|
-
return self._request_with_params(POST,STACK_DEFI_CANCEL,params)
|
|
43
|
-
|
|
44
|
-
def get_activity_orders(self,productId = '',protocolType = '',ccy = '',state = ''):
|
|
45
|
-
params = {
|
|
46
|
-
'productId':productId,
|
|
47
|
-
'protocolType':protocolType,
|
|
48
|
-
'ccy':ccy,
|
|
49
|
-
'state':state
|
|
50
|
-
}
|
|
51
|
-
return self._request_with_params(GET,STACK_DEFI_ORDERS_ACTIVITY,params)
|
|
52
|
-
|
|
53
|
-
def get_orders_history(self,productId = '',protocolType = '',ccy = '',after = '',before = '',limit = ''):
|
|
54
|
-
params = {
|
|
55
|
-
'productId':productId,
|
|
56
|
-
'protocolType':protocolType,
|
|
57
|
-
'ccy':ccy,
|
|
58
|
-
'after':after,
|
|
59
|
-
'before':before,
|
|
60
|
-
'limit':limit
|
|
61
|
-
}
|
|
62
|
-
return self._request_with_params(GET,STACK_DEFI_ORDERS_HISTORY,params)
|
|
63
|
-
|
|
64
|
-
# - Get saving balance
|
|
65
|
-
def get_saving_balance(self, ccy=''):
|
|
66
|
-
params = {
|
|
67
|
-
'ccy': ccy
|
|
68
|
-
}
|
|
69
|
-
return self._request_with_params(GET, GET_SAVING_BALANCE, params)
|
|
70
|
-
|
|
71
|
-
# - Savings purchase/redemption
|
|
72
|
-
def savings_purchase_redemption(self, ccy='', amt='', side='', rate=''):
|
|
73
|
-
|
|
74
|
-
params = {
|
|
75
|
-
'ccy': ccy,
|
|
76
|
-
'amt': amt,
|
|
77
|
-
'side': side,
|
|
78
|
-
'rate': rate
|
|
79
|
-
}
|
|
80
|
-
return self._request_with_params(POST, SAVING_PURCHASE_REDEMPTION, params)
|
|
81
|
-
|
|
82
|
-
# - Set lending rate
|
|
83
|
-
def set_lending_rate(self, ccy='', rate=''):
|
|
84
|
-
params = {
|
|
85
|
-
'ccy': ccy,
|
|
86
|
-
'rate': rate
|
|
87
|
-
}
|
|
88
|
-
return self._request_with_params(POST, SET_LENDING_RATE, params)
|
|
89
|
-
|
|
90
|
-
# - Get lending history
|
|
91
|
-
def get_lending_history(self, ccy='', after='', before='', limit=''):
|
|
92
|
-
params = {
|
|
93
|
-
'ccy': ccy,
|
|
94
|
-
'after': after,
|
|
95
|
-
'before': before,
|
|
96
|
-
'limit': limit
|
|
97
|
-
}
|
|
98
|
-
return self._request_with_params(GET, GET_LENDING_HISTORY, params)
|
|
99
|
-
|
|
100
|
-
# - Get public borrow info (public)
|
|
101
|
-
def get_public_borrow_info(self, ccy=''):
|
|
102
|
-
params = {
|
|
103
|
-
'ccy': ccy
|
|
104
|
-
}
|
|
105
|
-
return self._request_with_params(GET, GET_PUBLIC_BORROW_INFO, params)
|
|
106
|
-
|
|
107
|
-
# - Get public borrow history (public)
|
|
108
|
-
def get_public_borrow_history(self, ccy='', after='', before='', limit=''):
|
|
109
|
-
params = {
|
|
110
|
-
'ccy': ccy,
|
|
111
|
-
'after': after,
|
|
112
|
-
'before': before,
|
|
113
|
-
'limit': limit
|
|
114
|
-
}
|
|
115
|
-
return self._request_with_params(GET, GET_PUBLIC_BORROW_HISTORY, params)
|
okx/NDBroker.py
DELETED
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
from .okxclient import OkxClient
|
|
2
|
-
from .consts import *
|
|
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):
|
|
5
|
-
OkxClient.__init__(self, api_key, api_secret_key, passphrase, use_server_time, flag, domain, debug, proxy)
|
|
6
|
-
|
|
7
|
-
#GET /api/v5/broker/nd/info
|
|
8
|
-
def get_broker_info(self):
|
|
9
|
-
return self._request_without_params(GET, BROKER_INFO)
|
|
10
|
-
|
|
11
|
-
#POST /api/v5/broker/nd/create-subaccount
|
|
12
|
-
def create_subaccount(self,subAcct = '',label = ''):
|
|
13
|
-
params = {
|
|
14
|
-
'subAcct':subAcct,
|
|
15
|
-
'label':label
|
|
16
|
-
}
|
|
17
|
-
return self._request_with_params(POST,CREATE_SUBACCOUNT,params)
|
|
18
|
-
|
|
19
|
-
def delete_subaccount(self,subAcct = ''):
|
|
20
|
-
params = {
|
|
21
|
-
'subAcct':subAcct
|
|
22
|
-
}
|
|
23
|
-
return self._request_with_params(POST,DELETE_SUBACCOUNT,params)
|
|
24
|
-
|
|
25
|
-
def get_subaccount_info(self,subAcct = '',page = '',limit = ''):
|
|
26
|
-
params = {
|
|
27
|
-
'subAcct':subAcct,
|
|
28
|
-
'page':page,
|
|
29
|
-
'limit':limit
|
|
30
|
-
}
|
|
31
|
-
return self._request_with_params(GET,SUBACCOUNT_INFO,params)
|
|
32
|
-
|
|
33
|
-
def create_subaccount_apikey(self,subAcct = '',label='',passphrase='',ip='',perm=''):
|
|
34
|
-
params = {
|
|
35
|
-
'subAcct':subAcct,
|
|
36
|
-
'label':label,
|
|
37
|
-
'passphrase':passphrase,
|
|
38
|
-
'ip':ip,
|
|
39
|
-
'perm':perm
|
|
40
|
-
}
|
|
41
|
-
return self._request_with_params(POST,ND_CREAET_APIKEY,params)
|
|
42
|
-
|
|
43
|
-
def get_subaccount_apikey(self,subAcct = '',apiKey = ''):
|
|
44
|
-
params = {
|
|
45
|
-
'subAcct':subAcct,
|
|
46
|
-
'apiKey':apiKey
|
|
47
|
-
}
|
|
48
|
-
return self._request_with_params(GET,ND_SELECT_APIKEY,params)
|
|
49
|
-
|
|
50
|
-
def reset_subaccount_apikey(self,subAcct = '',apiKey = '',label='',perm = '',ip = ''):
|
|
51
|
-
params = {
|
|
52
|
-
'subAcct':subAcct,
|
|
53
|
-
'apiKey':apiKey,
|
|
54
|
-
'label':label,
|
|
55
|
-
'perm':perm,
|
|
56
|
-
'ip':ip
|
|
57
|
-
}
|
|
58
|
-
return self._request_with_params(POST,ND_MODIFY_APIKEY,params)
|
|
59
|
-
|
|
60
|
-
def delete_subaccount_apikey(self,subAcct = '',apiKey = ''):
|
|
61
|
-
params = {
|
|
62
|
-
'subAcct':subAcct,
|
|
63
|
-
'apiKey':apiKey
|
|
64
|
-
}
|
|
65
|
-
return self._request_with_params(POST,ND_DELETE_APIKEY,params)
|
|
66
|
-
|
|
67
|
-
def set_subaccount_level(self,subAcct = '',acctLv = ''):
|
|
68
|
-
params = {
|
|
69
|
-
'subAcct':subAcct,
|
|
70
|
-
'acctLv':acctLv
|
|
71
|
-
}
|
|
72
|
-
return self._request_with_params(POST,SET_SUBACCOUNT_LEVEL,params)
|
|
73
|
-
|
|
74
|
-
def set_subaccount_fee_rate(self,subAcct = '',instType = '',chgType = '',chgTaker = '',chgMaker = '',effDate = ''):
|
|
75
|
-
params = {
|
|
76
|
-
'subAcct':subAcct,
|
|
77
|
-
'instType':instType,
|
|
78
|
-
'chgType':chgType,
|
|
79
|
-
'chgTaker':chgTaker,
|
|
80
|
-
'chgMaker':chgMaker,
|
|
81
|
-
'effDate':effDate
|
|
82
|
-
}
|
|
83
|
-
return self._request_with_params(POST,SET_SUBACCOUNT_FEE_REAT,params)
|
|
84
|
-
|
|
85
|
-
def create_subaccount_deposit_address(self,subAcct = '',ccy = '',chain = '',addrType = '', to =''):
|
|
86
|
-
params = {
|
|
87
|
-
'subAcct':subAcct,
|
|
88
|
-
'ccy':ccy,
|
|
89
|
-
'chain':chain,
|
|
90
|
-
'addrType':addrType,
|
|
91
|
-
'to':to
|
|
92
|
-
}
|
|
93
|
-
return self._request_with_params(POST,SUBACCOUNT_DEPOSIT_ADDRESS,params)
|
|
94
|
-
|
|
95
|
-
def reset_subaccount_deposit_address(self,subAcct = '',ccy = '',chain = '',addr = '',to = ''):
|
|
96
|
-
params = {
|
|
97
|
-
'subAcct':subAcct,
|
|
98
|
-
'ccy':ccy,
|
|
99
|
-
'chain':chain,
|
|
100
|
-
'addr':addr,
|
|
101
|
-
'to':to
|
|
102
|
-
}
|
|
103
|
-
return self._request_with_params(POST,MODIFY_SUBACCOUNT_DEPOSIT_ADDRESS,params)
|
|
104
|
-
|
|
105
|
-
def get_subaccount_deposit_address(self,subAcct = '',ccy = ''):
|
|
106
|
-
params = {
|
|
107
|
-
'subAcct':subAcct,
|
|
108
|
-
'ccy':ccy
|
|
109
|
-
}
|
|
110
|
-
return self._request_with_params(GET,GET_SUBACCOUNT_DEPOSIT,params)
|
|
111
|
-
|
|
112
|
-
def get_subaccount_deposit_history(self,subAcct = '',ccy = '',txId = '',state = '',after = '',before = '',limit = ''):
|
|
113
|
-
params = {
|
|
114
|
-
'subAcct':subAcct,
|
|
115
|
-
'ccy':ccy,
|
|
116
|
-
'txId':txId,
|
|
117
|
-
'state':state,
|
|
118
|
-
'after':after,
|
|
119
|
-
'before':before,
|
|
120
|
-
'limit':limit
|
|
121
|
-
}
|
|
122
|
-
return self._request_with_params(GET,SUBACCOUNT_DEPOSIT_HISTORY,params)
|
|
123
|
-
|
|
124
|
-
def get_rebate_daily(self,subAcct = '',begin = '',end = '',page = '',limit = ''):
|
|
125
|
-
params = {
|
|
126
|
-
'subAcct':subAcct,
|
|
127
|
-
'begin':begin,
|
|
128
|
-
'end':end,
|
|
129
|
-
'page':page,
|
|
130
|
-
'limit':limit
|
|
131
|
-
}
|
|
132
|
-
return self._request_with_params(GET,REBATE_DAILY,params)
|
|
133
|
-
|
|
134
|
-
def get_rebate_details_download_link(self,type ='',begin = '',end = ''):
|
|
135
|
-
params ={
|
|
136
|
-
'type':type,
|
|
137
|
-
'begin':begin,
|
|
138
|
-
'end':end
|
|
139
|
-
}
|
|
140
|
-
return self._request_with_params(GET,GET_REBATE_PER_ORDERS,params)
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
def generate_rebate_details_download_link(self,begin = '',end = ''):
|
|
145
|
-
params = {
|
|
146
|
-
'begin':begin,
|
|
147
|
-
'end':end
|
|
148
|
-
}
|
|
149
|
-
return self._request_with_params(POST,REBATE_PER_ORDERS,params)
|
|
150
|
-
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
okx/Account.py,sha256=zScfpbfld0iq65QtWI5yeeYhWAK3wFJlo_2pTZ9tJLo,13883
|
|
2
|
-
okx/BlockTrading.py,sha256=LC44PIxd5-S2coHxCmYjG7WqAuwrMdfO644eui2Ixvc,4127
|
|
3
|
-
okx/Convert.py,sha256=StJqUTODvycEtPyBmvl2Cao7ElzGWQW-95vREkvkhPo,1574
|
|
4
|
-
okx/CopyTrading.py,sha256=6vrJFKqzRhRf5t279XsLNamdo06-L1ORjlX60nMwgw8,2750
|
|
5
|
-
okx/Earning.py,sha256=_H7_a466naKaEt3-SD_ZUbi-swnm8VwYZ357xF4q2rM,3852
|
|
6
|
-
okx/FDBroker.py,sha256=7nEWawZ3sVHRT-9beZ95KADtXf2eyNsL91Wchr7kLtQ,787
|
|
7
|
-
okx/Funding.py,sha256=gjXqMMfbnexuYckDaspMRulAlG35aowliOj7NmxseUQ,6260
|
|
8
|
-
okx/Grid.py,sha256=EYTZwf5-pWN75kdiukOfkEp20R2kttxj8d5HPNsdwWE,6690
|
|
9
|
-
okx/MarketData.py,sha256=TsVXdH-wOUZQMQPG70BTIiaBhWG-dknwNbVJHjFgpFE,4927
|
|
10
|
-
okx/NDBroker.py,sha256=u-PDdCePOEJowLCB5GyJXRQXsiTG1tWUznQX5qngkaQ,5062
|
|
11
|
-
okx/PublicData.py,sha256=hNKowBqf4CEmB6-b0owKs4_nnGGVCQLOgaJb1YaimuI,5135
|
|
12
|
-
okx/SimpleEarnFixed.py,sha256=ToT2bCDRJ3HPdvmGjPVEBy0B-ah0YhEdFknOycFGT7U,3434
|
|
13
|
-
okx/SpreadTrading.py,sha256=V_TgEkGaD6Pce1VJmUB7fdiw16BzoUSdBeVxo7mfSmU,3226
|
|
14
|
-
okx/Status.py,sha256=Nm2qRviE-40AVo_ndDtPludvObnWZ1OqP7qRZokTYuw,494
|
|
15
|
-
okx/SubAccount.py,sha256=z8ZBVIHu4XW4bqTj97sifBiodgxbVgXOQ2Ndf2KycSo,3527
|
|
16
|
-
okx/Trade.py,sha256=T1HQB9-Wo5MWlhrPahGub9hBXzQDe9QkkSShMpvyYIo,10838
|
|
17
|
-
okx/TradingData.py,sha256=SMc5C3sQk5rwn08AsDDcbN6zQm_wy4S2JO0jQHAKVhU,2330
|
|
18
|
-
okx/__init__.py,sha256=kTsebx0VGpzwNou5pyQXFzIDG-R383qlUQ_qH1lyLXQ,58
|
|
19
|
-
okx/consts.py,sha256=h94U14Pw_wxSOe5Aej5hHYH4fYitCSi4a5p8c7_f2ew,15594
|
|
20
|
-
okx/exceptions.py,sha256=ERuCnvnudJNBNACh3LNE3km5GJy0BGC5C3OKjgHXFaU,1182
|
|
21
|
-
okx/okxclient.py,sha256=RepnkJnstxtNGyFmlPh_9b6SFUooxKk-fM7d6z0Dvvc,2598
|
|
22
|
-
okx/utils.py,sha256=FTXSW73yXV6Hc4-9O22WFmkhayASYo7WQHIc_bTyc6g,1858
|
|
23
|
-
okx/websocket/WebSocketFactory.py,sha256=PlcvdNjVoLEm2515E9p6zTXVvX1gLoebTyBoDPkMbwM,895
|
|
24
|
-
okx/websocket/WsPrivateAsync.py,sha256=CYmZDRV16BxkrFhf7yeT7L4JyK2IZBlOIziaUOk3QCo,2282
|
|
25
|
-
okx/websocket/WsPublicAsync.py,sha256=sOV-IUmgybOQI1snCoyPxD4hzIoiQLHjUVRWrS2_2cM,1561
|
|
26
|
-
okx/websocket/WsUtils.py,sha256=ynkCtfvkrwBUiCi-_yqp1xTn3hhVd_o5ITIhD1xLdBo,2199
|
|
27
|
-
okx/websocket/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
28
|
-
python_okx-0.3.4.dist-info/METADATA,sha256=XbN-TtjGohjydZ6nDdOMg8UfA8IVImGLUsLLbfcitfw,3145
|
|
29
|
-
python_okx-0.3.4.dist-info/WHEEL,sha256=OVMc5UfuAQiSplgO0_WdW7vXVGAt9Hdd6qtN4HotdyA,91
|
|
30
|
-
python_okx-0.3.4.dist-info/top_level.txt,sha256=rrbhHZwiw4YlhG1LWWaAODvRxyZr3onxFnqwsHdikDc,4
|
|
31
|
-
python_okx-0.3.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|