Skip to main content

SimplexProvider

Struct SimplexProvider 

Source
pub struct SimplexProvider {
    pub esplora: EsploraProvider,
    pub elements: ElementsRpc,
}
Expand description

A local provider used during Regtest or local development. It wraps an EsploraProvider for REST API queries and an ElementsRpc for direct node interactions.

Fields§

§esplora: EsploraProvider

The Esplora provider for handling REST API queries.

§elements: ElementsRpc

The Elements RPC provider for direct node operations and wallet interaction.

Implementations§

Source§

impl SimplexProvider

Source

pub fn new( esplora_url: String, elements_url: String, auth: Auth, network: SimplicityNetwork, ) -> SimplexProvider

Creates a new SimplexProvider with the given URLs, authentication, and network.

§Panics

Panics if the ElementsRpc client fails to initialize.

Trait Implementations§

Source§

impl Debug for SimplexProvider

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl ProviderTrait for SimplexProvider

Source§

fn get_network(&self) -> &SimplicityNetwork

Retrieves the network configured for this provider.
Source§

fn broadcast_transaction( &self, tx: &Transaction, ) -> Result<TxReceipt<'_>, ProviderError>

Attempts to broadcast a fully compiled transaction to the configured backend. Read more
Source§

fn wait(&self, txid: &Txid) -> Result<(), ProviderError>

Blocks and repeatedly polls the network until the specified transaction receives its first confirmation. Read more
Source§

fn fetch_tip_height(&self) -> Result<u32, ProviderError>

Retrieves the current block height of the network tip. Read more
Source§

fn fetch_tip_timestamp(&self) -> Result<u64, ProviderError>

Retrieves the block timestamp representing network consensus clock tip. Read more
Source§

fn fetch_transaction(&self, txid: &Txid) -> Result<Transaction, ProviderError>

Retrieves the serialized transaction payload given its hex transaction ID. Read more
Source§

fn fetch_address_utxos( &self, address: &Address, ) -> Result<Vec<UTXO>, ProviderError>

Fetches all active unspent transaction outputs correlated to a particular public Address. Read more
Source§

fn fetch_scripthash_utxos( &self, script: &Script, ) -> Result<Vec<UTXO>, ProviderError>

Fetches all active unspent transaction outputs correlated to a given custom Script mapping. Read more
Source§

fn fetch_fee_estimates(&self) -> Result<HashMap<String, f64>, ProviderError>

Fetches network fee estimation models based on varying target confirmation block delays. Read more
Source§

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

Attempts to extract the specific fee rate (in sats/kvb) necessary for the transaction to be confirmed within target_blocks. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<'src, T> IntoMaybe<'src, T> for T
where T: 'src,

Source§

type Proj<U: 'src> = U

Source§

fn map_maybe<R>( self, _f: impl FnOnce(&'src T) -> &'src R, g: impl FnOnce(T) -> R, ) -> <T as IntoMaybe<'src, T>>::Proj<R>
where R: 'src,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V