Skip to main content

No project description provided

Project description

Introduction

Python client for THORNode API

THORChain has several APIs - Midgard, THORNode, Cosmos RPC, CometBFT RPC. This python client focuses on interactions with the basic THORNode API.

Built for API version 3.10.0.

API Swagger Docs

Progress

Below is the implementation status of the major sections of THORNode API in this Python client:

Section Implemented Notes
Auth
Bank
Health
Pools
Pool Slip
Liquidity Providers
Codes Not supported in current API
Oracle Not supported in current API
TCY Stakers
TCY Claimers
RUNE Pool
Savers
Borrowers
Transactions
Nodes
Vaults
Network Partially implemented
Streaming Swap
Clout
Trade Unit
Trade Account
Secured Assets
Swap
Queue Partially implemented
TSS
Thornames
Mimir
Quote Loan & saver features not active in current API
Invariants
Block
Export Not supported in current API

If you notice any discrepancy or want a section prioritized, please open an issue or PR.

TODOs

  • Exceptions handling and keeping API response's error message
  • More detailed tests
  • Fill in missing endpoints in partially implemented sections

Installation

Normal installation

pip install thornode-py

Development installation

git clone https://github.com/jpleorx/thornode-py.git
cd thornode-py
pip install --editable .

Usage

from thornode_py import THORNodeAPI

api = THORNodeAPI()

# Check that it's online
ping = api.ping()

# Check API version
version = api.version()

# Get nodes
nodes = api.nodes()

# Get pools
pools = api.pools()

# Get thorname
thorname = api.thorname("example")

# Get swap quote
quote = api.quote_swap(
    from_asset="BTC.BTC",
    to_asset="ETH.ETH",
    amount=100000,
    destination="0x1c7b17362c84287bd1184447e6dfeaf920c31bbe",
)

Links

In case you’d like to check my other work or contact me:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

thornode-py-0.0.1.tar.gz (22.7 kB view details)

Uploaded Source

Built Distribution

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

thornode_py-0.0.1-py3-none-any.whl (36.0 kB view details)

Uploaded Python 3

File details

Details for the file thornode-py-0.0.1.tar.gz.

File metadata

  • Download URL: thornode-py-0.0.1.tar.gz
  • Upload date:
  • Size: 22.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.6

File hashes

Hashes for thornode-py-0.0.1.tar.gz
Algorithm Hash digest
SHA256 b904a2399570810e84de3bd3989d2893be99f95e7c9b999090587e5bcd8d78ee
MD5 884fc2f3342fc3269e8022412ccd23ce
BLAKE2b-256 5efdd84f1766ff9b5af40964d1b16c4e46182be19dea0d129a5764f633ce1312

See more details on using hashes here.

File details

Details for the file thornode_py-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: thornode_py-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 36.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.6

File hashes

Hashes for thornode_py-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0df79a745ed3d828c2d03b1920a9d8a2f5cfbf0199080ffd2ee40d8f07f0ecc8
MD5 1f42a827e09f1d807e21d54d5b88c28e
BLAKE2b-256 2a27b4c6804179149bd8cb0734ef818d986ce370ae0fc44524df6f03fc39b7ff

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