pub struct MempoolService { /* private fields */ }Expand description
Mempool transaction management service
Implementations§
Source§impl MempoolService
impl MempoolService
Sourcepub fn new(
mempool: Arc<dyn MempoolPort>,
chain_state: Arc<dyn ChainStateStore>,
) -> Self
pub fn new( mempool: Arc<dyn MempoolPort>, chain_state: Arc<dyn ChainStateStore>, ) -> Self
Create a new mempool service.
Sourcepub async fn submit_transaction(
&self,
tx: &Transaction,
) -> Result<String, String>
pub async fn submit_transaction( &self, tx: &Transaction, ) -> Result<String, String>
Submit a transaction to the mempool
Sourcepub async fn get_mempool_contents(&self) -> Result<Vec<String>, String>
pub async fn get_mempool_contents(&self) -> Result<Vec<String>, String>
Get all transactions in the mempool
Sourcepub async fn estimate_fee(&self, target_blocks: u32) -> Result<f64, String>
pub async fn estimate_fee(&self, target_blocks: u32) -> Result<f64, String>
Estimate fee for a transaction
Sourcepub async fn get_mempool_info(&self) -> Result<MempoolInfo, String>
pub async fn get_mempool_info(&self) -> Result<MempoolInfo, String>
Get mempool statistics
Sourcepub async fn get_mempool_entry(&self, txid: &Txid) -> Option<MempoolEntry>
pub async fn get_mempool_entry(&self, txid: &Txid) -> Option<MempoolEntry>
Look up a single transaction in the mempool by txid.
Auto Trait Implementations§
impl Freeze for MempoolService
impl !RefUnwindSafe for MempoolService
impl Send for MempoolService
impl Sync for MempoolService
impl Unpin for MempoolService
impl UnsafeUnpin for MempoolService
impl !UnwindSafe for MempoolService
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