项目作者: wy

项目描述 :
Namebase Exchange API for Python
高级语言: Python
项目地址: git://github.com/wy/namebase-exchange-python.git
创建时间: 2020-02-15T01:24:21Z
项目社区:https://github.com/wy/namebase-exchange-python

开源协议:MIT License

下载


Namebase Exchange Api for Python



Open Issues


Open Issues


PyPI


MIT Licence


Total alerts


Total alerts

Python 3.6+ client for interacting with Namebase Exchange API.

Usage

All requests require an API key. You can generate a key from https://www.namebase.io/pro.

At the time of writing, all documented API keys are supported. This may change at any time.
See the raw API documentation calls: https://github.com/namebasehq/exchange-api-documentation/

On top of the raw APIs, we also provide the convenience functions:

  • market_buy: Market Buy
  • market_sell: Market Sell
  • limit_buy: Limit Buy
  • limit_sell: Limit Sell
  • get_dns_settings: Get DNS Settings
  • update_dns_settings: Change DNS Settings

We’ve also provided a Websocket Client for the WSS API.

Installation

Requirements

  • Python 3.6 or greater

Install

pip install namebase_exchange

Usage

Core REST API for Namebase Exchange

  1. from namebase_exchange.exchange import *
  2. exchange = Exchange("YOUR_API_KEY", "YOUR_SECRET_KEY")
  3. exchange.get_depth(Symbol.HNSBTC)
  4. exchange.market_sell(Symbol.HNSBTC, '500')
  5. exchange.update_dns_settings(domain='YOUR_DOMAIN',
  6. record_type='TXT', host='@', value='skylink=YOUR_SKYLINK', ttl=0)

WebSocket API for Namebase Exchange
This doesn’t need any authorization

  1. from namebase_exchange.websocket_data import *
  2. exchange = ExchangeWS(Endpoint.DEPTH)

You can also pass functions in to do more sophisticated things with the message stream. By default,
it just prints out the messages.