Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/reecepbcups/python-ibc
Chain APIs, queries, and helper functions
https://github.com/reecepbcups/python-ibc
Last synced: 2 months ago
JSON representation
Chain APIs, queries, and helper functions
- Host: GitHub
- URL: https://github.com/reecepbcups/python-ibc
- Owner: Reecepbcups
- License: mit
- Created: 2022-08-14T22:53:32.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-27T15:03:00.000Z (4 months ago)
- Last Synced: 2024-08-27T16:40:02.068Z (4 months ago)
- Language: Python
- Size: 86.9 KB
- Stars: 4
- Watchers: 3
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# python-ibc
A library used to condense down-chain queries in an easy-to-use way.
Includes:
```bash
- 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:
- (prices, queries, etc.)
-
-## Example usage
```py
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: dictfrom 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: breakfrom cosmpy_price import get_price
print(get_price(['juno-network', "cmdx"]))
# print(get_price('juno-network')) # also works
```