Welcome to python-idex v1.0.0¶
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
- https://pypi.python.org/pypi/python-idex
- Source code
- https://github.com/sammchardy/python-idex
- Documentation
- https://python-idex.readthedocs.io/en/latest/
Features¶
- Implementation of all REST endpoints except for deposit.
- Helper functions for your wallet address
- Response exception handling
- Websockets for Python 3.5+
Synchronous Examples¶
api_key = 'api:jVXLd5h1bEYcKgZbQru2k'
address = '<address_string>'
private_key = '<private_key_string>'
from idex.client import Client
client = Client(api_key, address, private_key)
# get currencies
currencies = client.get_currencies()
# get market depth
depth = client.get_order_book('ETH_SENT')
# get your balances
balances = client.get_my_balances()
# get your open orders
orders = client.get_my_open_orders('ETH_SENT')
# create a limit order
order = client.create_order('SENT', 'ETH', '0.001', '10000')
Async Examples for Python 3.5+¶
from idex.asyncio import AsyncClient, IdexSocketManager, SubscribeCategory
loop = None
async def main():
global loop
# Initialise the client
client = await AsyncClient(api_key, address, private_key)
# get currencies
currencies = await client.get_currencies()
# get market depth
depth = await client.get_order_book('ETH_SENT')
# get your balances
balances = await client.get_my_balances()
# get your open orders
orders = await client.get_my_open_orders('ETH_SENT')
# create a limit order
order = await client.create_order('SENT', 'ETH', '0.001', '10000')
# Coroutine to receive messages
async def handle_evt(msg):
print(f"event:{msg['event']} payload:{msg['payload']}")
# do something with this event
# Initialise the socket manager with the callback funciton
ism = await IdexSocketManager.create(loop, handle_evt, api_key)
# Subscribe to updates for the ETH_SENT, ETH_AURA and ETH_IDXM market for cancels, orders and trades
await ism.subscribe(
SubscribeCategory.markets,
['ETH_SENT', 'ETH_AURA', 'ETH_IDXM'],
['market_cancels', 'market_orders', 'market_trades']
)
# 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 Binance Chain check out my python-binance-chain library.
If you use Kucoin check out my python-kucoin 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 BigONE check out my python-bigone library.
Contents¶
- Getting Started
- Currency Endpoints
- Market Endpoints
- Exchange Endpoints
- Order Endpoints
- Account Endpoints
- Withdraw Endpoints
- Async
- Websockets
- Exceptions
- Changelog
- v1.0.0 - 2019-08-14
- v0.3.6 - 2019-06-29
- v0.3.5 - 2019-02-11
- v0.3.4 - 2019-01-15
- v0.3.3 - 2018-08-08
- v0.3.2 - 2018-06-27
- v0.3.1 - 2018-06-27
- v0.3.0 - 2018-06-21
- v0.2.7 - 2018-01-30
- v0.2.6 - 2018-01-29
- v0.2.5 - 2018-01-29
- v0.2.4 - 2018-01-23
- v0.2.3 - 2018-01-20
- v0.2.2 - 2018-01-20
- v0.2.1 - 2018-01-19
- v0.2.0 - 2017-11-16
- v0.1.0 - 2017-11-15
- Idex API