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.14.0.
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 | ✅ | |
| 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:
- E-mail: leo.ertuna@gmail.com
- GitHub
- PyPI
- DockerHub
Metadata
Release files for thornode-py 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| thornode_py-0.0.3-py3-none-any.whl | Python 3 | none | any | Details for thornode_py-0.0.3-py3-none-any.whl |
Release files / thornode_py-0.0.3-py3-none-any.whl
| Download URL | thornode_py-0.0.3-py3-none-any.whl |
|---|---|
| Size | 37.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f1052b9147c4e2597035566dcf322006c359bed1d8c67123ca979d7d2229b0ba
|
|
BLAKE2b-256 checksum How to use checksums |
b11402fdc4afe2da8227fc327c624ad1de5148ecae123c130be5870e6dcb217f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.9.6
|
Security for thornode-py 0.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.