Deso Rust SDK
A Rust SDK for interacting with the Deso blockchain. This library allows you to create posts, NFTs, and messages on the Deso network.
Overview
The Deso Rust SDK provides a set of utilities to interact with the Deso blockchain, enabling developers to easily perform various blockchain operations, such as creating posts, NFTs, and messages.
Features
- Create Posts: Publish new posts on the Deso blockchain.
- Create Comments: Publish new comments on a post
Create a New Post
To create a new post on the Deso blockchain, follow these steps:
-
Build the Deso account: Use the
DesoAccountBuilderto create your account.let deso_account = new .public_key .seed_hex_key .build .unwrap; -
Create extra data for the post: Prepare any additional data you want to include in the post.
let mut extra_data_map: = new; extra_data_map.insert; -
Build the post data: Use the
SubmitPostDataBuilderto create the post data.let post_data = new .body .public_key .extra_data .build .unwrap; -
Create the post: Call the
create_postfunction with the prepared data.let post_transaction_json = create_post.await.unwrap; println!;
Create a Comment on a Post
To create a comment on an existing post, follow these steps:
-
Build the Deso account: Use the
DesoAccountBuilderto create your account.let deso_account = new .public_key .seed_hex_key .build .unwrap; -
Prepare the post hash hex: Obtain the hash of the post you want to comment on.
let post_hash_hex = "existing_post_hash_hex".to_string; -
Build the comment data: Use the
SubmitPostDataBuilderto create the comment data.let comment_post_data = new .body .public_key .parent_post_hash_hex .build .unwrap; -
Create the comment: Call the
create_postfunction with the prepared data.let comment_transaction_json = create_post.await.unwrap; println!;
To-Do List
- Create Post
- Create NFT
- Create Message
Contributing
Contributions are welcome! Please open an issue or submit a pull request.
License
This project is licensed under the MIT License - see the LICENSE file for details.