python-okx 0.3.9__py3-none-any.whl → 0.4.0__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 CHANGED
@@ -23,8 +23,8 @@ class AccountAPI(OkxClient):
23
23
  return self._request_with_params(GET, ACCOUNT_INFO, params)
24
24
 
25
25
  # Get Positions
26
- def get_positions(self, instType='', instId=''):
27
- params = {'instType': instType, 'instId': instId}
26
+ def get_positions(self, instType='', instId='', posId=''):
27
+ params = {'instType': instType, 'instId': instId, 'posId': posId}
28
28
  return self._request_with_params(GET, POSITION_INFO, params)
29
29
 
30
30
  def position_builder(self, acctLv=None,inclRealPosAndEq=False, lever=None, greeksType=None, simPos=None,
okx/Finance/SolStaking.py CHANGED
@@ -46,3 +46,6 @@ class SolStakingAPI(OkxClient):
46
46
  'days': days,
47
47
  }
48
48
  return self._request_with_params(GET, STACK_SOL_APY_HISTORY, params)
49
+
50
+ def sol_product_info(self):
51
+ return self._request_without_params(GET, STACK_SOL_PRODUCT_INFO)
okx/Trade.py CHANGED
@@ -95,7 +95,8 @@ class TradeAPI(OkxClient):
95
95
  pxSpread='',
96
96
  szLimit='', pxLimit='', timeInterval='', tpTriggerPxType='', slTriggerPxType='',
97
97
  callbackRatio='', callbackSpread='', activePx='', tag='', triggerPxType='', closeFraction=''
98
- , quickMgnType='', algoClOrdId=''):
98
+ , quickMgnType='', algoClOrdId='', tradeQuoteCcy='', tpOrdKind='', cxlOnClosePos=''
99
+ , chaseType='', chaseVal='', maxChaseType='', maxChaseVal='', attachAlgoOrds=[]):
99
100
  params = {'instId': instId, 'tdMode': tdMode, 'side': side, 'ordType': ordType, 'sz': sz, 'ccy': ccy,
100
101
  'posSide': posSide, 'reduceOnly': reduceOnly, 'tpTriggerPx': tpTriggerPx, 'tpOrdPx': tpOrdPx,
101
102
  'slTriggerPx': slTriggerPx, 'slOrdPx': slOrdPx, 'triggerPx': triggerPx, 'orderPx': orderPx,
@@ -104,7 +105,9 @@ class TradeAPI(OkxClient):
104
105
  'pxSpread': pxSpread, 'tpTriggerPxType': tpTriggerPxType, 'slTriggerPxType': slTriggerPxType,
105
106
  'callbackRatio': callbackRatio, 'callbackSpread': callbackSpread, 'activePx': activePx,
106
107
  'tag': tag, 'triggerPxType': triggerPxType, 'closeFraction': closeFraction,
107
- 'quickMgnType': quickMgnType, 'algoClOrdId': algoClOrdId}
108
+ 'quickMgnType': quickMgnType, 'algoClOrdId': algoClOrdId, 'tradeQuoteCcy': tradeQuoteCcy,
109
+ 'tpOrdKind': tpOrdKind, 'cxlOnClosePos': cxlOnClosePos, 'chaseType': chaseType, 'chaseVal': chaseVal,
110
+ 'maxChaseType': maxChaseType, 'maxChaseVal': maxChaseVal, 'attachAlgoOrds': attachAlgoOrds}
108
111
  return self._request_with_params(POST, PLACE_ALGO_ORDER, params)
109
112
 
110
113
  # Cancel Algo Order
okx/__init__.py CHANGED
@@ -2,4 +2,4 @@
2
2
  Python SDK for the OKX API v5
3
3
 
