idex rest api python实现

python-idex的Python项目详细描述


https://img.shields.io/pypi/v/python-idex.svghttps://img.shields.io/pypi/l/python-idex.svghttps://img.shields.io/travis/sammchardy/python-idex.svghttps://img.shields.io/coveralls/sammchardy/python-idex.svghttps://img.shields.io/pypi/wheel/python-idex.svghttps://img.shields.io/pypi/pyversions/python-idex.svg

这是一个用于IDEX exchanges REST API v1的非正式python包装器。我不属于IDEX,使用风险自负。

pypi
https://pypi.python.org/pypi/python-idex
源代码
https://github.com/sammchardy/python-idex
文档
https://python-idex.readthedocs.io/en/latest/

功能

  • 实现除存款之外的所有rest端点。
  • 钱包地址的帮助功能
  • 响应异常处理
  • 用于Python3.5+的WebSocket

升级

如果您使用的是较旧版本的python idex<;1.0.0,则需要为rest客户端使用api密钥 和WebSocket客户端。见下面的例子。

快速启动

IDEX注册帐户。

pip install python-idex

同步示例

api_key='api:jVXLd5h1bEYcKgZbQru2k'address='<address_string>'private_key='<private_key_string>'fromidex.clientimportClientclient=Client(api_key,address,private_key)# get currenciescurrencies=client.get_currencies()# get market depthdepth=client.get_order_book('ETH_SENT')# get your balancesbalances=client.get_my_balances()# get your open ordersorders=client.get_my_open_orders('ETH_SENT')# create a limit orderorder=client.create_order('SENT','ETH','0.001','10000')

python 3.5+的异步示例

fromidex.asyncioimportAsyncClient,IdexSocketManager,SubscribeCategoryloop=Noneasyncdefmain():globalloop# Initialise the clientclient=awaitAsyncClient(api_key,address,private_key)# get currenciescurrencies=awaitclient.get_currencies()# get market depthdepth=awaitclient.get_order_book('ETH_SENT')# get your balancesbalances=awaitclient.get_my_balances()# get your open ordersorders=awaitclient.get_my_open_orders('ETH_SENT')# create a limit orderorder=awaitclient.create_order('SENT','ETH','0.001','10000')# Coroutine to receive messagesasyncdefhandle_evt(msg):print(f"event:{msg['event']} payload:{msg['payload']}")# do something with this event# Initialise the socket manager with the callback funcitonism=awaitIdexSocketManager.create(loop,handle_evt,api_key)# Subscribe to updates for the ETH_SENT, ETH_AURA and ETH_IDXM market for cancels, orders and tradesawaitism.subscribe(SubscribeCategory.markets,['ETH_SENT','ETH_AURA','ETH_IDXM'],['market_cancels','market_orders','market_trades'])# keep the script running so we can retrieve websocket eventswhileTrue:awaitasyncio.sleep(20,loop=loop)if__name__=="__main__":# get a loop and switch from synchronous to asyncloop=asyncio.get_event_loop()loop.run_until_complete(main())

更多check out the documentation

待办事项

  • 存款端点

其他交易所

如果您使用Binance请查看我的python-binance库。

如果您使用Binance Chain请查看我的python-binance-chain库。

如果您使用Kucoin请查看我的python-kucoin库。

如果使用Quoinex 或者Qryptos查看我的python-quoine库。

如果您使用Allcoin请查看我的python-allucoin库。

如果您使用Exx请查看我的python-exx库。

如果您使用BigONE请查看我的python-bigone库。

https://analytics-pixel.appspot.com/UA-111417213-1/github/python-idex?pixel

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java日期格式的月和日的固定长度?   无法将java ArrayList<String>转换为字符串。   java当我使用log4j 1.2.15时,编译时出现错误;当更改为1.2.16时,一切正常   java如何使用ArgumentMatchers将任何队列告知Mockito?   如何解决“java”。Java电子邮件API中的lang.ExceptionInInitializerError   java是实例化对象名并设置其值的通用方法   java在多线程环境中,如果一个线程崩溃,如何关闭JVM?   java WebDriverManager在selenium中获取不正确版本的驱动程序   如果JAVA中后减量的优先级高于前增量,那么为什么下面的代码输出为22.0而不是20.0。?   在hibernate中找不到java属性   当我用java运行调度程序时,什么都没有发生   jackson如何在java中从数据库中检索json对象   java安卓:如何在自定义适配器中设置侦听器并获取imagebutton单击的位置   java MySQLIntegrityConstraintViolationException:列“问题id”不能为空错误   JavaSpring自定义注销过滤器在注销前执行一些操作?   java如何返回常量集合   java使用subselect进行一对多分页   java二进制搜索基础。陷入无限循环