Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/bicarus-labs/near-api-rs

Rust implementation of Near API library that compatible with tokio
https://github.com/bicarus-labs/near-api-rs

blockchain near nearprotocol rust webassembly

Last synced: about 2 months ago
JSON representation

Rust implementation of Near API library that compatible with tokio

Awesome Lists containing this project

README

        

# Near API

Rust implementation of Near API library that compatible with `tokio`.

[![Crates.io](https://img.shields.io/crates/v/near-api)](https://crates.io/crates/near-api)

## Usage

First, add this to your `Cargo.toml`:

```toml
[dependencies]
near-api = "0.1.0"
```

## Example

```rust
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);
}
```