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: EsploraProviderThe Esplora provider for handling REST API queries.
elements: ElementsRpcThe Elements RPC provider for direct node operations and wallet interaction.
Implementations§
Source§impl SimplexProvider
impl SimplexProvider
Sourcepub fn new(
esplora_url: String,
elements_url: String,
auth: Auth,
network: SimplicityNetwork,
) -> SimplexProvider
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
impl Debug for SimplexProvider
Source§impl ProviderTrait for SimplexProvider
impl ProviderTrait for SimplexProvider
Source§fn get_network(&self) -> &SimplicityNetwork
fn get_network(&self) -> &SimplicityNetwork
Retrieves the network configured for this provider.
Source§fn broadcast_transaction(
&self,
tx: &Transaction,
) -> Result<TxReceipt<'_>, ProviderError>
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>
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>
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>
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>
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>
fn fetch_address_utxos( &self, address: &Address, ) -> Result<Vec<UTXO>, ProviderError>
Fetches all active unspent transaction outputs correlated to a particular public
Address. Read moreSource§fn fetch_scripthash_utxos(
&self,
script: &Script,
) -> Result<Vec<UTXO>, ProviderError>
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 moreSource§fn fetch_fee_estimates(&self) -> Result<HashMap<String, f64>, ProviderError>
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>
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 moreAuto Trait Implementations§
impl !Freeze for SimplexProvider
impl !RefUnwindSafe for SimplexProvider
impl Send for SimplexProvider
impl Sync for SimplexProvider
impl Unpin for SimplexProvider
impl UnsafeUnpin for SimplexProvider
impl !UnwindSafe for SimplexProvider
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> 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