Crates.io | xpx-chain-sdk |
lib.rs | xpx-chain-sdk |
version | 0.6.2 |
source | src |
created_at | 2024-06-27 15:52:34.658884 |
updated_at | 2024-06-28 20:56:22.082841 |
description | The ProximaX Sirius Chain Rust SDK works as a lightweight Rust library for interacting with the Sirius Blockchain. |
homepage | https://www.proximax.io |
repository | https://github.com/proximax-storage/rust-xpx-chain-sdk |
max_upload_size | |
id | 1285913 |
size | 1,310,291 |
The ProximaX Sirius Chain Rust SDK works as a lightweight Rust library for interacting with the Sirius Blockchain. It provides a complete library set coverage, and supports asynchronous requests.
First, add this to your Cargo.toml
:
[dependencies]
xpx-chain-sdk = { git = "https://github.com/proximax-storage/rust-xpx-chain-sdk"}
#[tokio::main]
async fn main() {
let node_url = vec!["http://bctestnet1.brimstone.xpxsirius.io:3000"];
let sirius_client = xpx_chain_sdk::api::SiriusClient::new(node_url).await;
let client = match sirius_client {
Ok(resp) => resp,
Err(err) => panic!("{}", err),
};
//let account_id: &str = "VC6LFNKEQQEI5DOAA2OJLL4XRPDNPLRJDH6T2B7X";
let account_id: &str = "5649D09FB884424AB5E3ED16B965CF69E3048A5E641287C319AC3DE995C97FB0";
let account_info = client.account_api().account_info(account_id).await;
match account_info {
Ok(resp) => println!("{}", resp),
Err(err) => eprintln!("{}", err),
}
}
For more examples see wiki.