{"id":13573060,"url":"https://github.com/ChihuahuaChain/pyCosmicWrap","last_synced_at":"2025-04-04T11:31:14.378Z","repository":{"id":115094852,"uuid":"532880076","full_name":"ChihuahuaChain/pyCosmicWrap","owner":"ChihuahuaChain","description":"A python3 wrapper around Cosmos API/RPC brought to you by ChihuahuaChain","archived":false,"fork":false,"pushed_at":"2023-01-26T11:48:03.000Z","size":148,"stargazers_count":8,"open_issues_count":0,"forks_count":8,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-04-12T01:49:36.506Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ChihuahuaChain.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2022-09-05T11:57:20.000Z","updated_at":"2024-04-08T15:15:08.000Z","dependencies_parsed_at":"2024-01-03T05:19:55.812Z","dependency_job_id":"fcba61c7-545e-4c9f-b231-6d2c8ca07a1e","html_url":"https://github.com/ChihuahuaChain/pyCosmicWrap","commit_stats":{"total_commits":9,"total_committers":4,"mean_commits":2.25,"dds":0.6666666666666667,"last_synced_commit":"a63ebffa65d0f5fc80c80073ccfbced8efb1bb28"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChihuahuaChain%2FpyCosmicWrap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChihuahuaChain%2FpyCosmicWrap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChihuahuaChain%2FpyCosmicWrap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChihuahuaChain%2FpyCosmicWrap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ChihuahuaChain","download_url":"https://codeload.github.com/ChihuahuaChain/pyCosmicWrap/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247170179,"owners_count":20895427,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T15:00:28.522Z","updated_at":"2025-04-04T11:31:09.359Z","avatar_url":"https://github.com/ChihuahuaChain.png","language":"Python","funding_links":[],"categories":["Client Libraries"],"sub_categories":["Python"],"readme":"# pyCosmicWrap 🌯\n_A python3 wrapper around Cosmos API/RPC brought to you by [ChihuahuaChain](https://chihuahua.wtf)_\n\n# Info\npyCosmicWrap 🌯 makes it easier to develop python applications on the Cosmos Ecosystem.\nIt currently has been tested with ChihuahuaChain and the first stable release will have it production-ready for almost every Cosmos Blockchain\n\n# Todo\nThere'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](https://github.com/ctrl-Felix/mospy) in order to be able to create and broadcast transactions as well.\n\n- [x] Wrap main default API endpoints\n- [x] Wrap main RPC endpoints\n- [x] Published on [PyPi](https://pypi.org/project/pyCosmicWrap/) \n- [ ] Add Osmosis specific endpoints\n- [ ] Integrate [Mospy by ctrl-Felix](https://github.com/ctrl-Felix/mospy)\n\n## Installation\n\nYou can install this module with\n`python -m pip install pycosmicwrap`\n\n# API/LCD Queries\n\n## Bank Queries\n- `query_balances(address)` _queries the balance of all coins for a single account_\n- `query_balances_by_denom(address, denom)` _queries the balance of a single coin for a single account._\n- `query_supply()` _queries the total supply of all coins._\n- `query_supply_by_denom(denom)` _queries the supply of a single coin._\n\n## Distribution Queries\n- `query_community_pool()` _queries the community pool coins_\n- `query_distribution_params()` _queries the blockchain distribution parameters_\n- `query_rewards(delegator)` _queries the total rewards accrued by a each validator_\n- `query_rewards_by_validator(delegator, validator)` _queries the total rewards accrued by a delegation on a given validator_\n- `query_delegator_validators(delegator)` _queries the validators of a delegator_\n- `query_withdraw_address(delegator)` _queries withdraw address of a delegator_\n- `query_commission(validator)` _queries accumulated commission for a validator_\n- `query_outstanding_rewards(validator)` _queries rewards of a validator address_\n\n## Governance Queries\n- `query_proposals()` _queries all the proposals_\n- `query_proposal_by_id(id)` _queries a specific proposal by a given id (accepts both string or integers)_\n- `query_tally(id)` _queries tally of a proposal by a given id (accepts both string or integers)_\n- `query_votes(id)` _queries votes for a specific proposal by a given id (accepts both string or integers)_\n- `query_votes_by_address(id, address)` _queries votes for a specific proposal from a given address (accepts both string or integers)_\n\n## Slashing Queries\n- `query_slashing_params()` _queries slashing parameters_\n\n## Staking Queries\n- `query_staking_params()` _queries staking parameters_\n- `query_staking_pool()` _queries staking pool_\n- `query_delegations_by_address(delegator)` _queries all the delegations of a given address_\n- `query_redelegations_by_address(delegator)` _queries all the redelegations of a given address_\n- `query_unbonding_by_address(delegator)` _queries all the unbondings of a given address_\n- `query_delegator_data(delegator)` _queries delegator data of a given address_\n- `query_delegator_data_by_validator(delegator, validator)` _queries delegator data of a given address on a given validator_\n- `query_all_validators()` _queries all the validators_\n- `query_validator_by_address(validator)` _queries data for a given validator_\n- `query_delegators(validator)` _queries all the delegators for a given validator_\n- `query_delegators_by_address(validator, delegator)` _queries a given delegator's data for a given validator_\n- `query_validator_unbonding_by_address)` _queries a given delegator's unbonding data for a given validator_\n- `query_unbonding_from(validator)` _queries all the unbonding of a give validator_\n\n## Mint Queries\n- `query_mint_params()` _queries mint parameters_\n- `query_annual_provisions()` _queries annual provisions_\n- `query_mint_params()` _queries current inflation percentage_\n\n## TX Queries\n- `query_tx(tx_hash)` _queries a given transaction hash_\n\n# RPC Queries\n\n- `query_abci_info()` _queries abci info_\n- `query_block(height)` _queries a given block height_\n- `query_block_results(height)` _queries a given block results by its height_\n- `query_commit(height)` _queries a given commit by its height_\n- `query_consensus_state()` _queries consensus state_\n- `query_dump_consensus_state()` _dumps consensus state_\n- `query_genesis()` _queries the current genesis_\n- `query_net_info()` _queries network info_\n- `query_num_unconfirmed_txs()` _queries the amount of unconfirmed txs_\n- `query_status()` _queries the node status._\n\n\n\n# Examples\n\n#### Initialize the module and print basic info\n```python\nfrom pycosmicwrap import CosmicWrap\n\n# create an object with rest api url, rpc url and denom as arguments\nchihuahua = CosmicWrap(lcd='https://api.chihuahua.wtf',\n                       rpc='https://rpc.chihuahua.wtf',\n                       denom='uhuahua')\n\n# Once the module is imported and the object is created we can start using\n# the object to interact with the blockchain\n\n# Let's define an address\nmy_address = 'chihuahua1z6rfp8wzsx87pwt3z73gf2a67d6tgmfrrlzy7p'\n\n# Let's create a variable with your balance\nmy_address_balance = chihuahua.query_balances(my_address)\n\n# or just print it out\nprint(my_address_balance)\n\n# check all of your delegations\nmy_delegations = chihuahua.query_delegations_by_address(my_address)\n\n# and print them out\nprint(my_delegations)\n\n# check all of your staking rewards\nprint(chihuahua.query_rewards(my_address))\n\n```\n\n\n# Donate\nWe don't seek for donations, but you can say Thank You for our work by [delegating to our validators](https://delegate.chihuahua.wtf) and by [sharing this project on Twitter](https://twitter.com/intent/tweet?text=Check%20out%20%23pyCosmicWrap%20%F0%9F%8C%AF%20by%20%40ChihuahuaChain%20-%20A%20%23python%20wrapper%20for%20%40cosmos%20on%20https%3A//github.com/ChihuahuaChain/pyCosmicWrap%20%23HUAHUA%20%23Chihuahua%20%23WOOF%0A)\n\n# License\nChihuahuaChain/pyCosmicWrap is licensed under the [GNU General Public License v3.0](https://choosealicense.com/licenses/gpl-3.0/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FChihuahuaChain%2FpyCosmicWrap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FChihuahuaChain%2FpyCosmicWrap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FChihuahuaChain%2FpyCosmicWrap/lists"}