Skip to main content

ProviderTrait

Trait ProviderTrait 

Source
pub trait ProviderTrait {
    // Required methods
    fn get_network(&self) -> &SimplicityNetwork;
    fn broadcast_transaction(
        &self,
        tx: &Transaction,
    ) -> Result<Txid, ProviderError>;
    fn wait(&self, txid: &Txid) -> Result<(), ProviderError>;
    fn fetch_tip_height(&self) -> Result<u32, ProviderError>;
    fn fetch_tip_timestamp(&self) -> Result<u64, ProviderError>;
    fn fetch_transaction(
        &self,
        txid: &Txid,
    ) -> Result<Transaction, ProviderError>;
    fn fetch_address_utxos(
        &self,
        address: &Address,
    ) -> Result<Vec<(OutPoint, TxOut)>, ProviderError>;
    fn fetch_scripthash_utxos(
        &self,
        script: &Script,
    ) -> Result<Vec<(OutPoint, TxOut)>, ProviderError>;
    fn fetch_fee_estimates(&self) -> Result<HashMap<String, f64>, ProviderError>;

    // Provided method
    fn fetch_fee_rate(&self, target_blocks: u32) -> Result<f32, ProviderError> { ... }
}

Required Methods§

Provided Methods§

Source

fn fetch_fee_rate(&self, target_blocks: u32) -> Result<f32, ProviderError>

Implementors§