python-okx 0.3.6__py3-none-any.whl → 0.3.8__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 +5 -3
- okx/Finance/FlexibleLoan.py +65 -0
- okx/Funding.py +0 -28
- okx/MarketData.py +0 -4
- okx/Trade.py +20 -10
- okx/__init__.py +1 -1
- okx/consts.py +46 -51
- {python_okx-0.3.6.dist-info → python_okx-0.3.8.dist-info}/METADATA +1 -1
- {python_okx-0.3.6.dist-info → python_okx-0.3.8.dist-info}/RECORD +11 -11
- okx/SimpleEarnFixed.py +0 -91
- {python_okx-0.3.6.dist-info → python_okx-0.3.8.dist-info}/WHEEL +0 -0
- {python_okx-0.3.6.dist-info → python_okx-0.3.8.dist-info}/top_level.txt +0 -0
okx/Account.py
CHANGED
|
@@ -27,13 +27,15 @@ class AccountAPI(OkxClient):
|
|
|
27
27
|
params = {'instType': instType, 'instId': instId}
|
|
28
28
|
return self._request_with_params(GET, POSITION_INFO, params)
|
|
29
29
|
|
|
30
|
-
def position_builder(self, inclRealPosAndEq=False,
|
|
30
|
+
def position_builder(self, acctLv=None,inclRealPosAndEq=False, lever=None, greeksType=None, simPos=None,
|
|
31
31
|
simAsset=None):
|
|
32
32
|
params = {}
|
|
33
|
+
if acctLv is not None:
|
|
34
|
+
params['acctLv'] = acctLv
|
|
33
35
|
if inclRealPosAndEq is not None:
|
|
34
36
|
params['inclRealPosAndEq'] = inclRealPosAndEq
|
|
35
|
-
if
|
|
36
|
-
params['spotOffsetType'] =
|
|
37
|
+
if lever is not None:
|
|
38
|
+
params['spotOffsetType'] = lever
|
|
37
39
|
if greeksType is not None:
|
|
38
40
|
params['greksType'] = greeksType
|
|
39
41
|
if simPos is not None:
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
from okx.okxclient import OkxClient
|
|
2
|
+
from okx.consts import *
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class FlexibleLoanAPI(OkxClient):
|
|
6
|
+
def __init__(self, api_key='-1', api_secret_key='-1', passphrase='-1', use_server_time=None, flag='1',
|
|
7
|
+
domain='https://www.okx.com', debug=False, proxy=None):
|
|
8
|
+
OkxClient.__init__(self, api_key, api_secret_key, passphrase, use_server_time, flag, domain, debug, proxy)
|
|
9
|
+
|
|
10
|
+
def borrow_currencies(self):
|
|
11
|
+
return self._request_without_params(GET, FINANCE_BORROW_CURRENCIES)
|
|
12
|
+
|
|
13
|
+
def collateral_assets(self, ccy=''):
|
|
14
|
+
params = {}
|
|
15
|
+
if ccy != '':
|
|
16
|
+
params['ccy'] = ccy
|
|
17
|
+
return self._request_with_params(GET, FINANCE_COLLATERAL_ASSETS, params)
|
|
18
|
+
|
|
19
|
+
def max_loan(self, borrowCcy='', supCollateral=[]):
|
|
20
|
+
params = {
|
|
21
|
+
'borrowCcy': borrowCcy,
|
|
22
|
+
'supCollateral': supCollateral,
|
|
23
|
+
}
|
|
24
|
+
return self._request_with_params(POST, FINANCE_MAX_LOAN, params)
|
|
25
|
+
|
|
26
|
+
def max_collateral_redeem_amount(self, ccy=''):
|
|
27
|
+
params = {}
|
|
28
|
+
if ccy != '':
|
|
29
|
+
params['ccy'] = ccy
|
|
30
|
+
return self._request_with_params(GET, FINANCE_MAX_REDEEM, params)
|
|
31
|
+
|
|
32
|
+
def adjust_collateral(self, type='', collateralCcy='', collateralAmt=''):
|
|
33
|
+
params = {
|
|
34
|
+
'type': type,
|
|
35
|
+
'collateralCcy': collateralCcy,
|
|
36
|
+
'collateralAmt': collateralAmt,
|
|
37
|
+
}
|
|
38
|
+
return self._request_with_params(POST, FINANCE_ADJUST_COLLATERAL, params)
|
|
39
|
+
|
|
40
|
+
def loan_info(self):
|
|
41
|
+
return self._request_without_params(GET, FINANCE_LOAN_INFO)
|
|
42
|
+
|
|
43
|
+
def loan_history(self, type='', after='', before='', limit=''):
|
|
44
|
+
params = {}
|
|
45
|
+
if type != '':
|
|
46
|
+
params['type'] = type
|
|
47
|
+
if after != '':
|
|
48
|
+
params['after'] = after
|
|
49
|
+
if before != '':
|
|
50
|
+
params['before'] = before
|
|
51
|
+
if limit != '':
|
|
52
|
+
params['limit'] = limit
|
|
53
|
+
return self._request_with_params(GET, FINANCE_LOAN_HISTORY, params)
|
|
54
|
+
|
|
55
|
+
def interest_accrued(self, ccy='', after='', before='', limit=''):
|
|
56
|
+
params = {}
|
|
57
|
+
if ccy != '':
|
|
58
|
+
params['ccy'] = ccy
|
|
59
|
+
if after != '':
|
|
60
|
+
params['after'] = after
|
|
61
|
+
if before != '':
|
|
62
|
+
params['before'] = before
|
|
63
|
+
if limit != '':
|
|
64
|
+
params['limit'] = limit
|
|
65
|
+
return self._request_with_params(GET, FINANCE_INTEREST_ACCRUED, params)
|
okx/Funding.py
CHANGED
|
@@ -79,27 +79,6 @@ class FundingAPI(OkxClient):
|
|
|
79
79
|
params = {'ccy':ccy, 'invoice':invoice, 'memo':memo}
|
|
80
80
|
return self._request_with_params(POST, WITHDRAWAL_LIGHTNING, params)
|
|
81
81
|
|
|
82
|
-
# POST SET LENDING RATE
|
|
83
|
-
def set_lending_rate(self, ccy, rate):
|
|
84
|
-
params = {'ccy': ccy, 'rate': rate}
|
|
85
|
-
return self._request_with_params(POST, SET_LENDING_RATE, params)
|
|
86
|
-
|
|
87
|
-
# GET LENDING HISTORY
|
|
88
|
-
def get_lending_history(self, ccy='', before='', after='', limit='' ):
|
|
89
|
-
params = {'ccy': ccy, 'after': after, 'before': before, 'limit': limit }
|
|
90
|
-
return self._request_with_params(GET, LENDING_HISTORY, params)
|
|
91
|
-
|
|
92
|
-
# GET LENDING RATE HISTORY
|
|
93
|
-
def get_lending_rate_history(self, ccy='',after = '',before = '',limit = '' ):
|
|
94
|
-
params = {'ccy': ccy,'after':after,'before':before,'limit':limit}
|
|
95
|
-
return self._request_with_params(GET, LENDING_RATE_HISTORY, params)
|
|
96
|
-
|
|
97
|
-
# GET LENDING RATE SUMMARY
|
|
98
|
-
def get_lending_rate_summary(self, ccy=''):
|
|
99
|
-
params = {'ccy': ccy}
|
|
100
|
-
return self._request_with_params(GET, LENDING_RATE_SUMMARY, params)
|
|
101
|
-
|
|
102
|
-
|
|
103
82
|
#POST /api/v5/asset/cancel-withdrawal
|
|
104
83
|
def cancel_withdrawal(self,wdId = ''):
|
|
105
84
|
params = {
|
|
@@ -121,13 +100,6 @@ class FundingAPI(OkxClient):
|
|
|
121
100
|
}
|
|
122
101
|
return self._request_with_params(GET, ASSET_VALUATION, params)
|
|
123
102
|
|
|
124
|
-
#GET / api / v5 / asset / saving - balance
|
|
125
|
-
def get_saving_balance(self,ccy = ''):
|
|
126
|
-
params = {
|
|
127
|
-
'ccy':ccy
|
|
128
|
-
}
|
|
129
|
-
return self._request_with_params(GET, GET_SAVING_BALANCE, params)
|
|
130
|
-
|
|
131
103
|
#Get non-tradable assets
|
|
132
104
|
def get_non_tradable_assets(self, ccy=''):
|
|
133
105
|
params = {
|
okx/MarketData.py
CHANGED
|
@@ -60,10 +60,6 @@ class MarketAPI(OkxClient):
|
|
|
60
60
|
def get_volume(self):
|
|
61
61
|
return self._request_without_params(GET, VOLUMNE)
|
|
62
62
|
|
|
63
|
-
# Get Oracle
|
|
64
|
-
def get_oracle(self):
|
|
65
|
-
return self._request_without_params(GET, ORACLE)
|
|
66
|
-
|
|
67
63
|
# Get Tier
|
|
68
64
|
def get_tier(self, instType='', tdMode='', uly='', instId='', ccy='', tier=''):
|
|
69
65
|
params = {'instType': instType, 'tdMode': tdMode, 'uly': uly, 'instId': instId, 'ccy': ccy, 'tier': tier}
|
okx/Trade.py
CHANGED
|
@@ -12,14 +12,10 @@ class TradeAPI(OkxClient):
|
|
|
12
12
|
|
|
13
13
|
# Place Order
|
|
14
14
|
def place_order(self, instId, tdMode, side, ordType, sz, ccy='', clOrdId='', tag='', posSide='', px='',
|
|
15
|
-
reduceOnly='', tgtCcy='',
|
|
16
|
-
tpTriggerPxType='', slTriggerPxType='', quickMgnType='', stpId='', stpMode='',
|
|
17
|
-
attachAlgoOrds=None):
|
|
15
|
+
reduceOnly='', tgtCcy='', stpMode='', attachAlgoOrds=None, pxUsd='', pxVol='', banAmend=''):
|
|
18
16
|
params = {'instId': instId, 'tdMode': tdMode, 'side': side, 'ordType': ordType, 'sz': sz, 'ccy': ccy,
|
|
19
17
|
'clOrdId': clOrdId, 'tag': tag, 'posSide': posSide, 'px': px, 'reduceOnly': reduceOnly,
|
|
20
|
-
'tgtCcy': tgtCcy, '
|
|
21
|
-
'slOrdPx': slOrdPx, 'tpTriggerPxType': tpTriggerPxType, 'slTriggerPxType': slTriggerPxType,
|
|
22
|
-
'quickMgnType': quickMgnType, 'stpId': stpId, 'stpMode': stpMode}
|
|
18
|
+
'tgtCcy': tgtCcy, 'stpMode': stpMode, 'pxUsd': pxUsd, 'pxVol': pxVol, 'banAmend': banAmend}
|
|
23
19
|
params['attachAlgoOrds'] = attachAlgoOrds
|
|
24
20
|
return self._request_with_params(POST, PLACR_ORDER, params)
|
|
25
21
|
|
|
@@ -115,10 +111,6 @@ class TradeAPI(OkxClient):
|
|
|
115
111
|
def cancel_algo_order(self, params):
|
|
116
112
|
return self._request_with_params(POST, CANCEL_ALGOS, params)
|
|
117
113
|
|
|
118
|
-
# Cancel Advance Algos
|
|
119
|
-
def cancel_advance_algos(self, params):
|
|
120
|
-
return self._request_with_params(POST, Cancel_Advance_Algos, params)
|
|
121
|
-
|
|
122
114
|
# Get Algo Order List
|
|
123
115
|
def order_algos_list(self, ordType='', algoId='', instType='', instId='', after='', before='', limit='',
|
|
124
116
|
algoClOrdId=''):
|
|
@@ -191,3 +183,21 @@ class TradeAPI(OkxClient):
|
|
|
191
183
|
'newSlTriggerPx': newSlTriggerPx, 'newSlOrdPx': newSlOrdPx,
|
|
192
184
|
'newTpTriggerPxType': newTpTriggerPxType, 'newSlTriggerPxType': newSlTriggerPxType}
|
|
193
185
|
return self._request_with_params(POST, AMEND_ALGO_ORDER, params)
|
|
186
|
+
|
|
187
|
+
def get_oneclick_repay_list_v2(self):
|
|
188
|
+
return self._request_without_params(GET, ONE_CLICK_REPAY_SUPPORT_V2)
|
|
189
|
+
|
|
190
|
+
def oneclick_repay_v2(self, debtCcy='', repayCcyList=[]):
|
|
191
|
+
params = {
|
|
192
|
+
'debtCcy': debtCcy,
|
|
193
|
+
'repayCcyList': repayCcyList
|
|
194
|
+
}
|
|
195
|
+
return self._request_with_params(POST, ONE_CLICK_REPAY_V2, params)
|
|
196
|
+
|
|
197
|
+
def oneclick_repay_history_v2(self, after='', before='', limit=''):
|
|
198
|
+
params = {
|
|
199
|
+
'after': after,
|
|
200
|
+
'before': before,
|
|
201
|
+
'limit': limit
|
|
202
|
+
}
|
|
203
|
+
return self._request_with_params(GET, ONE_CLICK_REPAY_HISTORY_V2, params)
|
okx/__init__.py
CHANGED
okx/consts.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Http header
|
|
2
2
|
API_URL = 'https://www.okx.com'
|
|
3
3
|
|
|
4
4
|
CONTENT_TYPE = 'Content-Type'
|
|
@@ -18,7 +18,7 @@ POST = "POST"
|
|
|
18
18
|
|
|
19
19
|
SERVER_TIMESTAMP_URL = '/api/v5/public/time'
|
|
20
20
|
|
|
21
|
-
#
|
|
21
|
+
# Account
|
|
22
22
|
POSITION_RISK='/api/v5/account/account-position-risk'
|
|
23
23
|
ACCOUNT_INFO = '/api/v5/account/balance'
|
|
24
24
|
POSITION_INFO = '/api/v5/account/positions'
|
|
@@ -44,8 +44,8 @@ BORROW_REPAY_HISTORY = '/api/v5/account/borrow-repay-history'
|
|
|
44
44
|
INTEREST_LIMITS = '/api/v5/account/interest-limits'
|
|
45
45
|
SIMULATED_MARGIN = '/api/v5/account/simulated_margin'
|
|
46
46
|
GREEKS = '/api/v5/account/greeks'
|
|
47
|
-
POSITIONS_HISTORY = '/api/v5/account/positions-history'
|
|
48
|
-
GET_PM_LIMIT = '/api/v5/account/position-tiers'
|
|
47
|
+
POSITIONS_HISTORY = '/api/v5/account/positions-history'
|
|
48
|
+
GET_PM_LIMIT = '/api/v5/account/position-tiers'
|
|
49
49
|
GET_VIP_INTEREST_ACCRUED_DATA = '/api/v5/account/vip-interest-accrued'
|
|
50
50
|
GET_VIP_INTEREST_DEDUCTED_DATA = '/api/v5/account/vip-interest-deducted'
|
|
51
51
|
GET_VIP_LOAN_ORDER_LIST= '/api/v5/account/vip-loan-order-list'
|
|
@@ -67,7 +67,7 @@ MANUAL_REBORROW_REPAY = '/api/v5/account/spot-manual-borrow-repay'
|
|
|
67
67
|
SET_AUTO_REPAY='/api/v5/account/set-auto-repay'
|
|
68
68
|
GET_BORROW_REPAY_HISTORY='/api/v5/account/spot-borrow-repay-history'
|
|
69
69
|
|
|
70
|
-
#
|
|
70
|
+
# Funding
|
|
71
71
|
NON_TRADABLE_ASSETS = '/api/v5/asset/non-tradable-assets'
|
|
72
72
|
DEPOSIT_ADDRESS = '/api/v5/asset/deposit-address'
|
|
73
73
|
GET_BALANCES = '/api/v5/asset/balances'
|
|
@@ -80,21 +80,16 @@ PURCHASE_REDEMPT = '/api/v5/asset/purchase_redempt'
|
|
|
80
80
|
BILLS_INFO = '/api/v5/asset/bills'
|
|
81
81
|
DEPOSIT_LIGHTNING = '/api/v5/asset/deposit-lightning'
|
|
82
82
|
WITHDRAWAL_LIGHTNING = '/api/v5/asset/withdrawal-lightning'
|
|
83
|
-
CANCEL_WITHDRAWAL = '/api/v5/asset/cancel-withdrawal'
|
|
83
|
+
CANCEL_WITHDRAWAL = '/api/v5/asset/cancel-withdrawal'
|
|
84
84
|
WITHDRAWAL_HISTORY = '/api/v5/asset/withdrawal-history'
|
|
85
|
-
CONVERT_DUST_ASSETS = '/api/v5/asset/convert-dust-assets'
|
|
86
|
-
ASSET_VALUATION = '/api/v5/asset/asset-valuation'
|
|
87
|
-
SET_LENDING_RATE = '/api/v5/asset/set-lending-rate'
|
|
88
|
-
LENDING_HISTORY = '/api/v5/asset/lending-history'
|
|
89
|
-
LENDING_RATE_HISTORY = '/api/v5/asset/lending-rate-history'
|
|
90
|
-
LENDING_RATE_SUMMARY = '/api/v5/asset/lending-rate-summary'
|
|
91
|
-
GET_SAVING_BALANCE = '/api/v5/asset/saving-balance' #need to add
|
|
85
|
+
CONVERT_DUST_ASSETS = '/api/v5/asset/convert-dust-assets'
|
|
86
|
+
ASSET_VALUATION = '/api/v5/asset/asset-valuation'
|
|
92
87
|
GET_WITHDRAWAL_HISTORY = '/api/v5/asset/withdrawal-history'
|
|
93
88
|
GET_NON_TRADABLE_ASSETS = '/api/v5/asset/non-tradable-assets'
|
|
94
89
|
GET_DEPOSIT_WITHDrAW_STATUS = '/api/v5/asset/deposit-withdraw-status'
|
|
95
90
|
|
|
96
91
|
|
|
97
|
-
# Market Data
|
|
92
|
+
# Market Data
|
|
98
93
|
TICKERS_INFO = '/api/v5/market/tickers'
|
|
99
94
|
TICKER_INFO = '/api/v5/market/ticker'
|
|
100
95
|
INDEX_TICKERS = '/api/v5/market/index-tickers'
|
|
@@ -105,17 +100,16 @@ INDEX_CANSLES = '/api/v5/market/index-candles'
|
|
|
105
100
|
MARKPRICE_CANDLES = '/api/v5/market/mark-price-candles'
|
|
106
101
|
MARKET_TRADES = '/api/v5/market/trades'
|
|
107
102
|
VOLUMNE = '/api/v5/market/platform-24-volume'
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
BLOCK_TRADES = '/api/v5/market/block-trades'#need to add
|
|
103
|
+
INDEX_COMPONENTS = '/api/v5/market/index-components'
|
|
104
|
+
EXCHANGE_RATE = '/api/v5/market/exchange-rate'
|
|
105
|
+
HISTORY_TRADES = '/api/v5/market/history-trades'
|
|
106
|
+
BLOCK_TICKERS = '/api/v5/market/block-tickers'
|
|
107
|
+
BLOCK_TICKER = '/api/v5/market/block-ticker'
|
|
108
|
+
BLOCK_TRADES = '/api/v5/market/block-trades'
|
|
115
109
|
GET_ORDER_LITE_BOOK = '/api/v5/market/books-lite'
|
|
116
110
|
GET_OPTION_TRADES = '/api/v5/market/option/instrument-family-trades'
|
|
117
111
|
|
|
118
|
-
# Public Data
|
|
112
|
+
# Public Data
|
|
119
113
|
INSTRUMENT_INFO = '/api/v5/public/instruments'
|
|
120
114
|
DELIVERY_EXERCISE = '/api/v5/public/delivery-exercise-history'
|
|
121
115
|
OPEN_INTEREST = '/api/v5/public/open-interest'
|
|
@@ -129,15 +123,15 @@ SYSTEM_TIME = '/api/v5/public/time'
|
|
|
129
123
|
LIQUIDATION_ORDERS = '/api/v5/public/liquidation-orders'
|
|
130
124
|
MARK_PRICE = '/api/v5/public/mark-price'
|
|
131
125
|
TIER = '/api/v5/public/position-tiers'
|
|
132
|
-
INTEREST_LOAN = '/api/v5/public/interest-rate-loan-quota'
|
|
133
|
-
UNDERLYING = '/api/v5/public/underlying'
|
|
134
|
-
VIP_INTEREST_RATE_LOAN_QUOTA = '/api/v5/public/vip-interest-rate-loan-quota'
|
|
135
|
-
INSURANCE_FUND = '/api/v5/public/insurance-fund'
|
|
136
|
-
CONVERT_CONTRACT_COIN = '/api/v5/public/convert-contract-coin'
|
|
126
|
+
INTEREST_LOAN = '/api/v5/public/interest-rate-loan-quota'
|
|
127
|
+
UNDERLYING = '/api/v5/public/underlying'
|
|
128
|
+
VIP_INTEREST_RATE_LOAN_QUOTA = '/api/v5/public/vip-interest-rate-loan-quota'
|
|
129
|
+
INSURANCE_FUND = '/api/v5/public/insurance-fund'
|
|
130
|
+
CONVERT_CONTRACT_COIN = '/api/v5/public/convert-contract-coin'
|
|
137
131
|
GET_OPTION_TICKBANDS = '/api/v5/public/instrument-tick-bands'
|
|
138
132
|
GET_OPTION_TRADES = '/api/v5/public/option-trades'
|
|
139
133
|
|
|
140
|
-
#
|
|
134
|
+
# Trading data
|
|
141
135
|
SUPPORT_COIN = '/api/v5/rubik/stat/trading-data/support-coin'
|
|
142
136
|
TAKER_VOLUME = '/api/v5/rubik/stat/taker-volume'
|
|
143
137
|
MARGIN_LENDING_RATIO = '/api/v5/rubik/stat/margin/loan-ratio'
|
|
@@ -149,7 +143,7 @@ OPEN_INTEREST_VOLUME_EXPIRY = '/api/v5/rubik/stat/option/open-interest-volume-ex
|
|
|
149
143
|
INTEREST_VOLUME_STRIKE = '/api/v5/rubik/stat/option/open-interest-volume-strike'
|
|
150
144
|
TAKER_FLOW = '/api/v5/rubik/stat/option/taker-block-volume'
|
|
151
145
|
|
|
152
|
-
#
|
|
146
|
+
# Trade
|
|
153
147
|
PLACR_ORDER = '/api/v5/trade/order'
|
|
154
148
|
BATCH_ORDERS = '/api/v5/trade/batch-orders'
|
|
155
149
|
CANCEL_ORDER = '/api/v5/trade/cancel-order'
|
|
@@ -165,45 +159,46 @@ ORDER_FILLS = '/api/v5/trade/fills'
|
|
|
165
159
|
ORDERS_FILLS_HISTORY = '/api/v5/trade/fills-history'
|
|
166
160
|
PLACE_ALGO_ORDER = '/api/v5/trade/order-algo'
|
|
167
161
|
CANCEL_ALGOS = '/api/v5/trade/cancel-algos'
|
|
168
|
-
Cancel_Advance_Algos = '/api/v5/trade/cancel-advance-algos'
|
|
169
162
|
ORDERS_ALGO_PENDING = '/api/v5/trade/orders-algo-pending'
|
|
170
163
|
ORDERS_ALGO_HISTORY = '/api/v5/trade/orders-algo-history'
|
|
171
164
|
GET_ALGO_ORDER_DETAILS = '/api/v5/trade/order-algo'
|
|
172
165
|
AMEND_ALGO_ORDER = '/api/v5/trade/amend-algos'
|
|
173
|
-
|
|
174
166
|
EASY_CONVERT_CURRENCY_LIST = '/api/v5/trade/easy-convert-currency-list'
|
|
175
167
|
EASY_CONVERT = '/api/v5/trade/easy-convert'
|
|
176
168
|
CONVERT_EASY_HISTORY = '/api/v5/trade/easy-convert-history'
|
|
177
169
|
ONE_CLICK_REPAY_SUPPORT = '/api/v5/trade/one-click-repay-currency-list'
|
|
178
170
|
ONE_CLICK_REPAY = '/api/v5/trade/one-click-repay'
|
|
179
171
|
ONE_CLICK_REPAY_HISTORY = '/api/v5/trade/one-click-repay-history'
|
|
172
|
+
ONE_CLICK_REPAY_SUPPORT_V2 = '/api/v5/trade/one-click-repay-currency-list-v2'
|
|
173
|
+
ONE_CLICK_REPAY_V2 = '/api/v5/trade/one-click-repay-v2'
|
|
174
|
+
ONE_CLICK_REPAY_HISTORY_V2 = '/api/v5/trade/one-click-repay-history-v2'
|
|
180
175
|
|
|
181
176
|
|
|
182
|
-
# SubAccount
|
|
177
|
+
# SubAccount
|
|
183
178
|
BALANCE = '/api/v5/account/subaccount/balances'
|
|
184
179
|
BILLs = '/api/v5/asset/subaccount/bills'
|
|
185
180
|
RESET = '/api/v5/users/subaccount/modify-apikey'
|
|
186
181
|
VIEW_LIST = '/api/v5/users/subaccount/list'
|
|
187
182
|
SUBACCOUNT_TRANSFER = '/api/v5/asset/subaccount/transfer'
|
|
188
|
-
ENTRUST_SUBACCOUNT_LIST = '/api/v5/users/entrust-subaccount-list'
|
|
189
|
-
SET_TRSNSFER_OUT = '/api/v5/users/subaccount/set-transfer-out'
|
|
190
|
-
GET_ASSET_SUBACCOUNT_BALANCE = '/api/v5/asset/subaccount/balances'
|
|
183
|
+
ENTRUST_SUBACCOUNT_LIST = '/api/v5/users/entrust-subaccount-list'
|
|
184
|
+
SET_TRSNSFER_OUT = '/api/v5/users/subaccount/set-transfer-out'
|
|
185
|
+
GET_ASSET_SUBACCOUNT_BALANCE = '/api/v5/asset/subaccount/balances'
|
|
191
186
|
GET_THE_USER_AFFILIATE_REBATE = '/api/v5/users/partner/if-rebate'
|
|
192
187
|
SET_SUB_ACCOUNTS_VIP_LOAN = '/api/v5/account/subaccount/set-loan-allocation'
|
|
193
188
|
GET_SUB_ACCOUNT_BORROW_INTEREST_AND_LIMIT = '/api/v5/account/subaccount/interest-limits'
|
|
194
189
|
|
|
195
|
-
# Convert
|
|
190
|
+
# Convert
|
|
196
191
|
GET_CURRENCIES = '/api/v5/asset/convert/currencies'
|
|
197
192
|
GET_CURRENCY_PAIR = '/api/v5/asset/convert/currency-pair'
|
|
198
193
|
ESTIMATE_QUOTE = '/api/v5/asset/convert/estimate-quote'
|
|
199
194
|
CONVERT_TRADE = '/api/v5/asset/convert/trade'
|
|
200
195
|
CONVERT_HISTORY = '/api/v5/asset/convert/history'
|
|
201
196
|
|
|
202
|
-
#
|
|
197
|
+
# FD Broker
|
|
203
198
|
FD_GET_REBATE_PER_ORDERS = '/api/v5/broker/fd/rebate-per-orders'
|
|
204
199
|
FD_REBATE_PER_ORDERS = '/api/v5/broker/fd/rebate-per-orders'
|
|
205
200
|
|
|
206
|
-
#
|
|
201
|
+
# BlockTrading
|
|
207
202
|
COUNTERPARTIES = '/api/v5/rfq/counterparties'
|
|
208
203
|
CREATE_RFQ = '/api/v5/rfq/create-rfq'
|
|
209
204
|
CANCEL_RFQ = '/api/v5/rfq/cancel-rfq'
|
|
@@ -222,7 +217,7 @@ MMP_RESET = '/api/v5/rfq/mmp-reset'
|
|
|
222
217
|
MARKER_INSTRUMENT_SETTING = '/api/v5/rfq/maker-instrument-settings'
|
|
223
218
|
|
|
224
219
|
|
|
225
|
-
#
|
|
220
|
+
# Trading Bot
|
|
226
221
|
GRID_ORDER_ALGO = '/api/v5/tradingBot/grid/order-algo'
|
|
227
222
|
GRID_AMEND_ORDER_ALGO = '/api/v5/tradingBot/grid/amend-order-algo'
|
|
228
223
|
GRID_STOP_ORDER_ALGO = '/api/v5/tradingBot/grid/stop-order-algo'
|
|
@@ -232,7 +227,6 @@ GRID_ORDERS_ALGO_DETAILS = '/api/v5/tradingBot/grid/orders-algo-details'
|
|
|
232
227
|
GRID_SUB_ORDERS = '/api/v5/tradingBot/grid/sub-orders'
|
|
233
228
|
GRID_POSITIONS = '/api/v5/tradingBot/grid/positions'
|
|
234
229
|
GRID_WITHDRAW_INCOME = '/api/v5/tradingBot/grid/withdraw-income'
|
|
235
|
-
#--------need to add:
|
|
236
230
|
GRID_COMPUTE_MARIGIN_BALANCE = '/api/v5/tradingBot/grid/compute-margin-balance'
|
|
237
231
|
GRID_MARGIN_BALANCE = '/api/v5/tradingBot/grid/margin-balance'
|
|
238
232
|
GRID_AI_PARAM = '/api/v5/tradingBot/grid/ai-param'
|
|
@@ -244,7 +238,7 @@ GET_RECURRING_BUY_ORDER_HISTORY = '/api/v5/tradingBot/recurring/orders-algo-hist
|
|
|
244
238
|
GET_RECURRING_BUY_ORDER_DETAILS = '/api/v5/tradingBot/recurring/orders-algo-details'
|
|
245
239
|
GET_RECURRING_BUY_SUB_ORDERS = '/api/v5/tradingBot/recurring/sub-orders'
|
|
246
240
|
|
|
247
|
-
#
|
|
241
|
+
# Stacking
|
|
248
242
|
STACK_DEFI_OFFERS = '/api/v5/finance/staking-defi/offers'
|
|
249
243
|
STACK_DEFI_PURCHASE = '/api/v5/finance/staking-defi/purchase'
|
|
250
244
|
STACK_DEFI_REDEEM = '/api/v5/finance/staking-defi/redeem'
|
|
@@ -269,10 +263,10 @@ STACK_SOL_BALANCE = '/api/v5/finance/staking-defi/sol/balance'
|
|
|
269
263
|
STACK_SOL_PURCHASE_REDEEM_HISTORY = '/api/v5/finance/staking-defi/sol/purchase-redeem-history'
|
|
270
264
|
STACK_SOL_APY_HISTORY = '/api/v5/finance/staking-defi/sol/apy-history'
|
|
271
265
|
|
|
272
|
-
#
|
|
266
|
+
# Status
|
|
273
267
|
STATUS = '/api/v5/system/status'
|
|
274
268
|
|
|
275
|
-
#Copy Trading
|
|
269
|
+
# Copy Trading
|
|
276
270
|
GET_EXISTING_LEADING_POSITIONS = '/api/v5/copytrading/current-subpositions'
|
|
277
271
|
GET_LEADING_POSITIONS_HISTORY = '/api/v5/copytrading/subpositions-history'
|
|
278
272
|
PLACE_LEADING_STOP_ORDER = '/api/v5/copytrading/algo-order'
|
|
@@ -296,13 +290,14 @@ SPREAD_GET_ORDER_BOOK = '/api/v5/sprd/books'
|
|
|
296
290
|
SPREAD_GET_TICKER = '/api/v5/sprd/ticker'
|
|
297
291
|
SPREAD_GET_PUBLIC_TRADES = '/api/v5/sprd/public-trades'
|
|
298
292
|
|
|
299
|
-
#
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
293
|
+
# Flexible loan
|
|
294
|
+
FINANCE_BORROW_CURRENCIES = '/api/v5/finance/flexible-loan/borrow-currencies'
|
|
295
|
+
FINANCE_COLLATERAL_ASSETS = '/api/v5/finance/flexible-loan/collateral-assets'
|
|
296
|
+
FINANCE_MAX_LOAN = '/api/v5/finance/flexible-loan/max-loan'
|
|
297
|
+
FINANCE_MAX_REDEEM = '/api/v5/finance/flexible-loan/max-collateral-redeem-amount'
|
|
298
|
+
FINANCE_ADJUST_COLLATERAL = '/api/v5/finance/flexible-loan/adjust-collateral'
|
|
299
|
+
FINANCE_LOAN_INFO = '/api/v5/finance/flexible-loan/loan-info'
|
|
300
|
+
FINANCE_LOAN_HISTORY = '/api/v5/finance/flexible-loan/loan-history'
|
|
301
|
+
FINANCE_INTEREST_ACCRUED = '/api/v5/finance/flexible-loan/interest-accrued'
|
|
307
302
|
|
|
308
303
|
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
okx/Account.py,sha256=
|
|
1
|
+
okx/Account.py,sha256=GK31nIOcVfjskr1QT4FM3b3dMuPp8NbKkQViHtJ0ekI,14134
|
|
2
2
|
okx/BlockTrading.py,sha256=A4OcuLuEHucAIhc8doPGr2o6dsCjVbv-a6YiTlzwdEw,4128
|
|
3
3
|
okx/Convert.py,sha256=xEB2pwEUpc-k23hA3mYIe3EKB5szIXlEe96JFiRSPpc,1575
|
|
4
4
|
okx/CopyTrading.py,sha256=Mso5GE9UQTJVrL4V3jIyU1QWBtzr-m32edrGDoRHk84,2751
|
|
5
5
|
okx/FDBroker.py,sha256=nUpcR_XtUcKa1Jk_B1OUZCjiv9ifQnxGRsLNHDxdGno,788
|
|
6
|
-
okx/Funding.py,sha256=
|
|
6
|
+
okx/Funding.py,sha256=JN6A7-uUJ83Y-AtqmBr7JUVHOa0lJtABQTS_lQ-6H7g,5173
|
|
7
7
|
okx/Grid.py,sha256=r8cZidY2okqrb-zpyTsFJrecPzw2s25ySH3tOBDnDtA,6691
|
|
8
|
-
okx/MarketData.py,sha256=
|
|
8
|
+
okx/MarketData.py,sha256=4GO8Vdkh02GQFJeqC0k4ej3w49wkZroEOoVJ407_ju4,4827
|
|
9
9
|
okx/PublicData.py,sha256=HEq4cNCk5P1mhLaMewJhVJTvHm0I2bdrL8Z6pH3yYn0,5136
|
|
10
|
-
okx/SimpleEarnFixed.py,sha256=DKROSJV_WTlHalCY0BoBG4euruBVKUn-2xTIu9XYCWE,3435
|
|
11
10
|
okx/SpreadTrading.py,sha256=Dy7VZ8WK4HyxhMvLY1G5RukRHI_T3d0fnrHZifv9Uyw,3227
|
|
12
11
|
okx/Status.py,sha256=hGnn-tw302xXCDWly7LssaG3-29HcHZRhrBFUuGrSS0,495
|
|
13
12
|
okx/SubAccount.py,sha256=SMMPdkatDyRE0_7mDqK8orzt29hti2TTTWNayLT3F0g,3528
|
|
14
|
-
okx/Trade.py,sha256=
|
|
13
|
+
okx/Trade.py,sha256=j7iSIXGTxuIN7mBO1I7_lki7B8ThuEyLSf3oSuMuUIo,11075
|
|
15
14
|
okx/TradingData.py,sha256=ig9Y3f-CH_nyBvoZCF4M9z2_wQXF-r0On7p9EMMuDMo,2331
|
|
16
|
-
okx/__init__.py,sha256=
|
|
17
|
-
okx/consts.py,sha256=
|
|
15
|
+
okx/__init__.py,sha256=jZ3qlMIccCOCV6wEanDQBTzQjm9efjrelxSeFzhXDKE,58
|
|
16
|
+
okx/consts.py,sha256=N0KSKnyzZa3Wv8jpbq_SsdxspkbAB11yXQLHlaumKh4,14698
|
|
18
17
|
okx/exceptions.py,sha256=ERuCnvnudJNBNACh3LNE3km5GJy0BGC5C3OKjgHXFaU,1182
|
|
19
18
|
okx/okxclient.py,sha256=wJD8gTyHs92WjLffANbWLCgfX4Mnxh-IKnnJ2nUYHsI,2597
|
|
20
19
|
okx/utils.py,sha256=FTXSW73yXV6Hc4-9O22WFmkhayASYo7WQHIc_bTyc6g,1858
|
|
21
20
|
okx/Finance/EthStaking.py,sha256=hOl_i4VOBjejeyBboG1-37rhVnlSoOZ44e-Jzger-bQ,1612
|
|
21
|
+
okx/Finance/FlexibleLoan.py,sha256=L-j1O73fEIIiM_h8NvCT6NocUv6KAx2WEQU6F9GRzIw,2351
|
|
22
22
|
okx/Finance/Savings.py,sha256=qZbv-KzgGt_me8RZePDSUiRCI1mbz692EK2ZhfYiH8c,1999
|
|
23
23
|
okx/Finance/SolStaking.py,sha256=XuGFFonpRpMQkrhNlpyOb644EApb3joQ74PRabN0PTs,1502
|
|
24
24
|
okx/Finance/StakingDefi.py,sha256=eWyAAmMDht4B4N5VWf3bj3FxSBETMXaay-Luu4GN3ls,2250
|
|
@@ -28,7 +28,7 @@ okx/websocket/WsPrivateAsync.py,sha256=zmZuInowW9_YWpQoZoicbbff-UwWvWxOluKclomNc
|
|
|
28
28
|
okx/websocket/WsPublicAsync.py,sha256=yDk_2jkgM4M_sq6zSL6i-KfdoSOaSd5KsmA1wqbIx3E,1520
|
|
29
29
|
okx/websocket/WsUtils.py,sha256=ynkCtfvkrwBUiCi-_yqp1xTn3hhVd_o5ITIhD1xLdBo,2199
|
|
30
30
|
okx/websocket/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
31
|
-
python_okx-0.3.
|
|
32
|
-
python_okx-0.3.
|
|
33
|
-
python_okx-0.3.
|
|
34
|
-
python_okx-0.3.
|
|
31
|
+
python_okx-0.3.8.dist-info/METADATA,sha256=lIRvleY4tKE0CUH8nfQp4DLOD6X8YPE3ux8QL782-Jg,3145
|
|
32
|
+
python_okx-0.3.8.dist-info/WHEEL,sha256=OVMc5UfuAQiSplgO0_WdW7vXVGAt9Hdd6qtN4HotdyA,91
|
|
33
|
+
python_okx-0.3.8.dist-info/top_level.txt,sha256=rrbhHZwiw4YlhG1LWWaAODvRxyZr3onxFnqwsHdikDc,4
|
|
34
|
+
python_okx-0.3.8.dist-info/RECORD,,
|
okx/SimpleEarnFixed.py
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
from okx.consts import GET, LENDING_OFFERS, LENDING_APY_HISTORY, PENDING_LENDING_VOLUME, PLACE_LENDING_ORDER, POST, \
|
|
2
|
-
AMEND_LENDING_ORDER, LENDING_ORDERS_LIST, LENDING_SUB_ORDERS
|
|
3
|
-
from okx.okxclient import OkxClient
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
class SimpleEarnFixedAPI(OkxClient):
|
|
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=False, proxy=None):
|
|
9
|
-
OkxClient.__init__(self, api_key, api_secret_key, passphrase, use_server_time, flag, domain, debug, proxy)
|
|
10
|
-
|
|
11
|
-
def get_lending_offers(self, ccy=None, term=None):
|
|
12
|
-
params = {}
|
|
13
|
-
if ccy is not None:
|
|
14
|
-
params['ccy'] = ccy
|
|
15
|
-
if term is not None:
|
|
16
|
-
params['term'] = term
|
|
17
|
-
return self._request_with_params(GET, LENDING_OFFERS, params)
|
|
18
|
-
|
|
19
|
-
def get_lending_apy_history(self, ccy=None, term=None):
|
|
20
|
-
params = {}
|
|
21
|
-
if ccy is not None:
|
|
22
|
-
params['ccy'] = ccy
|
|
23
|
-
if term is not None:
|
|
24
|
-
params['term'] = term
|
|
25
|
-
return self._request_with_params(GET, LENDING_APY_HISTORY, params)
|
|
26
|
-
|
|
27
|
-
def get_pending_lending_volume(self, ccy=None, term=None):
|
|
28
|
-
params = {}
|
|
29
|
-
if ccy is not None:
|
|
30
|
-
params['ccy'] = ccy
|
|
31
|
-
if term is not None:
|
|
32
|
-
params['term'] = term
|
|
33
|
-
return self._request_with_params(GET, PENDING_LENDING_VOLUME, params)
|
|
34
|
-
|
|
35
|
-
def place_lending_order(self, ccy=None, amt=None, rate=None, term=None, autoRenewal=False):
|
|
36
|
-
params = {}
|
|
37
|
-
if ccy is not None:
|
|
38
|
-
params['ccy'] = ccy
|
|
39
|
-
if amt is not None:
|
|
40
|
-
params['amt'] = amt
|
|
41
|
-
if rate is not None:
|
|
42
|
-
params['rate'] = rate
|
|
43
|
-
if term is not None:
|
|
44
|
-
params['term'] = term
|
|
45
|
-
if autoRenewal:
|
|
46
|
-
params['autoRenewal'] = autoRenewal
|
|
47
|
-
return self._request_with_params(POST, PLACE_LENDING_ORDER, params)
|
|
48
|
-
def amend_lending_order(self, ordId=None, changeAmt=None, rate=None,autoRenewal=False):
|
|
49
|
-
params = {}
|
|
50
|
-
if ordId is not None:
|
|
51
|
-
params['ordId'] = ordId
|
|
52
|
-
if changeAmt is not None:
|
|
53
|
-
params['amt'] = changeAmt
|
|
54
|
-
if rate is not None:
|
|
55
|
-
params['rate'] = rate
|
|
56
|
-
params['autoRenewal'] = autoRenewal
|
|
57
|
-
return self._request_with_params(POST, AMEND_LENDING_ORDER, params)
|
|
58
|
-
|
|
59
|
-
def get_lending_orders_list(self, ordId = None,ccy=None, state=None, after=None,before=None,limit=None):
|
|
60
|
-
params = {}
|
|
61
|
-
if ordId is not None:
|
|
62
|
-
params['ordId'] = ordId
|
|
63
|
-
if ccy is not None:
|
|
64
|
-
params['ccy'] = ccy
|
|
65
|
-
if state is not None:
|
|
66
|
-
params['state'] = state
|
|
67
|
-
if after is not None:
|
|
68
|
-
params['after'] = after
|
|
69
|
-
if before is not None:
|
|
70
|
-
params['before'] = before
|
|
71
|
-
if limit:
|
|
72
|
-
params['limit'] = limit
|
|
73
|
-
return self._request_with_params(GET, LENDING_ORDERS_LIST, params)
|
|
74
|
-
|
|
75
|
-
def get_lending_sub_orders(self, ordId = None, state=None, after=None,before=None,limit=None):
|
|
76
|
-
params = {}
|
|
77
|
-
if ordId is not None:
|
|
78
|
-
params['ordId'] = ordId
|
|
79
|
-
if state is not None:
|
|
80
|
-
params['state'] = state
|
|
81
|
-
if after is not None:
|
|
82
|
-
params['after'] = after
|
|
83
|
-
if before is not None:
|
|
84
|
-
params['before'] = before
|
|
85
|
-
if limit:
|
|
86
|
-
params['limit'] = limit
|
|
87
|
-
return self._request_with_params(GET, LENDING_SUB_ORDERS, params)
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
File without changes
|
|
File without changes
|