Skip to content

SantaHub/cosmpy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

CosmPy

PyPI PyPI - Python Version PyPI - Wheel License

AEA framework sanity checks and tests Contributor Covenant

A python library for interacting with cosmos based blockchain networks

Installing

To install the library use:

pip3 install cosmpy

Getting Started

Below is a simple example for querying an account's balances:

from cosmpy.aerial.client import LedgerClient, NetworkConfig

# connect to Fetch.ai network using default parameters
ledger_client = LedgerClient(NetworkConfig.fetchai_mainnet())

alice: str = 'fetch12q5gw9l9d0yyq2th77x6pjsesczpsly8h5089x'
balances = ledger_client.query_bank_all_balances(alice)

# show all coin balances
for coin in balances:
  print(f'{coin.amount}{coin.denom}')

Documentation

Before running this command make sure your development environment is set up. Check Development setup for more details.

To see the documentation:

make docs-live

Then navigate to the following URL in your browser:

http://127.0.0.1:8000/cosmpy/

Examples

Under the examples directory, you can find examples of basic ledger interactions using cosmpy e.g. transferring tokens, staking, deploying and interacting with a smart contract, and performing atomic swaps.

To contribute

Please see CONTRIBUTING and DEVELOPING guides.

Extra Resources

About

Cosmpy with updated cosmos sdk

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages