Home

Awesome

pyCosmicWrap 🌯

A python3 wrapper around Cosmos API/RPC brought to you by ChihuahuaChain

Info

pyCosmicWrap 🌯 makes it easier to develop python applications on the Cosmos Ecosystem. It currently has been tested with ChihuahuaChain and the first stable release will have it production-ready for almost every Cosmos Blockchain

Todo

There's a lot more to add, here's our plan, feel free to contribute with code improvements, testing and feel free to push a PR to help us to improve pyCosmicWrap and to make it the default choice for any Cosmos Ecosystem python developer. The next big step will be adding Mospy by ctrl-Felix in order to be able to create and broadcast transactions as well.

Installation

You can install this module with python -m pip install pycosmicwrap

API/LCD Queries

Bank Queries

Distribution Queries

Governance Queries

Slashing Queries

Staking Queries

Mint Queries

TX Queries

RPC Queries

Examples

Initialize the module and print basic info

from pycosmicwrap import CosmicWrap

# create an object with rest api url, rpc url and denom as arguments
chihuahua = CosmicWrap(lcd='https://api.chihuahua.wtf',
                       rpc='https://rpc.chihuahua.wtf',
                       denom='uhuahua')

# Once the module is imported and the object is created we can start using
# the object to interact with the blockchain

# Let's define an address
my_address = 'chihuahua1z6rfp8wzsx87pwt3z73gf2a67d6tgmfrrlzy7p'

# Let's create a variable with your balance
my_address_balance = chihuahua.query_balances(my_address)

# or just print it out
print(my_address_balance)

# check all of your delegations
my_delegations = chihuahua.query_delegations_by_address(my_address)

# and print them out
print(my_delegations)

# check all of your staking rewards
print(chihuahua.query_rewards(my_address))

Donate

We don't seek for donations, but you can say Thank You for our work by delegating to our validators and by sharing this project on Twitter

License

ChihuahuaChain/pyCosmicWrap is licensed under the GNU General Public License v3.0