comdexpy


Namecomdexpy JSON
Version 0.5 PyPI version JSON
download
home_page
SummaryPython SDK for interacting with comdex node
upload_time2024-03-12 09:27:27
maintainer
docs_urlNone
authorComdex
requires_python
license
keywords python comdex comdex sdk comdexpy pycomdex comdex python sdk
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            

![](comdexpy/docs/images/imgcomdex.png)



# comdexpy


The comdexpy is a comprehensive Python library designed to provide developers with easy access to the Comdex blockchain and its ecosystem. 
This library enables developers to interact with the blockchain, query data, and perform various operations within the Comdex ecosystem.




## Installation


```bash
  pip3 install comdexpy
```
    

## Usage

### Creating a connection

```python

import asyncio
from comdexpy.client import Client

async def get_connection():
    grpc_url = "comdex-grpc.lavenderfive.com"
    return Client.from_endpoint(grpc_url, 443)

async def main():
    connection = await get_connection()
    connection.close()

if __name__ == "__main__":
    asyncio.run(main())

```

### Querying on comdex node using connection

```python

import asyncio
from comdexpy.client import Client
from comdexpy.queries.comdex.liquidity import Query as LiquidityQueries

async def get_connection():
    grpc_url = "comdex-grpc.lavenderfive.com"
    return Client.from_endpoint(grpc_url, 443)

async def sample_query(channel):
    liquidity = LiquidityQueries(channel)
    params = await liquidity.get_generic_params(1)
    print(params.to_dict())

async def main():
    connection = await get_connection()
    await sample_query(connection.channel())
    connection.close()

if __name__ == "__main__":
    asyncio.run(main())

```

### Sending transaction on comdex node

```python
import asyncio
from comdexpy.client import Client
from comdexpy.wallet import Wallet

from comdexpy.messages.cosmos.bank import MsgSend
from comdexpy.proto.cosmos.base.v1beta1 import Coin

from comdexpy.send_tx import SignAndBroadcastMessage

async def get_connection():
    grpc_url = "comdex-grpc.lavenderfive.com"
    return Client.from_endpoint(grpc_url, 443)

async def sample_tx(connection):
    wallet = Wallet.from_mnemonic("seeds here")
    sender = wallet.get_address().to_acc_bech32()
    msg_send = MsgSend(
        from_address=sender,
        to_address="comdex",
        amount=[Coin(amount="1000000", denom="ucmdx")],
    )
    response = await SignAndBroadcastMessage.send_tx(connection, wallet, msg_send)
    print(response)

async def main():
    connection = await get_connection()
    await sample_tx(connection)
    connection.close()


if __name__ == "__main__":
    asyncio.run(main())

```

### Complete Usage

