Package: pyCosmicWrap
pyCosmicWrap 🌯A python3 wrapper around Cosmos API/RPC brought to you byChihuahuaChainInfopyCosmicWrap 🌯 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 BlockchainTodoThere'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 addingMospy by ctrl-Felixin order to be able to create and broadcast transactions as well.Wrap main default API endpointsWrap main RPC endpointsPublished onPyPiAdd Osmosis specific endpointsIntegrateMospy by ctrl-FelixInstallationYou can install this module withpython -m pip install pycosmicwrapAPI/LCD QueriesBank Queriesquery_balances(address)queries the balance of all coins for a single accountquery_balances_by_denom(address, denom)queries the balance of a single coin for a single account.query_supply()queries the total supply of all coins.query_supply_by_denom(denom)queries the supply of a single coin.Distribution Queriesquery_community_pool()queries the community pool coinsquery_distribution_params()queries the blockchain distribution parametersquery_rewards(delegator)queries the total rewards accrued by a each validatorquery_rewards_by_validator(delegator, validator)queries the total rewards accrued by a delegation on a given validatorquery_delegator_validators(delegator)queries the validators of a delegatorquery_withdraw_address(delegator)queries withdraw address of a delegatorquery_commission(validator)queries accumulated commission for a validatorquery_outstanding_rewards(validator)queries rewards of a validator addressGovernance Queriesquery_proposals()queries all the proposalsquery_proposal_by_id(id)queries a specific proposal by a given id (accepts both string or integers)query_tally(id)queries tally of a proposal by a given id (accepts both string or integers)query_votes(id)queries votes for a specific proposal by a given id (accepts both string or integers)query_votes_by_address(id, address)queries votes for a specific proposal from a given address (accepts both string or integers)Slashing Queriesquery_slashing_params()queries slashing parametersStaking Queriesquery_staking_params()queries staking parametersquery_staking_pool()queries staking poolquery_delegations_by_address(delegator)queries all the delegations of a given addressquery_redelegations_by_address(delegator)queries all the redelegations of a given addressquery_unbonding_by_address(delegator)queries all the unbondings of a given addressquery_delegator_data(delegator)queries delegator data of a given addressquery_delegator_data_by_validator(delegator, validator)queries delegator data of a given address on a given validatorquery_all_validators()queries all the validatorsquery_validator_by_address(validator)queries data for a given validatorquery_delegators(validator)queries all the delegators for a given validatorquery_delegators_by_address(validator, delegator)queries a given delegator's data for a given validatorquery_validator_unbonding_by_address)queries a given delegator's unbonding data for a given validatorquery_unbonding_from(validator)queries all the unbonding of a give validatorMint Queriesquery_mint_params()queries mint parametersquery_annual_provisions()queries annual provisionsquery_mint_params()queries current inflation percentageTX Queriesquery_tx(tx_hash)queries a given transaction hashRPC Queriesquery_abci_info()queries abci infoquery_block(height)queries a given block heightquery_block_results(height)queries a given block results by its heightquery_commit(height)queries a given commit by its heightquery_consensus_state()queries consensus statequery_dump_consensus_state()dumps consensus statequery_genesis()queries the current genesisquery_net_info()queries network infoquery_num_unconfirmed_txs()queries the amount of unconfirmed txsquery_status()queries the node status.ExamplesInitialize the module and print basic infofrompycosmicwrapimportCosmicWrap# create an object with rest api url, rpc url and denom as argumentschihuahua=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 addressmy_address='chihuahua1z6rfp8wzsx87pwt3z73gf2a67d6tgmfrrlzy7p'# Let's create a variable with your balancemy_address_balance=chihuahua.query_balances(my_address)# or just print it outprint(my_address_balance)# check all of your delegationsmy_delegations=chihuahua.query_delegations_by_address(my_address)# and print them outprint(my_delegations)# check all of your staking rewardsprint(chihuahua.query_rewards(my_address))DonateWe don't seek for donations, but you can say Thank You for our work bydelegating to our validatorsand bysharing this project on TwitterLicenseChihuahuaChain/pyCosmicWrap is licensed under theGNU General Public License v3.0