{"id":13589455,"url":"https://github.com/ctrl-Felix/mospy","last_synced_at":"2025-04-08T09:32:52.555Z","repository":{"id":48383084,"uuid":"516827391","full_name":"ctrl-Felix/mospy","owner":"ctrl-Felix","description":"Extendable python library for the cosmos ecosystem. ","archived":false,"fork":false,"pushed_at":"2024-08-03T15:06:49.000Z","size":936,"stargazers_count":39,"open_issues_count":1,"forks_count":20,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-02T04:04:31.824Z","etag":null,"topics":["blockchain","cosmos","evmos","mospy","osmosis"],"latest_commit_sha":null,"homepage":"https://mospy.ctrl-felix.de/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ctrl-Felix.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2022-07-22T17:02:05.000Z","updated_at":"2025-01-18T17:05:44.000Z","dependencies_parsed_at":"2023-12-27T22:30:36.407Z","dependency_job_id":"da5087b2-3c2e-4c6a-8417-be00718111fa","html_url":"https://github.com/ctrl-Felix/mospy","commit_stats":{"total_commits":25,"total_committers":1,"mean_commits":25.0,"dds":0.0,"last_synced_commit":"787bb03c43b683eaa23d4f6989fb7de08b2575c0"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctrl-Felix%2Fmospy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctrl-Felix%2Fmospy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctrl-Felix%2Fmospy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctrl-Felix%2Fmospy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ctrl-Felix","download_url":"https://codeload.github.com/ctrl-Felix/mospy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247814214,"owners_count":21000522,"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":["blockchain","cosmos","evmos","mospy","osmosis"],"created_at":"2024-08-01T16:00:30.388Z","updated_at":"2025-04-08T09:32:52.184Z","avatar_url":"https://github.com/ctrl-Felix.png","language":"Python","readme":"# MosPy\n\nMosPy is a fork of the cosmospy library and aims to be a versatile transaction signing library for the whole cosmos ecosystem.\nIt depends [cosmospy-protobuf](https://github.com/ctrl-Felix/cosmospy-protobuf) for the protos. Through this library you also can add your own transaction types and sign them through Mospy.\n\n## Documentation\n\nA documentation with according examples can be found at https://mospy.ctrl-felix.de\n\n## Get Started\n\nYou can find a tutorial series on medium: https://medium.com/@ctrl-felix/mospy-tutorial-1-the-basics-95ec757047dc\n\n## Installation\n\nMospy is available through (pypi)[https://pypi.org/project/mospy-wallet]\n\n`python -m pip install mospy-wallet`\n\n_Note: The package name in python is mospy even if it is called mospy-wallet on pypi as mospy already existed_\n\n## Quickstart\n\nMore examples on: https://mospy.ctrl-felix.de/examples/\n\n```python\nimport httpx # optional\nfrom mospy import Account, Transaction\n\naccount = Account(\n    seed_phrase=\"law grab theory better athlete submit awkward hawk state wedding wave monkey audit blame fury wood tag rent furnace exotic jeans drift destroy style\",\n    address_index=12\n)\n\ntx = Transaction(\n    account=account,\n    gas=1000,\n)\ntx.set_fee(\n    amount=100,\n    denom=\"uatom\"\n)\n# Add a transfer message to the transaction (multiple messages can be added)\ntx.add_msg(\n    tx_type='transfer',\n    sender=account,\n    receipient=\"cosmos1tkv9rquxr88r7snrg42kxdj9gsnfxxg028kuh9\",\n    amount=1000,\n    denom=\"uatom\"\n)\n\n# Sign and encode transaction to submit it to the network manually\n\n# REST endpoint (RPC or API)\ntx_bytes = tx.get_tx_bytes_as_string()\n\n# Submit the transaction through the Tendermint RPC\nrpc_url = \"https://rpc.cosmos.network/\"\npushable_tx = json.dumps(\n              {\n                \"jsonrpc\": \"2.0\",\n                \"id\": 1,\n                \"method\": \"broadcast_tx_sync\", # Available methods: broadcast_tx_sync, broadcast_tx_async, broadcast_tx_commit\n                \"params\": {\n                    \"tx\": tx_bytes\n                }\n              }\n            )\nr = httpx.post(rpc_url, data=pushable_tx)\n\n# Submit the transaction through the Cosmos REST API\nrpc_api = \"https://api.cosmos.network/cosmos/tx/v1beta1/txs\"\npushable_tx = json.dumps(\n                {\n                  \"tx_bytes\": tx_bytes,\n                  \"mode\": \"BROADCAST_MODE_SYNC\" # Available modes: BROADCAST_MODE_SYNC, BROADCAST_MODE_ASYNC, BROADCAST_MODE_BLOCK\n                }\n              )\nr = httpx.post(rpc_api, data=pushable_tx)\n```\n## Different transaction types\n\nMospy is created to support every possible external transaction type.\nTo make it easier some transaction types are built in and can be added directly to a transaction object.\nBut it's not difficult to add your own transaction types! More about transaction types can be found in the docs.\n","funding_links":[],"categories":["Client Libraries"],"sub_categories":["Python"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fctrl-Felix%2Fmospy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fctrl-Felix%2Fmospy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fctrl-Felix%2Fmospy/lists"}