pub struct BlockchainInfo {
pub height: Height,
pub block_hash: BlockHash,
pub timestamp: u32,
pub difficulty: u128,
pub utxos_length: u64,
}Expand description
Information about the blockchain as seen by the canister.
Returns information about the main chain tip. The main chain is the canister’s best guess at what the Bitcoin network considers the canonical chain. It is defined as the chain with the most accumulated proof-of-work (difficulty), following Bitcoin’s consensus rule. When accumulated difficulties are tied, the longest branch (by block count) wins. If branches still tie on both criteria, the chain ends at the fork point (contested tip).
Fields§
§height: HeightThe height of the main chain tip.
block_hash: BlockHashThe hash of the tip block.
timestamp: u32Unix timestamp of the tip block (seconds since epoch).
difficulty: u128Difficulty of the tip block.
utxos_length: u64Total number of UTXOs up to the main chain tip (stable + unstable main chain blocks).
Trait Implementations§
Source§impl CandidType for BlockchainInfo
impl CandidType for BlockchainInfo
Source§impl Clone for BlockchainInfo
impl Clone for BlockchainInfo
Source§fn clone(&self) -> BlockchainInfo
fn clone(&self) -> BlockchainInfo
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BlockchainInfo
impl Debug for BlockchainInfo
Source§impl<'de> Deserialize<'de> for BlockchainInfo
impl<'de> Deserialize<'de> for BlockchainInfo
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for BlockchainInfo
impl PartialEq for BlockchainInfo
Source§impl Serialize for BlockchainInfo
impl Serialize for BlockchainInfo
impl Eq for BlockchainInfo
impl StructuralPartialEq for BlockchainInfo
Auto Trait Implementations§
impl Freeze for BlockchainInfo
impl RefUnwindSafe for BlockchainInfo
impl Send for BlockchainInfo
impl Sync for BlockchainInfo
impl Unpin for BlockchainInfo
impl UnsafeUnpin for BlockchainInfo
impl UnwindSafe for BlockchainInfo
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more