near-api-tokio

Crates.ionear-api-tokio
lib.rsnear-api-tokio
version0.1.0
sourcesrc
created_at2021-10-22 09:52:12.342786
updated_at2021-10-22 09:52:12.342786
descriptionRust implementation of Near API library that compatible with tokio.
homepagehttps://github.com/bicarus-labs/near-api-rs
repositoryhttps://github.com/bicarus-labs/near-api-rs
max_upload_size
id469263
size13,432
near (github:bicarus-labs:near)

documentation

https://docs.rs/near-api-tokio

README

Near API

Rust implementation of Near API library that compatible with tokio.

Crates.io

Usage

First, add this to your Cargo.toml:

[dependencies]
near-api-tokio = "0.1.0"

Example

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);
}
Commit count: 7

cargo fmt