aiotx


Nameaiotx JSON
Version 2.1.0 PyPI version JSON
download
home_pagehttps://github.com/Grommash9/aiotx
SummaryAn asynchronous library for interacting with various cryptocurrencies and blockchains
upload_time2024-05-24 03:31:44
maintainerNone
docs_urlNone
authorOleksandr Prudnikov
requires_pythonNone
licenseNone
keywords cryptocurrency blockchain bitcoin ethereum asyncio aiohttp json-rpc payment wallet transaction
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ## AioTx

AioTx is a comprehensive Python package designed to simplify and streamline your cryptocurrency operations. Whether you're working with Ethereum Virtual Machine (EVM) based networks, UTXO-based networks like Bitcoin and Litecoin, or TRON, AioTx provides a unified and user-friendly interface for interacting with these blockchains.

I created AioTx because I wanted to consolidate all the crypto operations that I frequently use into one convenient package. The goal was to have a collection of crypto clients that I regularly work with, all in one place, with a consistent and intuitive API.

Key Features
------------

1. **EVM Client:** AioTx offers an EVM client that supports popular EVM-based networks such as Ethereum, Binance Smart Chain, Polygon, Avalanche, Fantom, Cronos, and more. With the EVM client, you can easily generate addresses, retrieve balances, send transactions, interact with smart contracts, and perform various other operations.

2. **UTXO Client:** For UTXO-based networks like Bitcoin and Litecoin, AioTx provides a UTXO client. This client allows you to generate addresses, import addresses for monitoring, retrieve balances, estimate fees, and send transactions effortlessly. The UTXO client also includes support for bulk transactions, enabling you to send multiple transactions in a single operation.

3. **TRON Client:** NOT YET IMPLEMENTED

4. **Blockchain Monitoring:** One of the standout features of AioTx is its blockchain monitoring capabilities. You can easily monitor new blocks and transactions on the supported blockchains by registering custom handlers. AioTx provides a simple and intuitive way to start and stop monitoring, and it even allows you to monitor multiple clients simultaneously. Integration with the Aiogram library is also supported, enabling you to send notifications or perform actions based on the received blocks and transactions.

5. **Database Storage:** AioTx includes built-in support for database storage, allowing you to store transaction and UTXO data for efficient monitoring and management. You have the flexibility to choose between SQLite and MySQL as the database backend, both of which have been thoroughly tested and are known to work seamlessly with AioTx.

6. **Testing:** To ensure the reliability and stability of AioTx, the package is extensively covered by tests. The test suite includes comprehensive test cases for various scenarios, networks, and operations. AioTx utilizes the VCR (Video Cassette Recorder) library to record and replay network interactions, making the tests deterministic and independent of external services.

Getting Node Url
----------------

For testing purposes, you can use public nodes, but for production, it's better to get a private or at least a shared node. You can obtain one for free on platforms like [Get Block](https://account.getblock.io/sign-in?ref=NWUzNjUzNjktY2EzMy01YzI3LWFlZDUtZjYzYmM1OWU0NmFk) or [Quick Node](https://www.quicknode.com/?via=aiotx)

By using these referral URLs, you'll be supporting the project, and I would greatly appreciate your contribution.


Getting Started
---------------

To start using AioTx, simply install the package using pip:

```python
   pip install aiotx
```

Once installed, you can import the desired client and start interacting with the respective blockchain. Here's a quick example of how to use the EVM client:

Sending Bulk Transactions (Bitcoin):
```python
from aiotx.clients import AioTxBTCClient

async def main():
    btc_client = AioTxBTCClient("NODE_URL")
    
    destinations = {
        "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa": 1000000,
        "1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2": 500000
    }
    
    private_key = "YOUR_PRIVATE_KEY"
    txid = await btc_client.send_bulk(private_key, destinations)
    print(f"Transaction ID: {txid}")

asyncio.run(main())
```

Sending Tokens (Ethereum):
```python
from aiotx.clients import AioTxETHClient

async def main():
    eth_client = AioTxETHClient("NODE_URL")
    
    private_key = "YOUR_PRIVATE_KEY"
    to_address = "0x742d35Cc6634C0532925a3b844Bc454e4438f44e"
    token_address = "0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984"  # Example token address (Uniswap)
    amount = eth_client.to_wei(10, "ether")  # Sending 10 tokens
    
    tx_hash = await eth_client.send_token(private_key, to_address, token_address, amount)
    print(f"Transaction Hash: {tx_hash}")

asyncio.run(main())
```

