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 )
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.0a1.tar.gz
(14.8 kB
view hashes)
Built Distribution
Close
Hashes for python_ibc-0.2.0a1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 39503198f9532ab296ca69049d074f43d88be6222aa46942045761c0641c1c97 |
|
MD5 | 563791c8f96b82d74d83792c1d417458 |
|
BLAKE2b-256 | 02214dd3598efe8aa0c7bfbc2065d7c3f2a1333da10fcb912427c7c350707140 |