pub struct BitcoinManager { /* private fields */ }Expand description
Bitcoin manager for Anya Core
Implementations§
Source§impl BitcoinManager
impl BitcoinManager
Sourcepub fn new(
config: BitcoinManagerConfig,
adapter: Arc<BitcoinAdapter>,
metrics: Arc<Mutex<PrometheusMetrics>>,
) -> Self
pub fn new( config: BitcoinManagerConfig, adapter: Arc<BitcoinAdapter>, metrics: Arc<Mutex<PrometheusMetrics>>, ) -> Self
Create a new Bitcoin manager
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Check if Bitcoin functionality is enabled
Sourcepub fn get_network(&self) -> &str
pub fn get_network(&self) -> &str
Get the current Bitcoin network
Sourcepub fn get_adapter(&self) -> Arc<BitcoinAdapter>
pub fn get_adapter(&self) -> Arc<BitcoinAdapter>
Get the underlying Bitcoin adapter
Sourcepub async fn get_block_height(&self) -> AnyaResult<u32>
pub async fn get_block_height(&self) -> AnyaResult<u32>
Get the current block height
Auto Trait Implementations§
impl Freeze for BitcoinManager
impl !RefUnwindSafe for BitcoinManager
impl Send for BitcoinManager
impl Sync for BitcoinManager
impl Unpin for BitcoinManager
impl !UnwindSafe for BitcoinManager
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more