Rust Client for the Opennode v1 HTTP API. This library rely on rust Futures to allow asynchronous usage.
Put this in your Cargo.toml
:
toml
[dependencies]
opennode = "1.0.0"
opennode-client = "1.0.1"
And this in your crate root:
rust
extern crate opennode;
extern crate opennode_client;
cargo test
Run file from examples with:
cargo run --example <example> -- <example flags> <example args>
```rust use clap::{App, Arg};
use opennode::account; use opennodeclient::{client::Client, getaccount_balance};
/// Get account balance:
/// cargo run --example account -- --key=<KEY>
async fn main() { let app = App::new("account").arg( Arg::withname("key") .short("k") .long("key") .help("opennode apikey") .valuename("KEY") .required(true) .takesvalue(true), );
let matches = app.get_matches();
let api_key = matches.value_of("key").unwrap();
let client = Client::from_url("https://dev-api.opennode.co", api_key);
let balance: account::Balance = get_account_balance(&client).await.unwrap();
println!("{:?}", balance)
} ```