#![no_std]
#![cfg_attr(docsrs, feature(doc_notable_trait))]
#![warn(missing_docs)]
#![warn(deprecated_in_future)]
#![doc(test(attr(warn(unused))))]
#![cfg_attr(fuzzing, allow(dead_code, unused_imports))]
#![allow(clippy::needless_question_mark)]
#![allow(clippy::manual_range_contains)] #![allow(clippy::incompatible_msrv)] #![allow(clippy::uninlined_format_args)]
internals::const_assert!(
core::mem::size_of::<usize>() >= 4;
"platforms that have usize less than 32 bits are not supported"
);
#[macro_use]
extern crate alloc;
#[cfg(feature = "std")]
extern crate std;
#[cfg(feature = "arbitrary")]
pub extern crate arbitrary;
pub extern crate base58;
pub extern crate bech32;
pub extern crate encoding;
pub extern crate hashes;
pub extern crate hex_stable as hex;
pub extern crate io;
pub extern crate primitives;
#[cfg(feature = "serde")]
#[macro_use]
pub extern crate serde;
mod internal_macros;
pub mod ext {
#[rustfmt::skip] pub use crate::{
block::{BlockCheckedExt, HeaderExt},
pow::CompactTargetExt,
script::{ScriptExt, ScriptBufExt, ScriptPubKeyExt, ScriptPubKeyBufExt, WitnessScriptExt, ScriptSigExt},
transaction::{TxInExt, TxOutExt, TransactionExt as TransactionWeightExt},
witness::WitnessExt,
};
pub use crate::consensus_validation::{
ScriptPubKeyExt as ConsensusScriptPubKeyValidationExt,
TransactionExt as ConsensusTransactionValidationExt,
};
#[cfg(feature = "pow")]
pub use crate::pow::HeaderPowExt;
}
pub mod address;
pub mod block_validation;
pub mod blockdata;
pub mod compact_filter;
pub mod consensus_validation;
pub(crate) mod crypto;
pub mod key_expression;
pub mod merkle_tree;
pub mod network;
#[cfg(feature = "p2p")]
#[cfg_attr(docsrs, doc(cfg(feature = "p2p")))]
pub mod p2p {
#[doc(inline)]
pub use p2p_messages::{Magic, NetworkExt};
}
pub mod policy;
pub mod pow;
pub mod pqhd;
#[doc(inline)]
pub use primitives::{
block::{
compute_merkle_root, compute_witness_root, Block, BlockHash, Checked as BlockChecked,
Header as BlockHeader, InvalidBlockError, Unchecked as BlockUnchecked,
Validation as BlockValidation, Version as BlockVersion, WitnessCommitment,
},
merkle_tree::{TxMerkleNode, WitnessMerkleNode},
script::{
RedeemScript, RedeemScriptBuf, RedeemScriptTag, ScriptHashableTag, ScriptPubKey,
ScriptPubKeyBuf, ScriptPubKeyTag, ScriptSig, ScriptSigBuf, ScriptSigTag, Tag,
WitnessScript, WitnessScriptBuf, WitnessScriptTag,
},
transaction::{OutPoint, Transaction, TxIn, TxOut, Txid, Version as TransactionVersion, Wtxid},
witness::Witness,
};
#[doc(inline)]
pub use units::{
amount::{Amount, SignedAmount},
block::{BlockHeight, BlockHeightInterval, BlockMtp, BlockMtpInterval},
fee_rate::FeeRate,
parse_int,
pow::CompactTarget,
result::{self, NumOpResult},
sequence::{self, Sequence},
time::{self, BlockTime, BlockTimeDecoder, BlockTimeDecoderError},
weight::Weight,
};
#[doc(inline)]
pub use crate::{
address::{Address, AddressType, KnownHrp},
crypto::key::{
self, FromPqWifError, MismatchedPqPublicKeyError, PqWifFormat, PqWifKey, PubkeyHash,
UnsupportedLegacyWifSchemeError, WPubkeyHash,
},
crypto::pq::{
MlKem512Ciphertext, MlKem512Keypair, MlKem512PublicKey, MlKem512SecretKey,
MlKem512SharedSecret, PqError, PqPublicKey, PqScheme, PqSchemeCryptoExt, PqSecretKey,
PqSignature,
},
key_expression::{
KeyExpressionError, KeyIndex, PqhdDescriptor, PqhdKeyExpression, PqhdKeyPathInfo,
WalletOutputType,
},
network::params::{self, Params},
network::{Network, NetworkKind},
pow::{Target, Work},
pqhd::{LeafMaterialV1 as PqhdLeafMaterialV1, Node as PqhdNode, SeedId as PqhdSeedId},
};
#[doc(inline)]
pub use consensus_core::{
InputsIndexError, LegacySighash, NonStandardSighashTypeError, SegwitV0Sighash, Sighash512,
SighashTypeParseError, TxSighashType,
};
#[doc(inline)]
pub use crate::{
blockdata::locktime::{absolute, relative},
blockdata::opcodes::{self, Opcode},
blockdata::script::witness_program::{self, WitnessProgram},
blockdata::script::witness_version::{self, WitnessVersion},
blockdata::{
block, constants, fee_rate, locktime, script, subsidy, transaction, weight, witness,
},
};
#[rustfmt::skip]
#[allow(unused_imports)]
mod prelude {
#[cfg(not(feature = "std"))]
pub use alloc::{string::{String, ToString}, vec::Vec, boxed::Box, borrow::{Borrow, BorrowMut, Cow, ToOwned}, slice, rc};
#[cfg(all(not(feature = "std"), target_has_atomic = "ptr"))]
pub use alloc::sync;
#[cfg(feature = "std")]
pub use std::{string::{String, ToString}, vec::Vec, boxed::Box, borrow::{Borrow, BorrowMut, Cow, ToOwned}, rc, sync};
#[cfg(not(feature = "std"))]
pub use alloc::collections::{BTreeMap, BTreeSet, btree_map, BinaryHeap};
#[cfg(feature = "std")]
pub use std::collections::{BTreeMap, BTreeSet, btree_map, BinaryHeap};
pub use crate::io::sink;
pub use internals::hex::DisplayHex;
}
pub mod amount {
#[rustfmt::skip] #[cfg(feature = "serde")]
pub use units::amount::serde;
#[doc(inline)]
pub use units::amount::{Amount, SignedAmount};
#[doc(no_inline)]
pub use units::amount::{
Denomination, Display, OutOfRangeError, ParseAmountError, ParseDenominationError,
ParseError,
};
pub mod error {
pub use units::amount::error::{
InputTooLargeError, InvalidCharacterError, MissingDenominationError,
MissingDigitsError, OutOfRangeError, ParseAmountError, ParseDenominationError,
ParseError, PossiblyConfusingDenominationError, TooPreciseError,
UnknownDenominationError,
};
}
}