soroban-rs
soroban-rs is a Rust library designed to interact with the Soroban smart contract platform on the Stellar network. It provides tools for managing accounts, signing transactions, deploying and invoking smart contracts, and handling cryptographic operations.
Features
- Env: Manages connections to Soroban RPC endpoints and handles network configuration.
- Signer: Manages signers low level operations compatible with ed25519 private keys.
- Account: Manages stellar accounts, including signers and management of transactions.
- Guard: Manages restrictions in account for smart conract interactions, like number of allowed calls.
- TransactionBuilder: Helps create and manage Soroban transactions.
- Contract: Simplifies contract deployment and interaction, allows developers to call contracts directly by casting contracts calls using
soroban!macro.
Installation
Add the following to your Cargo.toml:
[]
= "0.2.3"
Usage
Example: Deploying and Invoking a Contract
Here's a basic example of how to deploy and invoke a contract using soroban-rs:
use ;
use ;
async
Example: using soroban!() macro
use /* ... */;
// takes as argument the code of the contract to be called
// generates its bindings under TokenClient struct.
soroban!;
// or use
// soroban!("path/to/contract/lib.rs");
async
Error Handling
The library uses a custom error type SorobanHelperError to handle various errors such as transaction failures, network request failures, and XDR encoding issues.
Contributing
We welcome contributions from the community! Here's how you can get involved:
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
If you are looking for a good place to start, find a good first issue here.
You can open an issue for a bug report, feature request, or documentation request.
You can find more details in our Contributing guide.
Please read our Code of Conduct and check the Security Policy for reporting vulnerabilities.
License
This project is licensed under the GNU Affero General Public License v3.0 - see the LICENSE file for details.
Security
If you discover a security vulnerability within this project, please see SECURITY.md for instructions on responsible disclosure.
Maintainers
See CODEOWNERS file for the list of project maintainers.