A python library for interacting with cosmos based blockchain networks
To install the project use:
pip3 install cosmpy
Below is a simple example using the SigningCosmWasmClient
and the RestClient
channel.
from cosmpy.clients.signing_cosmwasm_client import SigningCosmWasmClient
from cosmpy.common.rest_client import RestClient
channel = RestClient("https://<rest endpoint addres>")
client = SigningCosmWasmClient(private_key, channel, "<chain id>")
res = client.get_balance(client.address, "stake")
print(f"Balance: {res.balance.amount} {res.balance.denom}")