1#![doc = include_str!("../README.md")]
2#![doc(
3 html_logo_url = "https://raw.githubusercontent.com/alloy-rs/core/main/assets/alloy.jpg",
4 html_favicon_url = "https://raw.githubusercontent.com/alloy-rs/core/main/assets/favicon.ico"
5)]
6#![cfg_attr(not(test), warn(unused_crate_dependencies))]
7#![cfg_attr(not(feature = "std"), no_std)]
8#![cfg_attr(feature = "nightly", feature(hasher_prefixfree_extras))]
9#![cfg_attr(feature = "nightly", feature(core_intrinsics))]
10#![cfg_attr(feature = "nightly", feature(likely_unlikely))]
11#![cfg_attr(feature = "nightly", allow(internal_features))]
12#![cfg_attr(docsrs, feature(doc_cfg))]
13
14#[macro_use]
15extern crate alloc;
16
17use paste as _;
18use rustc_hash as _;
19use sha3 as _;
20#[cfg(feature = "tiny-keccak")]
21use tiny_keccak as _;
22
23#[cfg(feature = "postgres")]
24pub mod postgres;
25
26#[cfg(feature = "diesel")]
27pub mod diesel;
28
29#[cfg(feature = "sqlx")]
30pub mod sqlx;
31
32pub mod aliases;
33#[doc(no_inline)]
34pub use aliases::{
35 B64, B128, B256, B512, BlockHash, BlockNumber, BlockTimestamp, ChainId, I8, I16, I32, I64,
36 I128, I160, I256, Selector, StorageKey, StorageValue, TxHash, TxIndex, TxNonce, TxNumber, U8,
37 U16, U32, U64, U128, U160, U256, U512,
38};
39
40#[macro_use]
41mod bits;
42pub use bits::{
43 Address, AddressChecksumBuffer, AddressError, BLOOM_BITS_PER_ITEM, BLOOM_SIZE_BITS,
44 BLOOM_SIZE_BYTES, Bloom, BloomInput, FixedBytes, FixedBytesSliceExt, FixedBytesVecExt,
45 Function,
46};
47#[cfg(feature = "rkyv")]
48pub use bits::{
49 AddressResolver, ArchivedAddress, ArchivedBloom, ArchivedFixedBytes, BloomResolver,
50 FixedBytesResolver,
51};
52
53#[path = "bytes/mod.rs"]
54mod bytes_;
55pub use self::bytes_::Bytes;
56
57mod common;
58pub use common::TxKind;
59
60mod log;
61pub use log::{IntoLogData, Log, LogData, logs_bloom};
62
63#[cfg(feature = "map")]
64pub mod map;
65
66mod sealed;
67pub use sealed::{Sealable, Sealed};
68
69mod signed;
70pub use signed::{BigIntConversionError, ParseSignedError, Sign, Signed};
71
72mod signature;
73pub use signature::{Signature, SignatureError, normalize_v, to_eip155_v};
74
75pub mod utils;
76pub use utils::{KECCAK256_EMPTY, Keccak256, eip191_hash_message, keccak256, keccak256_uncached};
77
78#[doc(hidden)] pub mod hex_literal;
80
81#[doc(inline)]
82pub use ruint::uint;
83#[doc(no_inline)]
84pub use {
85 ::bytes,
86 ::hex,
87 ruint::{self, Uint},
88};
89
90#[cfg(feature = "serde")]
91#[doc(no_inline)]
92pub use ::hex::serde as serde_hex;
93
94#[doc(hidden)]
96pub mod private {
97 pub use alloc::{borrow::Cow, vec::Vec};
98 pub use core::{
99 self,
100 borrow::{Borrow, BorrowMut},
101 cmp::Ordering,
102 prelude::rust_2021::*,
103 };
104 pub use derive_more;
105
106 #[cfg(feature = "getrandom")]
107 pub use getrandom;
108
109 #[cfg(feature = "rand")]
110 pub use rand;
111
112 #[cfg(feature = "rlp")]
113 pub use alloy_rlp;
114
115 #[cfg(feature = "allocative")]
116 pub use allocative;
117
118 #[cfg(feature = "serde")]
119 pub use serde;
120
121 #[cfg(feature = "borsh")]
122 pub use borsh;
123
124 #[cfg(feature = "arbitrary")]
125 pub use {arbitrary, proptest, proptest_derive};
126
127 #[cfg(feature = "diesel")]
128 pub use diesel;
129
130 #[cfg(feature = "sqlx")]
131 pub use sqlx_core;
132
133 #[cfg(feature = "schemars")]
134 pub use schemars;
135}