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
print(get_chain("juno")) # gets chain data
# {
# "denom": "ujuno",
# "name": "Juno",
# "coingecko_id": "juno-network",
# "explorers": {
# "ping": 'https://ping.pub/juno',
# "mintscan": 'https://www.mintscan.io/juno',
# "keplr": 'https://wallet.keplr.app/chains/juno',
# },
# "rest_root": "https://lcd-juno.itastakers.com", # https://rest.cosmos.directory/juno
# "rpc_root": "https://rpc.cosmos.directory/juno",
# "twitter": "@JunoNetwork",
# "logo": "https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/juno.png",
# "chain-registry": "https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/chain.json",
# }
from pyibc_chain.validators import get_latest_validator_set_sorted
for idx, op_addr in enumerate(get_latest_validator_set_sorted(get_chain("juno")['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.1.2.tar.gz
(13.9 kB
view hashes)
Built Distribution
python_ibc-0.1.2-py3-none-any.whl
(14.0 kB
view hashes)
Close
Hashes for python_ibc-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b30a4cde15ac92760626eea36895dc9b46ba288ab436982aed525e3a30194f4e |
|
MD5 | aa9ed22fd6927eeec97d021f5df74044 |
|
BLAKE2b-256 | bcd8494920c09ac0838bb31b833d3f1dcbed83deaf1d7070f283d20ea2455479 |