monero/
lib.rs

1// Rust Monero Library
2// Written in 2019-2023 by
3//   Monero Rust Contributors
4//
5// Permission is hereby granted, free of charge, to any person obtaining a copy
6// of this software and associated documentation files (the "Software"), to deal
7// in the Software without restriction, including without limitation the rights
8// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9// copies of the Software, and to permit persons to whom the Software is
10// furnished to do so, subject to the following conditions:
11//
12// The above copyright notice and this permission notice shall be included in all
13// copies or substantial portions of the Software.
14//
15
16//! # Rust Monero Library
17//!
18//! This is a library for which supports subsets of the Monero protocol and type primitives. It is
19//! designed for Rust programs built to work with the Monero ecosystem.
20//!
21//! The library currently focuses on manipulating types such as addresses, transactions, blocks and
22//! public keys, but does **NOT** implement transaction signing. There is no immediate plan to add
23//! such support.
24//!
25//! ## Features
26//!
27//! To enable additional functionalities please see the following documentation about features.
28//!
29//! ### Default features
30//!
31//! The default feature `full` enables the `std` and `rand` features for the `fixed-hash`
32//! dependency.
33//!
34//! It is worth noting that `std` is widely used all over the library and no `no_std` support is
35//! planned at the moment.
36//!
37//! ### `serde`
38//!
39//! The `serde` feature enables implementation of [`serde`](https://docs.rs/serde/latest/serde/) on
40//! serializable types.
41//!
42//! ### `experimental`
43//!
44//! The `experimental` feature enable the method [`Transaction::signature_hash`], the method
45//! computes the message to be signed by the CLSAG signature algorithm. This method is featured as
46//! experimental at the moment because it lacks reviews and tests.
47//!
48//! ## Caution
49//!
50//! The Software is provided “as is”, without warranty of any kind, express or implied, including
51//! but not limited to the warranties of merchantability, fitness for a particular purpose and
52//! noninfringement. In no event shall the authors or copyright holders be liable for any claim,
53//! damages or other liability, whether in an action of contract, tort or otherwise, arising from,
54//! out of or in connection with the software or the use or other dealings in the Software.
55//!
56
57#![cfg_attr(docsrs, feature(doc_cfg))]
58// Coding conventions
59#![forbid(unsafe_code)]
60#![deny(non_upper_case_globals)]
61#![deny(non_camel_case_types)]
62#![deny(unused_mut)]
63#![deny(missing_docs)]
64
65#[macro_use]
66mod internal_macros;
67#[macro_use]
68pub mod consensus;
69pub mod blockdata;
70pub mod cryptonote;
71pub mod network;
72pub mod util;
73
74pub use blockdata::block::Block;
75pub use blockdata::block::BlockHeader;
76pub use blockdata::transaction::OwnedTxOut;
77pub use blockdata::transaction::Transaction;
78pub use blockdata::transaction::TransactionPrefix;
79pub use blockdata::transaction::TxIn;
80pub use blockdata::transaction::TxOut;
81pub use consensus::encode::VarInt;
82pub use cryptonote::hash::Hash;
83pub use network::Network;
84pub use util::address::Address;
85pub use util::address::AddressType;
86pub use util::amount::Amount;
87pub use util::amount::Denomination;
88pub use util::amount::SignedAmount;
89pub use util::key::KeyPair;
90pub use util::key::PrivateKey;
91pub use util::key::PublicKey;
92pub use util::key::ViewPair;
93pub use util::Error;