uniswap_sdk_core/
lib.rs

1#![doc = include_str!("../README.md")]
2#![cfg_attr(not(feature = "std"), no_std)]
3#![warn(
4    missing_copy_implementations,
5    missing_debug_implementations,
6    unreachable_pub,
7    clippy::missing_const_for_fn,
8    clippy::missing_inline_in_public_items,
9    clippy::needless_pass_by_value,
10    clippy::redundant_clone,
11    clippy::manual_assert,
12    clippy::must_use_candidate,
13    clippy::unseparated_literal_suffix,
14    rustdoc::all
15)]
16#![cfg_attr(not(test), warn(unused_crate_dependencies))]
17#![deny(unused_must_use, rust_2018_idioms)]
18#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
19
20extern crate alloc;
21use num_traits as _;
22
23/// Contains functionality related to All Contracts deployed and supported by the Uniswap SDK.
24pub mod addresses;
25/// Contains functionality related to All Contracts deployed and supported by the Uniswap SDK.
26pub mod chains;
27/// Contains some constants and enums used in the Uniswap SDK Core
28pub mod constants;
29/// Contains entities related to the Uniswap SDK Core, such as currencies, tokens, and fractions.
30pub mod entities;
31/// Contains error types  for the Uniswap SDK Core.
32///
33/// This module defines custom error types that are used throughout the SDK to
34/// handle various error conditions.
35pub mod error;
36/// Contains utility functions and helpers used across the Uniswap SDK Core.
37pub mod utils;
38
39/// Contains commonly used items from the Uniswap SDK Core.
40///
41/// This module re-exports items that are commonly used together,
42/// making it easier to import them in other parts of your application.
43pub mod prelude {
44    pub use crate::{addresses::*, chains::*, constants::*, entities::*, error::Error, utils::*};
45
46    pub use alloc::{
47        string::{String, ToString},
48        vec::Vec,
49    };
50    pub use alloy_primitives::{Address, B256, Bytes, U256, map::HashMap};
51    pub use bnum;
52    pub use fastnum;
53    pub use num_integer::Integer;
54
55    pub type BigInt = fastnum::I512;
56    pub type BigUint = fastnum::U512;
57    pub type BigDecimal = fastnum::D512;
58    pub type RoundingMode = fastnum::decimal::RoundingMode;
59}
60
61/// Contains examples of how Uniswap sdk core can be used
62#[cfg(all(feature = "std", test))]
63mod examples;