> For the complete documentation index, see [llms.txt](https://docs.kiiglobal.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kiiglobal.io/docs/build-on-kiichain/developer-tools/rust-sdk.md).

# Rust SDK

**Note: This project is still under development so future changes will be made.**&#x20;

### Important Links

* [Github RWA Repo](https://github.com/KiiChain/Kii-RWA-Protocol)
* [Rust SDK Repo](https://github.com/KiiChain/kiirust-sdk)

### KiiChain RWA SDK

The RWA (Real World Asset) SDK is a Rust library for interacting with tokenized real-world assets on Cosmos-based blockchains. It provides functionality for token operations, identity management, and compliance handling.

#### Features

* Token transfers and balance checks
* Identity registration and management
* Compliance module integration
* Blockchain interaction via RPC

#### Usage Example

```rust
use rwa_sdk::RwaClient;
use cosmrs::crypto::secp256k1::SigningKey;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // Initialize the client
    let client = RwaClient::new(
        "http://rpc.example.com:26657",
        "my-chain-id",
        "cosmos1token...",
        "cosmos1identity...",
        "cosmos1compliance...",
        "sei",
        "gas_price"

    )?;

    // Perform a token transfer
    let signer = SigningKey::from_slice(&[/* your private key */])?;
    let transfer_result = client.transfer(TransferMessageRequest {
        from: "cosmos1sender...".to_string(),
        to: "cosmos1recipient...".to_string(),
        amount: 100,
        signer,
        gas_limit
    }).await?;
    println!("Transfer hash: {}", transfer_result.hash);

    // Check a balance
    let balance = client.balance(TokenInfoRequest {
        address: "cosmos1address...".to_string(),
    }).await?;
    println!("Balance: {}", balance.balance);

    Ok(())
}
```

This example demonstrates how to initialize the `RwaClient`, perform a token transfer, and check an account balance. Error handling and proper setup of the signing key are crucial for production use.

For more detailed information on each function and module, please refer to their respective documentation.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.kiiglobal.io/docs/build-on-kiichain/developer-tools/rust-sdk.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
