A library to make developing python based programs on cosmos chains easier
Project description
python-ibc
A library used to condense down-chain queries in an easy-to-use way.
Includes:
- Coingecko token price query
- chain_apis (rest, rpc, denom, logo png, twitter, explorers, staking & gov pages, coingecko_id, & chain_registery )
Used by
Used in / for:
- https://github.com/Reecepbcups/cosmos-validator-income-tracker (prices, queries, etc.)
- https://github.com/Reecepbcups/cosmos-governance-bot
- https://github.com/Reecepbcups/cosmos-balance-bot
Example usage
from pyibc_api import get_chain, ChainInfo
info: ChainInfo
info = get_chain("juno")
print(info) # gets chain data
# Returns:
# class ChainInfo:
# '''Object to track important data about a chain'''
# name: str
# denom: str
# coingecko_id: str
# bech32_prefix: str
# rest_root: str
# rpc_root: str
# twitter: str
# logo: str
# chain_registry: str
# explorers: dict
from pyibc_chain.validators import get_latest_validator_set_sorted
for idx, op_addr in enumerate(get_latest_validator_set_sorted(info.rest_root, bondedOnly=True), 1):
print(idx, op_addr, vals[op_addr])
if idx > 10: break
from cosmpy_price import get_price
print(get_price(['juno-network', "cmdx"]))
# print(get_price('juno-network')) # also works
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
python-ibc-0.2.0.tar.gz
(12.1 kB
view details)
Built Distribution
File details
Details for the file python-ibc-0.2.0.tar.gz
.
File metadata
- Download URL: python-ibc-0.2.0.tar.gz
- Upload date:
- Size: 12.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fcf5309a463bf8493ca3d06d948b8515adfb40ac8cfc4147ba07c0eb0cf1f5d5 |
|
MD5 | 9c7f2258dff7e5697a461def8ad32fe8 |
|
BLAKE2b-256 | 7dd3ab5f5f22898e4208e63e41a0d3c4018ae9458fc50df1737499b6581459de |
File details
Details for the file python_ibc-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: python_ibc-0.2.0-py3-none-any.whl
- Upload date:
- Size: 12.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cc84f1acf08dc1cfc49e9b37bcdbec2afffe285cf3520e79546e0d0fadc51944 |
|
MD5 | 098a829f317ef9453d87d449ac1a4cfd |
|
BLAKE2b-256 | 70a83833487c0f259da79e76f71c7718d40ef56418d20e676248d913f0b69418 |