Nado Protocol Rust SDK
This is the Rust SDK for the Nado Protocol API.
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 *;
async
Installation
Add the following line to your Cargo.toml file:
[]
= "0.3.1"
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.
Websocket place order example
cargo run --example place_order_websocket requires a .env file in the repo root with your signer key:
RUST_SDK_PRIVATE_KEY=<your_private_key_hex>
# optional: NETWORK=test|prod (defaults to test)
Use .env.example as a template: copy it to .env and fill in the variables above.
Then run the example:
cargo run --example place_order_websocket