Coder Social home page Coder Social logo

wy / namebase-exchange-python Goto Github PK

View Code? Open in Web Editor NEW
22.0 4.0 8.0 41 KB

Namebase Exchange API for Python

Home Page: https://namebase-exchange-python.readthedocs.io

License: MIT License

Python 100.00%
python python3 namebase handshake-protocol

namebase-exchange-python's Introduction

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

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

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

from namebase_exchange.websocket_data import *
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.

namebase-exchange-python's People

Contributors

akgnah avatar sourceful-sharon avatar t-900-a avatar v1xingyue avatar wy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

namebase-exchange-python's Issues

400 Client Error

I use the following code...

exchange = Exchange(API_KEY, API_SECRET)
exchange.limit_buy(symbol = Symbol.HNSBTC, price = 0.00004687, quantity = 1.0, receive_window = None)

But the HTTPError raised

requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://www.namebase.io/api/v0/order

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.