Expand description
Rust Bitcoin - unit types
This library provides basic types used by the Rust Bitcoin ecosystem.
If you are using rust-bitcoin then you do not need to access this crate directly. Everything
here is re-exported in rust-bitcoin at the same path. Also the same re-exports exist in
primitives if you are using that crate instead of bitcoin.
§Examples
// Exactly the same as `use bitcoin::{amount, Amount}`.
use bitcoin_units::{amount, Amount};
let _amount = Amount::from_sat(1_000)?;Modules§
- absolute
- Provides type
LockTimethat implements the logic aroundnLockTime/OP_CHECKLOCKTIMEVERIFY. - amount
- Bitcoin amounts.
- block
- Block height and interval types.
- fee_
rate - Implements
FeeRateand associated features. - locktime
- Provides absolute and relative locktimes.
- parse_
int - Parsing utilities.
- pow
- Proof-of-work related integer types.
- relative
- Provides type
LockTimethat implements the logic aroundnSequence/OP_CHECKSEQUENCEVERIFY. - result
- Provides a monadic type returned by mathematical operations (
core::ops). - sequence
- Bitcoin transaction input sequence number.
- time
- A UNIX timestamp used as the Bitcoin block time.
- weight
- Implements
Weightand associated features.
Structs§
- Amount
- An amount.
- Block
Height - A block height. Zero denotes the genesis block.
- Block
Height Interval - An unsigned block interval.
- Block
Mtp - The median timestamp of 11 consecutive blocks.
- Block
MtpInterval - An unsigned difference between two
BlockMtps. - Block
Time - A Bitcoin block timestamp.
- Compact
Target - Encoding of 256-bit target as 32-bit float.
- FeeRate
- Fee rate.
- Sequence
- Bitcoin transaction input sequence number.
- Signed
Amount - A signed amount.
- Weight
- The weight of a transaction or block.
Enums§
- NumOp
Result - Result of a mathematical operation on two numeric types.