IDEX REST API python implementation
Project description
This is an unofficial Python wrapper for the IDEX exchanges REST API v1. I am in no way affiliated with IDEX, use at your own risk.
- PyPi
- Source code
- Documentation
Features
Implementation of all REST endpoints except for deposit.
Helper functions for your wallet address
Response exception handling
Websockets for Python 3.5+
Quick Start
Register an account with IDEX.
pip install python-idex
Synchronous Examples
from idex.client import Client
client = Client(address, private_key)
# get currencies
currencies = client.get_currencies()
# get market depth
depth = client.get_order_book('ETH_SAN')
# get your balances
balances = client.get_my_balances()
# get your open orders
orders = client.get_my_open_orders('ETH_SAN')
# create a limit order
order = client.create_order('SAN', 'ETH', '0.001', '10000')
Async Examples for Python 3.5+
from idex.asyncio import AsyncClient, IdexSocketManager
loop = None
async def main():
global loop
# Initialise the client
client = await AsyncClient()
# get currencies
currencies = await client.get_currencies()
# get market depth
depth = await client.get_order_book('ETH_SAN')
# get your balances
balances = await client.get_my_balances()
# get your open orders
orders = await client.get_my_open_orders('ETH_SAN')
# create a limit order
order = await client.create_order('SAN', 'ETH', '0.001', '10000')
# Initialise the socket manager
ism = await IdexSocketManager.create(loop)
# Coroutine to receive messages
async def handle_evt(msg, topic):
print("topic:{} type:{}".format(topic, msg['type']))
# Subscribe to updates for the ETH_NPXS market
await ism.subscribe('ETH_NPXS', handle_evt)
# keep the script running so we can retrieve websocket events
while True:
await asyncio.sleep(20, loop=loop)
if __name__ == "__main__":
# get a loop and switch from synchronous to async
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
For more check out the documentation.
TODO
Deposit endpoints
Donate
If this library helped you out feel free to donate.
ETH: 0xD7a7fDdCfA687073d7cC93E9E51829a727f9fE70
NEO: AVJB4ZgN7VgSUtArCt94y7ZYT6d5NDfpBo
LTC: LPC5vw9ajR1YndE1hYVeo3kJ9LdHjcRCUZ
BTC: 1Dknp6L6oRZrHDECRedihPzx2sSfmvEBys
Other Exchanges
If you use Binance check out my python-binance library.
If you use Quoinex or Qryptos check out my python-quoine library.
If you use Allcoin check out my python-allucoin library.
If you use Exx check out my python-exx library.
If you use Kucoin check out my python-kucoin library.
If you use BigONE check out my python-bigone library.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for python_idex-0.3.4-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fe51b20452cf1e6d9a5c42b2c0e2f04dc0fc02f19d8786e084c86aee3799f5eb |
|
MD5 | 7374905231da6b4e9fc7c293e40686b9 |
|
BLAKE2b-256 | 68185e85bce9be1bc46c8a8629cdb551510a22b4478d1cba09e399dbe4cbcbb0 |