Crates.io | near-api-tokio |
lib.rs | near-api-tokio |
version | 0.1.0 |
source | src |
created_at | 2021-10-22 09:52:12.342786 |
updated_at | 2021-10-22 09:52:12.342786 |
description | Rust implementation of Near API library that compatible with tokio. |
homepage | https://github.com/bicarus-labs/near-api-rs |
repository | https://github.com/bicarus-labs/near-api-rs |
max_upload_size | |
id | 469263 |
size | 13,432 |
Rust implementation of Near API library that compatible with tokio
.
First, add this to your Cargo.toml
:
[dependencies]
near-api-tokio = "0.1.0"
use near_primitives_v01::types::{BlockReference, Finality};
#[tokio::test]
async fn get_pools() {
let near_client = near_api::new_client("https://rpc.mainnet.near.org");
let block = near_client
.block(BlockReference::Finality(Finality::Final))
.await
.unwrap();
println!("block {}", block.header.height);
}