near_transactions/
lib.rs

1//! The `near-transactions` crate provides utilities for building, signing, and managing transactions on the NEAR blockchain.
2//!
3//! It offers a `TransactionBuilder` for constructing transactions with support for various actions such as creating accounts,
4//! transferring tokens, deploying contracts, and more. Once a transaction is assembled, it can be signed with a signer
5//! and submitted to the NEAR network.
6//!
7//! # Examples
8//!
9//! ```no_run
10//! use near_transactions::TransactionBuilder;
11//! use near_crypto::{InMemorySigner, KeyType};
12//! use near_primitives::types::{AccountId, Balance, Gas};
13//!
14//! let signer = InMemorySigner::from_seed("example.signer", KeyType::ED25519, "seed");
15//! let transaction = TransactionBuilder::new(
16//!         "example.signer.near".parse().unwrap(),
17//!         signer.public_key(),
18//!         "example.receiver.near".parse().unwrap(),
19//!         1, // nonce
20//!         "e...".parse().unwrap(), // block hash
21//!     )
22//!     .transfer(100_000_000_000_000_000_000_000) // transferring 100 NEAR
23//!     .sign_transaction(&signer); // Sign the transaction
24//! ```
25//!
26//! This crate aims to simplify transaction creation and management, making it more accessible for developers to
27//! interact with the NEAR blockchain programmatically.
28
29pub use crate::transaction_builder::TransactionBuilder;
30
31mod transaction_builder;