Trait EsploraClientExt

Source
pub trait EsploraClientExt {
    // Required methods
    fn _client(&self) -> &Client;
    fn _base_url(&self) -> &str;

    // Provided methods
    fn post_request_bytes<'life0, 'life1, 'life2, 'async_trait, T>(
        &'life0 self,
        path: &'life1 str,
        body: T,
        query_params: Option<HashSet<(&'life2 str, String)>>,
    ) -> Pin<Box<dyn Future<Output = Result<Response, Error>> + Send + 'async_trait>>
       where T: 'async_trait + Into<Body> + Send,
             Self: Sync + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait { ... }
    fn submit_package<'life0, 'life1, 'async_trait>(
        &'life0 self,
        transactions: &'life1 [Transaction],
        maxfeerate: Option<f64>,
        maxburnamount: Option<f64>,
    ) -> Pin<Box<dyn Future<Output = Result<SubmitPackageResult, Error>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
}

Required Methods§

Source

fn _client(&self) -> &Client

Source

fn _base_url(&self) -> &str

Provided Methods§

Source

fn post_request_bytes<'life0, 'life1, 'life2, 'async_trait, T>( &'life0 self, path: &'life1 str, body: T, query_params: Option<HashSet<(&'life2 str, String)>>, ) -> Pin<Box<dyn Future<Output = Result<Response, Error>> + Send + 'async_trait>>
where T: 'async_trait + Into<Body> + Send, Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Make an HTTP POST request to given URL, converting any T that implement Into<Body> and setting query parameters, if any.

§Errors

This function will return an error either from the HTTP client, or the response’s serde_json deserialization.

Source

fn submit_package<'life0, 'life1, 'async_trait>( &'life0 self, transactions: &'life1 [Transaction], maxfeerate: Option<f64>, maxburnamount: Option<f64>, ) -> Pin<Box<dyn Future<Output = Result<SubmitPackageResult, Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Broadcast a package of Transaction to Esplora

if maxfeerate is provided, any transaction whose fee is higher will be rejected

if maxburnamount is provided, any transaction with higher provably unspendable outputs amount will be rejected

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl EsploraClientExt for AsyncClient

Source§

fn _client(&self) -> &Client

Source§

fn _base_url(&self) -> &str

Implementors§