#abi #bytes32 #bytecode

bin+lib nado-sdk

Official Rust SDK for the Nado Protocol API

7 releases

new 0.2.6 Nov 11, 2025
0.2.5 Nov 5, 2025
0.2.3 Oct 22, 2025
0.2.1 Sep 26, 2025

#492 in Magic Beans

Download history 36/week @ 2025-08-26 72/week @ 2025-09-02 6/week @ 2025-09-09 8/week @ 2025-09-16 119/week @ 2025-09-23 150/week @ 2025-09-30 16/week @ 2025-10-07 11/week @ 2025-10-14 139/week @ 2025-10-21 5/week @ 2025-10-28

190 downloads per month

MIT/Apache

3MB
41K SLoC

Nado Protocol Rust SDK

Crates.io

This is the Rust SDK for the Nado Protocol API.

Documentation

Quickstart

Instantiate a client on the chain you would like to interact with. For example, ClientMode::Test to use Ink testnet and ClientMode::Prod to use Ink mainnet, etc. A signer (private key) is required for executes. A signer is not required for queries. For requests with many parameters, use the client to build and send requests. For simple queries (1-2 params) like get_market_price, call directly from the client.

See basic_usage.rs for an E2E example including depositing into Nado.

use nado_sdk::prelude::*;

async fn main() {
    let client = NadoClient::new(ClientMode::Test)
        .with_signer(private_key())
        .await
        .unwrap();

    const BTC_PERP: u32 = 2;

    // query market data
    let market_price = client.get_market_price(BTC_PERP).await.unwrap();

    // place orders
    let place_order_response = client
        .place_order_builder()
        .product_id(BTC_PERP)
        .amount(to_i128_x18(1))
        .price_x18(market_price.ask_x18)
        .execute()
        .await
        .unwrap();

    let digest = place_order_response.unwrap().digest;

    // cancel orders
    client
        .cancellation_builder()
        .digests(vec![digest])
        .product_ids(vec![BTC_PERP])
        .execute()
        .await
        .unwrap();
}

Installation

Add the following line to your Cargo.toml file:

[dependencies]
nado_sdk = "0.2.6"

Usage

See the examples and sanity directories.

Running locally

Run sanity checks

  • cargo run -- --execute-sanity: runs sanity checks for executes.
  • cargo run -- --query-sanity: runs sanity checks for engine queries.
  • cargo run -- --indexer-sanity: runs sanity checks for indexer queries.

Dependencies

~35–57MB
~1M SLoC