Skip to main content

htx crypto exchange api client

Project description

htx-python

Python SDK (sync and async) for Htx cryptocurrency exchange with Rest and WS capabilities.

You can check the SDK docs here: SDK You can check Htx's docs here: Docs

This package derives from CCXT and allows you to call pretty much every endpoint by either using the unified CCXT API or calling the endpoints directly

Installation

pip install htx

Usage

Sync

from htx import HtxSync

def main():
    instance = HtxSync({})
    ob =  instance.fetch_order_book("BTC/USDC")
    print(ob)
    #
    # balance = instance.fetch_balance()
    # order = instance.create_order("BTC/USDC", "limit", "buy", 1, 100000)

Async

import asyncio
from htx import HtxAsync

async def main():
    instance = HtxAsync({})
    ob =  await instance.fetch_order_book("BTC/USDC")
    print(ob)
    #
    # balance = await instance.fetch_balance()
    # order = await instance.create_order("BTC/USDC", "limit", "buy", 1, 100000)

asyncio.run(main())

Websockets

from htx import HtxWs

async def main():
    instance = HtxWs({})
    while True:
        ob = await instance.watch_order_book("BTC/USDC")
        print(ob)
        # orders = await instance.watch_orders("BTC/USDC")

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

htx-0.0.16.tar.gz (633.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

htx-0.0.16-py3-none-any.whl (755.4 kB view details)

Uploaded Python 3

File details

Details for the file htx-0.0.16.tar.gz.

File metadata

  • Download URL: htx-0.0.16.tar.gz
  • Upload date:
  • Size: 633.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for htx-0.0.16.tar.gz
Algorithm Hash digest
SHA256 63a9efa007c945e74525e03391b9b2f862a289aa97f662849892c8c98032fcd1
MD5 f3c2191be70ab608338fbcf0b4db0a08
BLAKE2b-256 a7d00deba0c32384915a762bb6a828dcfbf017893b7488c9ad9c65753a1db506

See more details on using hashes here.

File details

Details for the file htx-0.0.16-py3-none-any.whl.

File metadata

  • Download URL: htx-0.0.16-py3-none-any.whl
  • Upload date:
  • Size: 755.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for htx-0.0.16-py3-none-any.whl
Algorithm Hash digest
SHA256 54f7e142b02819364c294738048beaccdfa99c2fb4c636ec13938597f22055e6
MD5 d1b6c55f9dc7bde44fb6625bda122935
BLAKE2b-256 ee202a43a6c5c981fec834b8322a2057f3a03614ed897ba6e9cfe08b838fbc2a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page