{ "info": { "author": "Thomas Saunders", "author_email": "tom@nash.io", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "Natural Language :: English", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "Getting started\n---------------\n\n**Requires Python 3** (``brew install python3``)\n\nSetup a virtual env and install the dependencies (needed when cloning or downloading a dist)::\n\n # Setup and activate a venv with Python 3\n python3 -m venv venv\n . venv/bin/activate\n\n # Install from Pypi\n (venv) pip install nash-api\n\n\nTo get the current version of the Python client::\n\n nash-utils --version\n\nYou can test connectivity with `nash-utils` like this::\n\n nash-utils --list-markets\n\nSee the help with ``nash-utils -h``.\n\n------------\n\nBelow is a basic example of usage:\n\n\n.. code-block:: python\n\n >>> from nash import NashApi, CurrencyAmount, CurrencyPrice\n >>> api = NashApi()\n\n >>> # Some calls don't require login\n >>> api.list_markets()\n [Market(id='market:eth_neo', a_unit='eth', a_unit_precision=8, b_unit='neo', b_unit_precision=8, min_tick_size='0.001', min_trade_size='0.02000000', min_trade_size_b='0.50000000', min_trade_increment='0.00001', min_trade_increment_b='0.001', name='eth_neo', status='RUNNING'),\n Market(id='market:eth_bat', a_unit='eth', a_unit_precision=7, b_unit='bat', b_unit_precision=7, min_tick_size='0.01', min_trade_size='0.0200000', min_trade_size_b='10.0000000', min_trade_increment='0.00001', min_trade_increment_b='0.01', name='eth_bat', status='RUNNING'),\n ...]\n\n >>> # Now let's login\n >>> api.login(\"you@email.com\", \"password\")\n\n >>> # Getting the current balances. Note: balances in the trading account appear under \"available\"\n >>> api.list_account_balances(ignore_low_balance=True)\n [AccountBalance(asset=Asset(blockchain='eth', blockchain_precision=18, deposit_precision=8, hash='0000000000000000000000000000000000000000', name='Ethereum', symbol='eth', withdrawal_precision=8), available=CurrencyAmount(amount='21.5670000000000000000000000', currency='eth'), deposit_address='433CEAA0B6E98AB129DBDC4A3435F652ADA7BE7D', in_orders=CurrencyAmount(amount='0.0000000000000000000000000', currency='eth'), pending=CurrencyAmount(amount='0.0000000000000000000000000', currency='eth'), personal=CurrencyAmount(amount='0.029271040000000000', currency='eth')),\n AccountBalance(asset=Asset(blockchain='eth', blockchain_precision=18, deposit_precision=8, hash='8462d1140c9dc51641c90a26a27849cca8d5e6e0', name='Basic Attention Token', symbol='bat', withdrawal_precision=8), available=CurrencyAmount(amount='0.00000000', currency='bat'), deposit_address='433CEAA0B6E98AB129DBDC4A3435F652ADA7BE7D', in_orders=CurrencyAmount(amount='0.00000000', currency='bat'), pending=CurrencyAmount(amount='0.00000000', currency='bat'), personal=CurrencyAmount(amount='11.000000000000000000', currency='bat')),\n AccountBalance(asset=Asset(blockchain='eth', blockchain_precision=18, deposit_precision=8, hash='aed88173df2578fad078c48a33f0040364989fa8', name='USD Coin', symbol='usdc', withdrawal_precision=8), available=CurrencyAmount(amount='0.00000000', currency='usdc'), deposit_address='433CEAA0B6E98AB129DBDC4A3435F652ADA7BE7D', in_orders=CurrencyAmount(amount='0.00000000', currency='usdc'), pending=CurrencyAmount(amount='0.00000000', currency='usdc'), personal=CurrencyAmount(amount='51.000000000000000000', currency='usdc')),\n AccountBalance(asset=Asset(blockchain='neo', blockchain_precision=8, deposit_precision=8, hash='602c79718b16e442de58778e148d0b1084e3b2dffd5de6b7b16cee7969282de7', name='GAS', symbol='gas', withdrawal_precision=8), available=CurrencyAmount(amount='0.00000000', currency='gas'), deposit_address='ALU8PyEw5csvUKdccez65jM6WGAo6m7sEX', in_orders=CurrencyAmount(amount='0.00000000', currency='gas'), pending=CurrencyAmount(amount='0.00000000', currency='gas'), personal=CurrencyAmount(amount='2.00000000', currency='gas')),\n AccountBalance(asset=Asset(blockchain='neo', blockchain_precision=8, deposit_precision=0, hash='c56f33fc6ecfcd0c225c4ab356fee59390af8560be0e930faebe74a6daff7c9b', name='NEO', symbol='neo', withdrawal_precision=0), available=CurrencyAmount(amount='7.3620487500000000000000000', currency='neo'), deposit_address='ALU8PyEw5csvUKdccez65jM6WGAo6m7sEX', in_orders=CurrencyAmount(amount='0.0000000000000000000000000', currency='neo'), pending=CurrencyAmount(amount='0.0000000000000000000000000', currency='neo'), personal=CurrencyAmount(amount='5', currency='neo')),\n AccountBalance(asset=Asset(blockchain='neo', blockchain_precision=8, deposit_precision=8, hash='36dfd2c33d4948a8429d00fc00a5bd70e02520ef', name='nOS', symbol='nos', withdrawal_precision=8), available=CurrencyAmount(amount='0.00000000', currency='nos'), deposit_address='ALU8PyEw5csvUKdccez65jM6WGAo6m7sEX', in_orders=CurrencyAmount(amount='0.00000000', currency='nos'), pending=CurrencyAmount(amount='0.00000000', currency='nos'), personal=CurrencyAmount(amount='50.00000000', currency='nos'))]\n\n >>> api.get_account_balance(\"eth\")\n AccountBalance(asset=Asset(blockchain='eth', blockchain_precision=18, deposit_precision=8, hash='30303030303030303030303030303030303030303030303030303030303030303030303030303030', name='Ethereum', symbol='eth', withdrawal_precision=8), available=CurrencyAmount(amount='21.5670000000000000000000000', currency='eth'), deposit_address=None, in_orders=CurrencyAmount(amount='0.0000000000000000000000000', currency='eth'), pending=CurrencyAmount(amount='0.0000000000000000000000000', currency='eth'), personal=CurrencyAmount())\n\n >>> # Placing an order. Note: ensure that you have funds in your trading account.\n >>> # Needs to show under \"available\" in the account balance response.\n >>> api.place_market_order(\"eth_neo\", CurrencyAmount(\"1.44\",\"eth\"), \"SELL\")\n OrderPlaced(id='5142749', status='PENDING')\n\n >>> # List all orders of this user\n >>> api.list_account_orders()\n OrderHistory(next=None, orders=[Order(amount=CurrencyAmount(amount='1.44000000', currency='eth'), buy_or_sell='SELL', cancel_at=None, cancellation_policy=None, id='5142749', limit_price=CurrencyPrice(), market=Market(a_unit='eth', a_unit_precision=8, b_unit='neo', b_unit_precision=8, min_tick_size='0.001', min_trade_size='0.02000000', min_trade_size_b='0.50000000', name='eth_neo', status='RUNNING'), placed_at=datetime.datetime(2019, 9, 24, 20, 55, 13, 389520, tzinfo=datetime.timezone.utc), status='FILLED', stop_price=CurrencyPrice(), trades=[Trade(amount=CurrencyAmount(amount='0.10000000', currency='eth'), executed_at=datetime.datetime(2019, 9, 24, 20, 55, 13, 389520, tzinfo=datetime.timezone.utc), id='vRrkuYrQ18Sr23rVWk_ul_40Br9zl_zoKXReeL6776g', limit_price=CurrencyPrice(amount='18.450', currency_a='neo', currency_b='eth'), market=Market(a_unit='eth', a_unit_precision=8, b_unit='neo', b_unit_precision=8, min_tick_size='0.001', min_trade_size='0.02000000', min_trade_size_b='0.50000000', name='eth_neo', status='RUNNING')), Trade(amount=CurrencyAmount(amount='0.10000000', currency='eth'), executed_at=datetime.datetime(2019, 9, 24, 20, 55, 13, 389520, tzinfo=datetime.timezone.utc), id='Cb0S8iQwuBJA2m_3CqajA0EvmkaLtlZi_u0GNVyiLZI', limit_price=CurrencyPrice(amount='18.452', currency_a='neo', currency_b='eth'), market=Market(a_unit='eth', a_unit_precision=8, b_unit='neo', b_unit_precision=8, min_tick_size='0.001', min_trade_size='0.02000000', min_trade_size_b='0.50000000', name='eth_neo', status='RUNNING')), Trade(amount=CurrencyAmount(amount='0.10000000', currency='eth'), executed_at=datetime.datetime(2019, 9, 24, 20, 55, 13, 389520, tzinfo=datetime.timezone.utc), id='6QOfv9PSjxtsgD3NQYb2RN38Ud23FWBznLk2_BqMFKo', limit_price=CurrencyPrice(amount='18.451', currency_a='neo', currency_b='eth'), market=Market(a_unit='eth', a_unit_precision=8, b_unit='neo', b_unit_precision=8, min_tick_size='0.001', min_trade_size='0.02000000', min_trade_size_b='0.50000000', name='eth_neo', status='RUNNING')), Trade(amount=CurrencyAmount(amount='0.10000000', currency='eth'), executed_at=datetime.datetime(2019, 9, 24, 20, 55, 13, 389520, tzinfo=datetime.timezone.utc), id='HV6nZQgigjJnUCV1JJRUiF7C7FcS0RegjHuS5Jf6fNc', limit_price=CurrencyPrice(amount='18.452', currency_a='neo', currency_b='eth'), market=Market(a_unit='eth', a_unit_precision=8, b_unit='neo', b_unit_precision=8, min_tick_size='0.001', min_trade_size='0.02000000', min_trade_size_b='0.50000000', name='eth_neo', status='RUNNING'))], type='MARKET', amount_remaining=CurrencyAmount(amount='0.00000000', currency='eth'))])\n\n >>> # Cancelling an order (Note: it may take some time to actually cancel the order after this call returns)\n >>> api.cancel_order(\"5142749\", \"eth_neo\")\n CanceledOrder(order_id='5142749')\n\n\n\nDebug Options:\n--------------\n\nEnvironment variables:\n\n* ``DEBUG=1`` - enables DEBUG loglevel and prints all GQL requests and responses\n* ``GQL_PRINT_REQUEST=1`` - prints the GQL request before sending\n* ``GQL_PRINT_RESPONSE=1`` - prints the raw GQL json response after receiving\n* ``ENV=staging`` - Does the requests against the staging environment instead of local\n* ``LOGLEVEL=debug`` - Set loglevel to [``debug``, ``info`` (default), ``warning``, ``error``, ``critical``]\n\n\nDocumentation\n-------------\n\nGenerate the documentation with ``make docs`` or ``make docs-watch``.\n\nThe Python inline docs are using `Google Style Python Docstrings `_ (`2 `_)\n\nWe use the Sphinx autodoc extension to automatically generate the docs:\n\n* http://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html\n\n\nFeedback & Issues\n-----------------\n\nPlease submit feedback, issues and improvement requests via https://gitlab.com/nash-io-public/api-client-python/issues\n\n\n=======\nHistory\n=======\n\n1.0.0 (2019-04-18)\n------------------\n* Initial release\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://gitlab.com/nash-io-public/api-client-python", "keywords": "nash,ethereum,neo,python,dex", "license": "MIT license", "maintainer": "", "maintainer_email": "", "name": "nash-api", "package_url": "https://pypi.org/project/nash-api/", "platform": "", "project_url": "https://pypi.org/project/nash-api/", "project_urls": { "Homepage": "https://gitlab.com/nash-io-public/api-client-python" }, "release_url": "https://pypi.org/project/nash-api/1.0.3/", "requires_dist": [ "logzero (==1.5.0)", "requests (==2.21.0)", "sgqlc (==7.0)" ], "requires_python": ">=3.6", "summary": "Nash API Client", "version": "1.0.3" }, "last_serial": 5915512, "releases": { "1.0.1": [ { "comment_text": "", "digests": { "md5": "a507ba0cca719ecf4c20b6efab92085a", "sha256": "d424e22c97c7925064036b5a0b583e5c0aa8f625f7de98fbe6ddbf68a8488a3b" }, "downloads": -1, "filename": "nash_api-1.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "a507ba0cca719ecf4c20b6efab92085a", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.6", "size": 8596065, "upload_time": "2019-10-01T18:04:42", "url": "https://files.pythonhosted.org/packages/37/ed/52476c9bd28d8c2feeb30c14d06b0d2268843dccbbe7d8fe1cbec006c068/nash_api-1.0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "67061546901676122513ce6d9cfa4390", "sha256": "4d25a4b22d6923576271fc5b462dce701c918f5b2be70d97c3d8befa33b72563" }, "downloads": -1, "filename": "nash-api-1.0.1.tar.gz", "has_sig": false, "md5_digest": "67061546901676122513ce6d9cfa4390", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 8578630, "upload_time": "2019-10-01T18:04:50", "url": "https://files.pythonhosted.org/packages/47/5f/b7c76a4ef0077ac8caef912b9a31f0125f8e7aec079cad2efa04da076187/nash-api-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "8e0d0e6fec8e466fa053e19230ac043e", "sha256": "30e94cc382129df79b89ddc71e871149ce7e8797c1cb07298f6e1fb5356ba87b" }, "downloads": -1, "filename": "nash_api-1.0.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "8e0d0e6fec8e466fa053e19230ac043e", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.6", "size": 8596446, "upload_time": "2019-10-01T18:26:38", "url": "https://files.pythonhosted.org/packages/55/df/9dccbf25885704235df2481aa14058b37450dba72f413291460071ae98b1/nash_api-1.0.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e9759b0e5a072040b06fe9db71359c72", "sha256": "41df0d8c4df603e648938e02a7374558f6b08e0eb8c0e85cc1dd341842ff3dc9" }, "downloads": -1, "filename": "nash-api-1.0.2.tar.gz", "has_sig": false, "md5_digest": "e9759b0e5a072040b06fe9db71359c72", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 8580518, "upload_time": "2019-10-01T18:27:03", "url": "https://files.pythonhosted.org/packages/99/18/ff503a0c9251bbfbfbfc73795d069509058e9fb2ff9c5cea6543de402cd3/nash-api-1.0.2.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "a2df94b95e2384ef11d72c9280e82216", "sha256": "0f3e2319214930a0d18c059ddd4cb119c1cade0a00881df815692cdda586461b" }, "downloads": -1, "filename": "nash_api-1.0.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "a2df94b95e2384ef11d72c9280e82216", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.6", "size": 8596449, "upload_time": "2019-10-02T00:21:14", "url": "https://files.pythonhosted.org/packages/48/3e/72fe0ea457754aee24ca6c537c2be02a67f6290ecef69a4a8be880d90a6a/nash_api-1.0.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d92594b5c3eefa2de181140b332ca23c", "sha256": "f9c76cec8c6ae04b01c65e5683a319dacb17260081134874a11d274b22e69961" }, "downloads": -1, "filename": "nash-api-1.0.3.tar.gz", "has_sig": false, "md5_digest": "d92594b5c3eefa2de181140b332ca23c", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 8580530, "upload_time": "2019-10-02T00:21:33", "url": "https://files.pythonhosted.org/packages/64/66/4039a838c12eb9c4bb51da06b6890fad63bc0110d9ac01ed7e6cd5d94b0c/nash-api-1.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a2df94b95e2384ef11d72c9280e82216", "sha256": "0f3e2319214930a0d18c059ddd4cb119c1cade0a00881df815692cdda586461b" }, "downloads": -1, "filename": "nash_api-1.0.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "a2df94b95e2384ef11d72c9280e82216", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.6", "size": 8596449, "upload_time": "2019-10-02T00:21:14", "url": "https://files.pythonhosted.org/packages/48/3e/72fe0ea457754aee24ca6c537c2be02a67f6290ecef69a4a8be880d90a6a/nash_api-1.0.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d92594b5c3eefa2de181140b332ca23c", "sha256": "f9c76cec8c6ae04b01c65e5683a319dacb17260081134874a11d274b22e69961" }, "downloads": -1, "filename": "nash-api-1.0.3.tar.gz", "has_sig": false, "md5_digest": "d92594b5c3eefa2de181140b332ca23c", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 8580530, "upload_time": "2019-10-02T00:21:33", "url": "https://files.pythonhosted.org/packages/64/66/4039a838c12eb9c4bb51da06b6890fad63bc0110d9ac01ed7e6cd5d94b0c/nash-api-1.0.3.tar.gz" } ] }