Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/bicarus-labs/near-api-rs
- Owner: bicarus-labs
- Created: 2021-10-03T17:15:19.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-10-13T18:33:16.000Z (about 3 years ago)
- Last Synced: 2024-05-12T01:03:37.272Z (8 months ago)
- Topics: blockchain, near, nearprotocol, rust, webassembly
- Language: Rust
- Homepage:
- Size: 6.84 KB
- Stars: 3
- Watchers: 0
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-near - near-api-rs
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);
}
```