4
4
  """
5
- __version__="0.3.9"
5
+ __version__="0.4.0"
okx/consts.py CHANGED
@@ -261,6 +261,7 @@ STACK_SOL_REDEEM = '/api/v5/finance/staking-defi/sol/redeem'
261
261
  STACK_SOL_BALANCE = '/api/v5/finance/staking-defi/sol/balance'
262
262
  STACK_SOL_PURCHASE_REDEEM_HISTORY = '/api/v5/finance/staking-defi/sol/purchase-redeem-history'
263
263
  STACK_SOL_APY_HISTORY = '/api/v5/finance/staking-defi/sol/apy-history'
264
+ STACK_SOL_PRODUCT_INFO = '/api/v5/finance/staking-defi/sol/product-info'
264
265
 
265
266
  # Status
266
267
  STATUS = '/api/v5/system/status'
okx/utils.py CHANGED
@@ -42,7 +42,7 @@ def get_header_no_sign(flag,debug = True):
42
42
  def parse_params_to_str(params):
43
43
  url = '?'
44
44
  for key, value in params.items():
45
- if(value != ''):
45
+ if value is not None and value != '':
46
46
  url = url + str(key) + '=' + str(value) + '&'
47
47
  url = url[0:-1]
48
48
  return url
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-okx
3
- Version: 0.3.9
3
+ Version: 0.4.0
4
4
  Summary: Python SDK for OKX
5
5
  Home-page: https://okx.com/docs-v5/
6
6
  Author: okxv5api
@@ -24,8 +24,6 @@ If you came here looking to purchase cryptocurrencies from the OKX exchange, ple
24
24
 
25
25
  #### Source code
26
26
  https://github.com/okxapi/python-okx
27
- #### OKX API Telegram
28
- https://t.me/OKXAPI
29
27
  #### API trading tutorials
30
28
  - Spot trading: https://www.okx.com/help/how-can-i-do-spot-trading-with-the-jupyter-notebook
31
29
  - Derivative trading: https://www.okx.com/help/how-can-i-do-derivatives-trading-with-the-jupyter-notebook
@@ -1,4 +1,4 @@
1
- okx/Account.py,sha256=GK31nIOcVfjskr1QT4FM3b3dMuPp8NbKkQViHtJ0ekI,14134
1
+ okx/Account.py,sha256=8j5WDOt6b3ehlid7XKELa2xq0h-0LmV-7N6DZn5J2Qw,14160
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
@@ -10,17 +10,17 @@ okx/PublicData.py,sha256=HEq4cNCk5P1mhLaMewJhVJTvHm0I2bdrL8Z6pH3yYn0,5136
10
10
  okx/SpreadTrading.py,sha256=Dy7VZ8WK4HyxhMvLY1G5RukRHI_T3d0fnrHZifv9Uyw,3227
11
11
  okx/Status.py,sha256=hGnn-tw302xXCDWly7LssaG3-29HcHZRhrBFUuGrSS0,495
12
12
  okx/SubAccount.py,sha256=BcwEzi_Y63k-rS9IffFKAJ2ywVl7o9J0U9sBzg87Lpw,3264
13
- okx/Trade.py,sha256=p1vJcwHZvuYfgKXmaTYZKwtJQ9YtvSZ0arOd8GGAufI,11006
13
+ okx/Trade.py,sha256=Dj-1scJgJzZD2YAoCLys-xw3lVwRw_Bi8nSfLvYfCuk,11423
14
14
  okx/TradingData.py,sha256=ig9Y3f-CH_nyBvoZCF4M9z2_wQXF-r0On7p9EMMuDMo,2331
15
- okx/__init__.py,sha256=aCopTb9QU6OqHWoGo05pHw8Qe-kOja2kjDzFeuEeWg8,58
16
- okx/consts.py,sha256=gUTC2PkhH34Ekct-HA428hJAARPLvcVa5JnAiHkjUGQ,14632
15
+ okx/__init__.py,sha256=PP0pJpYdSa9UD-5boOMsBSXVIA0syxuXpYcF_dh9HGY,58
16
+ okx/consts.py,sha256=xvfy5ZYNgne9GUmzfoNL634vu3xXJCNpM_vJqoyBGsw,14705
17
17
  okx/exceptions.py,sha256=ERuCnvnudJNBNACh3LNE3km5GJy0BGC5C3OKjgHXFaU,1182
18
18
  okx/okxclient.py,sha256=wJD8gTyHs92WjLffANbWLCgfX4Mnxh-IKnnJ2nUYHsI,2597
19
- okx/utils.py,sha256=FTXSW73yXV6Hc4-9O22WFmkhayASYo7WQHIc_bTyc6g,1858
19
+ okx/utils.py,sha256=yMlqB3OF6NDBrz7P6rEmD8PWe2xeqh0Gw8lceUFWy0A,1879
20
20
  okx/Finance/EthStaking.py,sha256=hOl_i4VOBjejeyBboG1-37rhVnlSoOZ44e-Jzger-bQ,1612
21
21
  okx/Finance/FlexibleLoan.py,sha256=L-j1O73fEIIiM_h8NvCT6NocUv6KAx2WEQU6F9GRzIw,2351
22
22
  okx/Finance/Savings.py,sha256=qZbv-KzgGt_me8RZePDSUiRCI1mbz692EK2ZhfYiH8c,1999
23
- okx/Finance/SolStaking.py,sha256=XuGFFonpRpMQkrhNlpyOb644EApb3joQ74PRabN0PTs,1502
23
+ okx/Finance/SolStaking.py,sha256=VcEU4ukbU5bO8qe00DDfFJ0DUIZZS9ZO_-A2evJz5e0,1608
24
24
  okx/Finance/StakingDefi.py,sha256=eWyAAmMDht4B4N5VWf3bj3FxSBETMXaay-Luu4GN3ls,2250
25
25
  okx/Finance/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
26
26
  okx/websocket/WebSocketFactory.py,sha256=ba0ZNUggghZ_YlWYB7g8UCv6MewqVr9wn75YOtIU5kE,845
@@ -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.9.dist-info/METADATA,sha256=6JjQsztHk5jx5GuNQPngvWPs7J_3jbZUKYcBTtctSbU,3145
32
- python_okx-0.3.9.dist-info/WHEEL,sha256=OVMc5UfuAQiSplgO0_WdW7vXVGAt9Hdd6qtN4HotdyA,91
33
- python_okx-0.3.9.dist-info/top_level.txt,sha256=rrbhHZwiw4YlhG1LWWaAODvRxyZr3onxFnqwsHdikDc,4
34
- python_okx-0.3.9.dist-info/RECORD,,
31
+ python_okx-0.4.0.dist-info/METADATA,sha256=ijdYOjmpA5LpNatTWHij0knW2PChlpd7Mzi2SUdWa-o,3103
32
+ python_okx-0.4.0.dist-info/WHEEL,sha256=OVMc5UfuAQiSplgO0_WdW7vXVGAt9Hdd6qtN4HotdyA,91
33
+ python_okx-0.4.0.dist-info/top_level.txt,sha256=rrbhHZwiw4YlhG1LWWaAODvRxyZr3onxFnqwsHdikDc,4
34
+ python_okx-0.4.0.dist-info/RECORD,,