![](https://github-production-user-asset-6210df.s3.amazonaws.com/43311385/245070505-bd499173-2d64-4ab5-8b60-e5254affeec1.png)

## Documentation

You can read the documentation [here.](https://comdex-official.github.io/comdexpy/comdexpy/docs/docs/html/index.html)


## Feedback

If you have any feedback, please reach out to us at https://forum.comdex.one/


## License

This software is licensed under the GPL-3.0 license. See [LICENSE](https://comdex-official.github.io/comdexpy/LICENSE) for full disclosure.



[![GPLv3 License](https://img.shields.io/badge/License-GPL%20v3-yellow.svg)](https://opensource.org/licenses/)








            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "comdexpy",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "python,comdex,comdex sdk,comdexpy,pycomdex,comdex python sdk",
    "author": "Comdex",
    "author_email": "<dheeraj@comdex.one>",
    "download_url": "https://files.pythonhosted.org/packages/74/ad/3fb588b2f2a2ca7104fdb4631432c465750ed17aaadc13594bcfe255452a/comdexpy-0.5.tar.gz",
    "platform": null,
    "description": "\n\n![](comdexpy/docs/images/imgcomdex.png)\n\n\n\n# comdexpy\n\n\nThe comdexpy is a comprehensive Python library designed to provide developers with easy access to the Comdex blockchain and its ecosystem. \nThis library enables developers to interact with the blockchain, query data, and perform various operations within the Comdex ecosystem.\n\n\n\n\n## Installation\n\n\n```bash\n  pip3 install comdexpy\n```\n    \n\n## Usage\n\n### Creating a connection\n\n```python\n\nimport asyncio\nfrom comdexpy.client import Client\n\nasync def get_connection():\n    grpc_url = \"comdex-grpc.lavenderfive.com\"\n    return Client.from_endpoint(grpc_url, 443)\n\nasync def main():\n    connection = await get_connection()\n    connection.close()\n\nif __name__ == \"__main__\":\n    asyncio.run(main())\n\n```\n\n### Querying on comdex node using connection\n\n```python\n\nimport asyncio\nfrom comdexpy.client import Client\nfrom comdexpy.queries.comdex.liquidity import Query as LiquidityQueries\n\nasync def get_connection():\n    grpc_url = \"comdex-grpc.lavenderfive.com\"\n    return Client.from_endpoint(grpc_url, 443)\n\nasync def sample_query(channel):\n    liquidity = LiquidityQueries(channel)\n    params = await liquidity.get_generic_params(1)\n    print(params.to_dict())\n\nasync def main():\n    connection = await get_connection()\n    await sample_query(connection.channel())\n    connection.close()\n\nif __name__ == \"__main__\":\n    asyncio.run(main())\n\n```\n\n### Sending transaction on comdex node\n\n```python\nimport asyncio\nfrom comdexpy.client import Client\nfrom comdexpy.wallet import Wallet\n\nfrom comdexpy.messages.cosmos.bank import MsgSend\nfrom comdexpy.proto.cosmos.base.v1beta1 import Coin\n\nfrom comdexpy.send_tx import SignAndBroadcastMessage\n\nasync def get_connection():\n    grpc_url = \"comdex-grpc.lavenderfive.com\"\n    return Client.from_endpoint(grpc_url, 443)\n\nasync def sample_tx(connection):\n    wallet = Wallet.from_mnemonic(\"seeds here\")\n    sender = wallet.get_address().to_acc_bech32()\n    msg_send = MsgSend(\n        from_address=sender,\n        to_address=\"comdex\",\n        amount=[Coin(amount=\"1000000\", denom=\"ucmdx\")],\n    )\n    response = await SignAndBroadcastMessage.send_tx(connection, wallet, msg_send)\n    print(response)\n\nasync def main():\n    connection = await get_connection()\n    await sample_tx(connection)\n    connection.close()\n\n\nif __name__ == \"__main__\":\n    asyncio.run(main())\n\n```\n\n### Complete Usage\n\n![](https://github-production-user-asset-6210df.s3.amazonaws.com/43311385/245070505-bd499173-2d64-4ab5-8b60-e5254affeec1.png)\n\n## Documentation\n\nYou can read the documentation [here.](https://comdex-official.github.io/comdexpy/comdexpy/docs/docs/html/index.html)\n\n\n## Feedback\n\nIf you have any feedback, please reach out to us at https://forum.comdex.one/\n\n\n## License\n\nThis software is licensed under the GPL-3.0 license. See [LICENSE](https://comdex-official.github.io/comdexpy/LICENSE) for full disclosure.\n\n\n\n[![GPLv3 License](https://img.shields.io/badge/License-GPL%20v3-yellow.svg)](https://opensource.org/licenses/)\n\n\n\n\n\n\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Python SDK for interacting with comdex node",
    "version": "0.5",
    "project_urls": null,
    "split_keywords": [
        "python",
        "comdex",
        "comdex sdk",
        "comdexpy",
        "pycomdex",
        "comdex python sdk"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "aead0c20579ffa2a696fda1701bfd6cf4e8a360bd34e98d80a74e900c79f98c0",
                "md5": "b930c4881dd4b01d8bea5b09f8f6ea55",
                "sha256": "d9248dffc7525a1ce2aca0ce7d1cad2a00f8baa375d98734a968729e3c3fb5b2"
            },
            "downloads": -1,
            "filename": "comdexpy-0.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b930c4881dd4b01d8bea5b09f8f6ea55",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 203607,
            "upload_time": "2024-03-12T09:27:25",
            "upload_time_iso_8601": "2024-03-12T09:27:25.046779Z",
            "url": "https://files.pythonhosted.org/packages/ae/ad/0c20579ffa2a696fda1701bfd6cf4e8a360bd34e98d80a74e900c79f98c0/comdexpy-0.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "74ad3fb588b2f2a2ca7104fdb4631432c465750ed17aaadc13594bcfe255452a",
                "md5": "8514a8aa8a676686bed3083afc412c0f",
                "sha256": "af19b4b49e6864c4633ccd3cd5575bb1e32ec096baba5efb1832bb745aa2f73f"
            },
            "downloads": -1,
            "filename": "comdexpy-0.5.tar.gz",
            "has_sig": false,
            "md5_digest": "8514a8aa8a676686bed3083afc412c0f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 157270,
            "upload_time": "2024-03-12T09:27:27",
            "upload_time_iso_8601": "2024-03-12T09:27:27.628222Z",
            "url": "https://files.pythonhosted.org/packages/74/ad/3fb588b2f2a2ca7104fdb4631432c465750ed17aaadc13594bcfe255452a/comdexpy-0.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-12 09:27:27",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "comdexpy"
}
        
Elapsed time: 0.27557s