From 6c11b63dfbbe9698532625ecb70476de196eabaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20S=C3=A1nchez?= Date: Tue, 27 May 2025 15:14:58 -0300 Subject: [PATCH] initial commit (fork) --- README.md | 12 +-- python_okx_earn.egg-info/PKG-INFO | 84 +++++++++++++++++++ python_okx_earn.egg-info/SOURCES.txt | 34 ++++++++ python_okx_earn.egg-info/dependency_links.txt | 1 + python_okx_earn.egg-info/requires.txt | 7 ++ python_okx_earn.egg-info/top_level.txt | 1 + setup.py | 6 +- 7 files changed, 133 insertions(+), 12 deletions(-) create mode 100644 python_okx_earn.egg-info/PKG-INFO create mode 100644 python_okx_earn.egg-info/SOURCES.txt create mode 100644 python_okx_earn.egg-info/dependency_links.txt create mode 100644 python_okx_earn.egg-info/requires.txt create mode 100644 python_okx_earn.egg-info/top_level.txt diff --git a/README.md b/README.md index 0bb5e7c..6a98f37 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,11 @@ ### Overview +Forked from https://github.com/okxapi/python-okx/ This is an unofficial Python wrapper for the [OKX exchange v5 API](https://www.okx.com/okx-api) If you came here looking to purchase cryptocurrencies from the OKX exchange, please go [here](https://www.okx.com/). #### Source code -https://github.com/okxapi/python-okx -#### OKX API Telegram -https://t.me/OKXAPI -#### API trading tutorials -- Spot trading: https://www.okx.com/help/how-can-i-do-spot-trading-with-the-jupyter-notebook -- Derivative trading: https://www.okx.com/help/how-can-i-do-derivatives-trading-with-the-jupyter-notebook - -Make sure you update often and check the [Changelog](https://www.okx.com/docs-v5/log_en/) for new features and bug fixes. +https://gitea.nicosanchez.com.ar/nicolas/python-okx ### Features - Implementation of all Rest API endpoints. @@ -33,7 +27,7 @@ Make sure you update often and check the [Changelog](https://www.okx.com/docs-v5 #### Step 2: install python-okx ```python -pip install python-okx +pip install python-okx-earn ``` #### Step 3: Run examples diff --git a/python_okx_earn.egg-info/PKG-INFO b/python_okx_earn.egg-info/PKG-INFO new file mode 100644 index 0000000..46e1e25 --- /dev/null +++ b/python_okx_earn.egg-info/PKG-INFO @@ -0,0 +1,84 @@ +Metadata-Version: 2.1 +Name: python-okx-earn +Version: 0.3.5 +Summary: Python SDK for OKX +Home-page: https://okx.com/docs-v5/ +Author: nsanchez1980 +Author-email: nicolassanchez@tutanota.com +Classifier: Programming Language :: Python :: 3 +Classifier: License :: OSI Approved :: MIT License +Classifier: Operating System :: OS Independent +Description-Content-Type: text/markdown + +### Overview +Forked from https://github.com/okxapi/python-okx/ +This is an unofficial Python wrapper for the [OKX exchange v5 API](https://www.okx.com/okx-api) + +If you came here looking to purchase cryptocurrencies from the OKX exchange, please go [here](https://www.okx.com/). + +#### Source code +https://gitea.nicosanchez.com.ar/nicolas/python-okx + +### Features +- Implementation of all Rest API endpoints. +- Private and Public Websocket implementation +- Testnet support +- Websocket handling with reconnection and multiplexed connections + +### Quick start +#### Prerequisites + +`python version:>=3.9` + +`WebSocketAPI: websockets package advise version 6.0` + +#### Step 1: register an account on OKX and apply for an API key +- Register for an account: https://www.okx.com/account/register +- Apply for an API key: https://www.okx.com/account/users/myApi + +#### Step 2: install python-okx + +```python +pip install python-okx-earn +``` + +#### Step 3: Run examples + +- Fill in API credentials in the corresponding examples +```python +api_key = "" +secret_key = "" +passphrase = "" +``` +- RestAPI + - For spot trading: run example/get_started_en.ipynb + - For derivative trading: run example/trade_derivatives_en.ipynb + - Tweak the value of the parameter `flag` (live trading: 0, demo trading: 1 +) to switch between live and demo trading environment +- WebSocketAPI + - Run test/WsPrivateTest.py for private websocket channels + - Run test/WsPublicTest.py for public websocket channels + - Use different URLs for different environment + - Live trading URLs: https://www.okx.com/docs-v5/en/#overview-production-trading-services + - Demo trading URLs: https://www.okx.com/docs-v5/en/#overview-demo-trading-services + +Note + +- To learn more about OKX API, visit official [OKX API documentation](https://www.okx.com/docs-v5/en/) + +- If you face any questions when using `WebSocketAPI`,you can consult the following links + + - `asyncio`、`websockets` document/`github`: + + ```python + https://docs.python.org/3/library/asyncio-dev.html + https://websockets.readthedocs.io/en/stable/intro.html + https://github.com/aaugustin/websockets + ``` + + - About `code=1006`: + + ```python + https://github.com/Rapptz/discord.py/issues/1996 + https://github.com/aaugustin/websockets/issues/587 + ``` diff --git a/python_okx_earn.egg-info/SOURCES.txt b/python_okx_earn.egg-info/SOURCES.txt new file mode 100644 index 0000000..6b73ba0 --- /dev/null +++ b/python_okx_earn.egg-info/SOURCES.txt @@ -0,0 +1,34 @@ +README.md +setup.py +okx/Account.py +okx/BlockTrading.py +okx/Convert.py +okx/CopyTrading.py +okx/Earning.py +okx/FDBroker.py +okx/Funding.py +okx/Grid.py +okx/MarketData.py +okx/NDBroker.py +okx/PublicData.py +okx/SimpleEarnFixed.py +okx/SpreadTrading.py +okx/Status.py +okx/SubAccount.py +okx/Trade.py +okx/TradingData.py +okx/__init__.py +okx/consts.py +okx/exceptions.py +okx/okxclient.py +okx/utils.py +okx/websocket/WebSocketFactory.py +okx/websocket/WsPrivateAsync.py +okx/websocket/WsPublicAsync.py +okx/websocket/WsUtils.py +okx/websocket/__init__.py +python_okx_earn.egg-info/PKG-INFO +python_okx_earn.egg-info/SOURCES.txt +python_okx_earn.egg-info/dependency_links.txt +python_okx_earn.egg-info/requires.txt +python_okx_earn.egg-info/top_level.txt \ No newline at end of file diff --git a/python_okx_earn.egg-info/dependency_links.txt b/python_okx_earn.egg-info/dependency_links.txt new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/python_okx_earn.egg-info/dependency_links.txt @@ -0,0 +1 @@ + diff --git a/python_okx_earn.egg-info/requires.txt b/python_okx_earn.egg-info/requires.txt new file mode 100644 index 0000000..e3caa1b --- /dev/null +++ b/python_okx_earn.egg-info/requires.txt @@ -0,0 +1,7 @@ +importlib-metadata +httpx[http2] +keyring +loguru +requests +Twisted +pyOpenSSL diff --git a/python_okx_earn.egg-info/top_level.txt b/python_okx_earn.egg-info/top_level.txt new file mode 100644 index 0000000..b1e0c4f --- /dev/null +++ b/python_okx_earn.egg-info/top_level.txt @@ -0,0 +1 @@ +okx diff --git a/setup.py b/setup.py index b91e237..3715e47 100644 --- a/setup.py +++ b/setup.py @@ -4,10 +4,10 @@ with open("README.md", "r",encoding="utf-8") as fh: long_description = fh.read() setuptools.setup( - name="python-okx", + name="python-okx-earn", version=okx.__version__, - author="okxv5api", - author_email="api@okg.com", + author="nsanchez1980", + author_email="nicolassanchez@tutanota.com", description="Python SDK for OKX", long_description=long_description, long_description_content_type="text/markdown",