near-api-lib
The NEAR API library is a comprehensive Rust library designed to simplify the development of applications on the NEAR blockchain. It provides developers with essential tools and abstractions for account management, transaction building and signing, querying the blockchain state, and performing cryptographic operations, all from the comfort of Rust.
Features
-
Account Management: Easily manage NEAR accounts, allowing for the creation of new accounts, key management, and account deletion.
-
Transaction Building and Signing: Utilize a builder pattern for constructing and signing transactions with support for various actions.
-
Blockchain Interaction: Communicate with the NEAR blockchain using the provided JSON RPC provider to query data or send transactions.
-
Cryptographic Utilities: Access cryptographic functions for key generation, signing, and verification. (Rexport for easy access to existing
near-crypto
crate.) -
NEAR Blockchain Primitives: Work directly with NEAR blockchain primitives for low-level operations. (Rexport for easy access to existing
near-primitives
crate.)
Getting Started
Add the following to your Cargo.toml file:
[]
= "0.1.0-alpha"
Usage
use ;
use Account;
use InMemorySigner;
use JsonRpcProvider;
use json;
use Arc;
async
Examples
The crate includes examples that demonstrate how to use various features. To run an example, use the following command:
cargo run --example <example_name>
For instance, to test the create_account
function:
cargo run --example create_account
Contributing
We welcome contributions to the near-api-lib
crate! Please feel free to submit pull requests or open issues to suggest improvements or add new features.