cw-client
cw-client is a Rust library that provides a trait and implementation for interacting with CosmWasm-enabled blockchains, specifically designed for use with the wasmd daemon.
Features
- Query smart contracts
- Execute transactions on smart contracts
- Deploy new smart contracts
- Query transaction details
Installation
Add this to your Cargo.toml:
[]
= { = "crates/utils/cw-client", = false }
Usage
The main interface is provided through the WasmdClient trait:
To use the client, implement this trait for your specific needs or use the provided implementation.
Querying a Smart Contract
let result: MyResponseType = client.query_smart?;
Executing a Transaction
let tx_hash = client.tx_execute?;
Deploying a New Contract
let contract_address = client.deploy?;
Querying a Transaction
let tx_result: MyTxResultType = client.query_tx?;
Error Handling
The WasmdClient trait uses an associated Error type, allowing for flexible error handling depending on the specific implementation.
Development
To run tests:
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under [LICENSE_NAME]. See the LICENSE file for details.