Chia-Py-RPC is a Python library that provides a convenient way to interact with the Chia blockchain using the Chia RPC (Remote Procedure Call) protocol.
Project description
Chia-Py-RPC
Chia-Py-RPC is a Python library that provides a convenient way to interact with the Chia blockchain using the Chia RPC (Remote Procedure Call) protocol. It allows you to send transactions, check balances, and perform other Chia-related operations programmatically from Python.
Features
- Send transactions to multiple recipients in a single transaction
- Check wallet balances and transaction history
- Get information about Chia blocks, coins, and transactions
- Create and manage Chia wallets
- Simple and easy-to-use
- Plus every RPC method avaliable in Chia Client 1.7.0 or previous.
Installation
To install Chia-Py-RPC, you can use pip
, the Python package manager. Open a terminal and run the following command:
pip install chia-py-rpc
Usage
Here's an example of how you can use Chia-Py-RPC to send transactions to multiple recipients in a single transaction:
from chia_py_rpc import Wallet
# Create an instance of Wallet
chia_wallet = Wallet()
# Specify the wallet ID, additions (recipients), fee, and optional parameters
wallet_id = 1
additions = [
{'amount': 1000000000000, 'puzzle_hash': '0x...'}, # Recipient 1
{'amount': 500000000000, 'puzzle_hash': '0x...'}, # Recipient 2
]
fee = 0.00001
coins = None
coin_announcements = None
puzzle_announcements = None
# Call the send_transaction_multi method to send the transaction
result = chia_wallet.send_transaction_multi(wallet_id, additions, fee, coins, coin_announcements, puzzle_announcements)
# Parse the result and handle the transaction ID and status
transaction_id = result['transaction_id']
status = result['status']
print(f"Transaction ID: {transaction_id}")
print(f"Status: {status}")
For more examples and documentation, please refer to the official documentation (TBC).
Contributing
If you would like to contribute to Chia-Py-RPC, please open an issue or submit a pull request on GitHub. We welcome any contributions, including bug fixes, feature enhancements, and documentation improvements.
License
Chia-Py-RPC is open-source software licensed under the MIT License.
Acknowledgements
Chia-Py-RPC is not affilated with the Chia Network in any way and it purely to provide a simple method of utlising Chia RPC in python.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for chia_py_rpc-0.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c2786dfe9d43e04c13ef491da0baa354d2ee1c30b6c8ff83c5b70ba6fb06190b |
|
MD5 | faf0533e4d171d2586bb0921d1bba2fc |
|
BLAKE2b-256 | 9bcdecf3128fcadee84def83975b6690e9dbb4c17d838cf13a5da7d55525ff83 |