Sending Native Currency (Ethereum):
```python
from aiotx.clients import AioTxETHClient

async def main():
    eth_client = AioTxETHClient("NODE_URL")
    
    private_key = "YOUR_PRIVATE_KEY"
    to_address = "0x742d35Cc6634C0532925a3b844Bc454e4438f44e"
    amount = eth_client.to_wei(0.5, "ether")  # Sending 0.5 ETH
    
    tx_hash = await eth_client.send(private_key, to_address, amount)
    print(f"Transaction Hash: {tx_hash}")

asyncio.run(main())
```

Sending Native Currency (Bitcoin):
```python
from aiotx.clients import AioTxBTCClient

async def main():
    btc_client = AioTxBTCClient("NODE_URL")
    
    private_key = "YOUR_PRIVATE_KEY"
    to_address = "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa"
    amount = 1000000  # Sending 0.01 BTC (amount is in satoshis)
    
    txid = await btc_client.send(private_key, to_address, amount)
    print(f"Transaction ID: {txid}")

asyncio.run(main())
```

Satoshi Conversions:
```python
from aiotx.clients import AioTxBTCClient

async def main():
    btc_client = AioTxBTCClient("NODE_URL")
    
    # Converting satoshis to BTC
    satoshis = 1000000
    btc = btc_client.from_satoshi(satoshis)
    print(f"{satoshis} satoshis = {btc} BTC")
    
    # Converting BTC to satoshis
    btc = 0.01
    satoshis = btc_client.to_satoshi(btc)
    print(f"{btc} BTC = {satoshis} satoshis")

asyncio.run(main())
```

These examples showcase the simplicity and flexibility of using AioTx for various cryptocurrency operations. Whether you're sending bulk transactions, sending tokens, sending native currency, or converting between different units, AioTx provides a consistent and intuitive API for interacting with different blockchains.


For more detailed usage instructions and examples, please refer to the documentation for each client and feature.

I hope you find AioTx helpful and enjoy using it for your crypto operations. If you have any questions, feedback, or suggestions, please don't hesitate to reach out. Happy coding!

For more detailed usage examples and API reference, please refer to the documentation.

https://grommash9.github.io/aiotx/

# Contributing
Contributions to AioTx are welcome! If you find any bugs, have feature requests, or want to contribute improvements, please open an issue or submit a pull request on the GitHub repository.

