Skip to main content

near_providers/
lib.rs

1//! `near-providers` crate provides a set of abstractions for connecting to the NEAR blockchain,
2//! allowing users to interact with the network in a simplified way. This crate includes
3//! the `Provider` trait, which defines a common interface for blockchain interactions,
4//! and specific implementations of this interface, such as the `JsonRpcProvider`.
5//!
6//! The `Provider` trait offers methods for querying blockchain status, sending transactions,
7//! and retrieving information about transactions, blocks, chunks, and validators.
8//! The `JsonRpcProvider` is an implementation of the `Provider` trait that uses JSON RPC
9//! to communicate with NEAR blockchain nodes.
10//!
11//! This crate is designed to be easily extendable with more providers and to offer a
12//! straightforward way to integrate NEAR blockchain functionalities into Rust applications.
13
14/// Re-export the JsonRpcProvider
15pub use crate::json_rpc_provider::JsonRpcProvider;
16/// Re-export the Provider trait
17pub use crate::provider::Provider;
18
19/// Re-exporting jsonrpc_primitives types so users of near-providers don't need
20/// to keep track of multiple jsonrpc crates. For now we export them as types
21/// but when we implement more providers, we can change it to jsonrpc_types
22pub use near_jsonrpc_primitives::types;
23
24/// Use near_jsonrpc_primitives/client easily with near_providers
25pub use near_jsonrpc_client as jsonrpc_client;
26pub use near_jsonrpc_primitives as jsonrpc_primitives;
27
28mod json_rpc_provider;
29mod provider;