# License
AioTx is open-source software licensed under the MIT License.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Grommash9/aiotx",
    "name": "aiotx",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "cryptocurrency, blockchain, bitcoin, ethereum, asyncio, aiohttp, json-rpc, payment, wallet, transaction",
    "author": "Oleksandr Prudnikov",
    "author_email": "prudnikov21@icloud.com",
    "download_url": "https://files.pythonhosted.org/packages/bc/e8/c91fe380be90eb70eb8df70143b9f52eb7d0ff7b0ed8e40a331d34734fc4/aiotx-2.1.0.tar.gz",
    "platform": null,
    "description": "## AioTx\n\nAioTx is a comprehensive Python package designed to simplify and streamline your cryptocurrency operations. Whether you're working with Ethereum Virtual Machine (EVM) based networks, UTXO-based networks like Bitcoin and Litecoin, or TRON, AioTx provides a unified and user-friendly interface for interacting with these blockchains.\n\nI created AioTx because I wanted to consolidate all the crypto operations that I frequently use into one convenient package. The goal was to have a collection of crypto clients that I regularly work with, all in one place, with a consistent and intuitive API.\n\nKey Features\n------------\n\n1. **EVM Client:** AioTx offers an EVM client that supports popular EVM-based networks such as Ethereum, Binance Smart Chain, Polygon, Avalanche, Fantom, Cronos, and more. With the EVM client, you can easily generate addresses, retrieve balances, send transactions, interact with smart contracts, and perform various other operations.\n\n2. **UTXO Client:** For UTXO-based networks like Bitcoin and Litecoin, AioTx provides a UTXO client. This client allows you to generate addresses, import addresses for monitoring, retrieve balances, estimate fees, and send transactions effortlessly. The UTXO client also includes support for bulk transactions, enabling you to send multiple transactions in a single operation.\n\n3. **TRON Client:** NOT YET IMPLEMENTED\n\n4. **Blockchain Monitoring:** One of the standout features of AioTx is its blockchain monitoring capabilities. You can easily monitor new blocks and transactions on the supported blockchains by registering custom handlers. AioTx provides a simple and intuitive way to start and stop monitoring, and it even allows you to monitor multiple clients simultaneously. Integration with the Aiogram library is also supported, enabling you to send notifications or perform actions based on the received blocks and transactions.\n\n5. **Database Storage:** AioTx includes built-in support for database storage, allowing you to store transaction and UTXO data for efficient monitoring and management. You have the flexibility to choose between SQLite and MySQL as the database backend, both of which have been thoroughly tested and are known to work seamlessly with AioTx.\n\n6. **Testing:** To ensure the reliability and stability of AioTx, the package is extensively covered by tests. The test suite includes comprehensive test cases for various scenarios, networks, and operations. AioTx utilizes the VCR (Video Cassette Recorder) library to record and replay network interactions, making the tests deterministic and independent of external services.\n\nGetting Node Url\n----------------\n\nFor testing purposes, you can use public nodes, but for production, it's better to get a private or at least a shared node. You can obtain one for free on platforms like [Get Block](https://account.getblock.io/sign-in?ref=NWUzNjUzNjktY2EzMy01YzI3LWFlZDUtZjYzYmM1OWU0NmFk) or [Quick Node](https://www.quicknode.com/?via=aiotx)\n\nBy using these referral URLs, you'll be supporting the project, and I would greatly appreciate your contribution.\n\n\nGetting Started\n---------------\n\nTo start using AioTx, simply install the package using pip:\n\n```python\n   pip install aiotx\n```\n\nOnce installed, you can import the desired client and start interacting with the respective blockchain. Here's a quick example of how to use the EVM client:\n\nSending Bulk Transactions (Bitcoin):\n```python\nfrom aiotx.clients import AioTxBTCClient\n\nasync def main():\n    btc_client = AioTxBTCClient(\"NODE_URL\")\n    \n    destinations = {\n        \"1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa\": 1000000,\n        \"1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2\": 500000\n    }\n    \n    private_key = \"YOUR_PRIVATE_KEY\"\n    txid = await btc_client.send_bulk(private_key, destinations)\n    print(f\"Transaction ID: {txid}\")\n\nasyncio.run(main())\n```\n\nSending Tokens (Ethereum):\n```python\nfrom aiotx.clients import AioTxETHClient\n\nasync def main():\n    eth_client = AioTxETHClient(\"NODE_URL\")\n    \n    private_key = \"YOUR_PRIVATE_KEY\"\n    to_address = \"0x742d35Cc6634C0532925a3b844Bc454e4438f44e\"\n    token_address = \"0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984\"  # Example token address (Uniswap)\n    amount = eth_client.to_wei(10, \"ether\")  # Sending 10 tokens\n    \n    tx_hash = await eth_client.send_token(private_key, to_address, token_address, amount)\n    print(f\"Transaction Hash: {tx_hash}\")\n\nasyncio.run(main())\n```\n\nSending Native Currency (Ethereum):\n```python\nfrom aiotx.clients import AioTxETHClient\n\nasync def main():\n    eth_client = AioTxETHClient(\"NODE_URL\")\n    \n    private_key = \"YOUR_PRIVATE_KEY\"\n    to_address = \"0x742d35Cc6634C0532925a3b844Bc454e4438f44e\"\n    amount = eth_client.to_wei(0.5, \"ether\")  # Sending 0.5 ETH\n    \n    tx_hash = await eth_client.send(private_key, to_address, amount)\n    print(f\"Transaction Hash: {tx_hash}\")\n\nasyncio.run(main())\n```\n\nSending Native Currency (Bitcoin):\n```python\nfrom aiotx.clients import AioTxBTCClient\n\nasync def main():\n    btc_client = AioTxBTCClient(\"NODE_URL\")\n    \n    private_key = \"YOUR_PRIVATE_KEY\"\n    to_address = \"1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa\"\n    amount = 1000000  # Sending 0.01 BTC (amount is in satoshis)\n    \n    txid = await btc_client.send(private_key, to_address, amount)\n    print(f\"Transaction ID: {txid}\")\n\nasyncio.run(main())\n```\n\nSatoshi Conversions:\n```python\nfrom aiotx.clients import AioTxBTCClient\n\nasync def main():\n    btc_client = AioTxBTCClient(\"NODE_URL\")\n    \n    # Converting satoshis to BTC\n    satoshis = 1000000\n    btc = btc_client.from_satoshi(satoshis)\n    print(f\"{satoshis} satoshis = {btc} BTC\")\n    \n    # Converting BTC to satoshis\n    btc = 0.01\n    satoshis = btc_client.to_satoshi(btc)\n    print(f\"{btc} BTC = {satoshis} satoshis\")\n\nasyncio.run(main())\n```\n\nThese examples showcase the simplicity and flexibility of using AioTx for various cryptocurrency operations. Whether you're sending bulk transactions, sending tokens, sending native currency, or converting between different units, AioTx provides a consistent and intuitive API for interacting with different blockchains.\n\n\nFor more detailed usage instructions and examples, please refer to the documentation for each client and feature.\n\nI hope you find AioTx helpful and enjoy using it for your crypto operations. If you have any questions, feedback, or suggestions, please don't hesitate to reach out. Happy coding!\n\nFor more detailed usage examples and API reference, please refer to the documentation.\n\nhttps://grommash9.github.io/aiotx/\n\n# Contributing\nContributions to AioTx are welcome! If you find any bugs, have feature requests, or want to contribute improvements, please open an issue or submit a pull request on the GitHub repository.\n\n# License\nAioTx is open-source software licensed under the MIT License.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "An asynchronous library for interacting with various cryptocurrencies and blockchains",
    "version": "2.1.0",
    "project_urls": {
        "Documentation": "https://grommash9.github.io/aiotx/",
        "Homepage": "https://github.com/Grommash9/aiotx",
        "Source": "https://github.com/Grommash9/aiotx"
    },
    "split_keywords": [
        "cryptocurrency",
        " blockchain",
        " bitcoin",
        " ethereum",
        " asyncio",
        " aiohttp",
        " json-rpc",
        " payment",
        " wallet",
        " transaction"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1f2c347b61f3b5d9faa16def507345d96787d2dca5967757e321c56a2d646a2e",
                "md5": "39adb410b9355a4a5cc10ed1b9f3d3b5",
                "sha256": "1dc5f60853b9f69025a713b793cac97e6666fe4054003ca82f9719e46a443de9"
            },
            "downloads": -1,
            "filename": "aiotx-2.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "39adb410b9355a4a5cc10ed1b9f3d3b5",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 15982,
            "upload_time": "2024-05-24T03:31:42",
            "upload_time_iso_8601": "2024-05-24T03:31:42.286419Z",
            "url": "https://files.pythonhosted.org/packages/1f/2c/347b61f3b5d9faa16def507345d96787d2dca5967757e321c56a2d646a2e/aiotx-2.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bce8c91fe380be90eb70eb8df70143b9f52eb7d0ff7b0ed8e40a331d34734fc4",
                "md5": "f90d143c8818f7ffce2a006b04082db3",
                "sha256": "35ed60d73e2c7ea8c956afb1a1d2ded0e58b15298a7dc2cdf2c40e702dc4f118"
            },
            "downloads": -1,
            "filename": "aiotx-2.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "f90d143c8818f7ffce2a006b04082db3",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 1382508,
            "upload_time": "2024-05-24T03:31:44",
            "upload_time_iso_8601": "2024-05-24T03:31:44.238858Z",
            "url": "https://files.pythonhosted.org/packages/bc/e8/c91fe380be90eb70eb8df70143b9f52eb7d0ff7b0ed8e40a331d34734fc4/aiotx-2.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-24 03:31:44",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Grommash9",
    "github_project": "aiotx",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "aiotx"
}
        
Elapsed time: 0.30380s