pub struct EsploraClient(/* private fields */);Expand description
Wrapper around an esplora_client::BlockingClient which includes an internal in-memory transaction cache to avoid re-fetching already downloaded transactions.
Implementations§
Source§impl EsploraClient
impl EsploraClient
Sourcepub fn new(url: String, proxy: Option<String>) -> Self
pub fn new(url: String, proxy: Option<String>) -> Self
Creates a new bdk client from an esplora_client::BlockingClient. Optional: Set the proxy of the builder.
Sourcepub fn full_scan(
&self,
request: Arc<FullScanRequest>,
stop_gap: u64,
parallel_requests: u64,
) -> Result<Arc<Update>, EsploraError>
pub fn full_scan( &self, request: Arc<FullScanRequest>, stop_gap: u64, parallel_requests: u64, ) -> Result<Arc<Update>, EsploraError>
Scan keychain scripts for transactions against Esplora, returning an update that can be applied to the receiving structures.
request provides the data required to perform a script-pubkey-based full scan
(see FullScanRequest). The full scan for each keychain (K) stops after a gap of
stop_gap script pubkeys with no associated transactions. parallel_requests specifies
the maximum number of HTTP requests to make in parallel.
Sourcepub fn sync(
&self,
request: Arc<SyncRequest>,
parallel_requests: u64,
) -> Result<Arc<Update>, EsploraError>
pub fn sync( &self, request: Arc<SyncRequest>, parallel_requests: u64, ) -> Result<Arc<Update>, EsploraError>
Sync a set of scripts, txids, and/or outpoints against Esplora.
request provides the data required to perform a script-pubkey-based sync (see
SyncRequest). parallel_requests specifies the maximum number of HTTP requests to make
in parallel.
Sourcepub fn broadcast(&self, transaction: &Transaction) -> Result<(), EsploraError>
pub fn broadcast(&self, transaction: &Transaction) -> Result<(), EsploraError>
Broadcast a Transaction to Esplora.
Sourcepub fn get_tx(
&self,
txid: Arc<Txid>,
) -> Result<Option<Arc<Transaction>>, EsploraError>
pub fn get_tx( &self, txid: Arc<Txid>, ) -> Result<Option<Arc<Transaction>>, EsploraError>
Get a Transaction option given its Txid.
Sourcepub fn get_tx_no_opt(
&self,
txid: Arc<Txid>,
) -> Result<Arc<Transaction>, EsploraError>
pub fn get_tx_no_opt( &self, txid: Arc<Txid>, ) -> Result<Arc<Transaction>, EsploraError>
Get a Transaction given its Txid.
Sourcepub fn get_height(&self) -> Result<u32, EsploraError>
pub fn get_height(&self) -> Result<u32, EsploraError>
Get the height of the current blockchain tip.
Sourcepub fn get_tip_hash(&self) -> Result<Arc<BlockHash>, EsploraError>
pub fn get_tip_hash(&self) -> Result<Arc<BlockHash>, EsploraError>
Get the BlockHash of the current blockchain tip.
Sourcepub fn get_fee_estimates(&self) -> Result<HashMap<u16, f64>, EsploraError>
pub fn get_fee_estimates(&self) -> Result<HashMap<u16, f64>, EsploraError>
Get a map where the key is the confirmation target (in number of blocks) and the value is the estimated feerate (in sat/vB).
Sourcepub fn get_block_hash(
&self,
block_height: u32,
) -> Result<Arc<BlockHash>, EsploraError>
pub fn get_block_hash( &self, block_height: u32, ) -> Result<Arc<BlockHash>, EsploraError>
Get the BlockHash of a specific block height.
Sourcepub fn get_block_by_hash(
&self,
block_hash: Arc<BlockHash>,
) -> Result<Option<Block>, EsploraError>
pub fn get_block_by_hash( &self, block_hash: Arc<BlockHash>, ) -> Result<Option<Block>, EsploraError>
Get a Block given a particular BlockHash.
Sourcepub fn get_txid_at_block_index(
&self,
block_hash: Arc<BlockHash>,
index: u64,
) -> Result<Option<Arc<Txid>>, EsploraError>
pub fn get_txid_at_block_index( &self, block_hash: Arc<BlockHash>, index: u64, ) -> Result<Option<Arc<Txid>>, EsploraError>
Get a Txid of a transaction given its index in a block with a given hash.
Sourcepub fn get_header_by_hash(
&self,
block_hash: Arc<BlockHash>,
) -> Result<Header, EsploraError>
pub fn get_header_by_hash( &self, block_hash: Arc<BlockHash>, ) -> Result<Header, EsploraError>
Get a Header given a particular block hash.
Sourcepub fn get_tx_status(&self, txid: Arc<Txid>) -> Result<TxStatus, EsploraError>
pub fn get_tx_status(&self, txid: Arc<Txid>) -> Result<TxStatus, EsploraError>
Get the status of a Transaction given its Txid.
Sourcepub fn get_tx_info(&self, txid: Arc<Txid>) -> Result<Option<Tx>, EsploraError>
pub fn get_tx_info(&self, txid: Arc<Txid>) -> Result<Option<Tx>, EsploraError>
Get transaction info given its Txid.
Sourcepub fn get_address_txs(
&self,
address: Arc<Address>,
last_seen: Option<Arc<Txid>>,
) -> Result<Vec<Tx>, EsploraError>
pub fn get_address_txs( &self, address: Arc<Address>, last_seen: Option<Arc<Txid>>, ) -> Result<Vec<Tx>, EsploraError>
Get transaction history for the specified address, sorted with newest first.
Returns up to 50 mempool transactions plus the first 25 confirmed transactions. More can be requested by specifying the last txid seen by the previous query.
Trait Implementations§
Source§impl<UT> LiftRef<UT> for EsploraClient
impl<UT> LiftRef<UT> for EsploraClient
type LiftType = Arc<EsploraClient>
Source§impl<UT> LowerError<UT> for EsploraClient
impl<UT> LowerError<UT> for EsploraClient
Source§fn lower_error(obj: Self) -> RustBuffer
fn lower_error(obj: Self) -> RustBuffer
Source§impl<UT> LowerReturn<UT> for EsploraClient
impl<UT> LowerReturn<UT> for EsploraClient
Source§type ReturnType = <Arc<EsploraClient> as LowerReturn<UniFfiTag>>::ReturnType
type ReturnType = <Arc<EsploraClient> as LowerReturn<UniFfiTag>>::ReturnType
Source§fn lower_return(obj: Self) -> Result<Self::ReturnType, RustCallError>
fn lower_return(obj: Self) -> Result<Self::ReturnType, RustCallError>
§fn handle_failed_lift(
error: LiftArgsError,
) -> Result<Self::ReturnType, RustCallError>
fn handle_failed_lift( error: LiftArgsError, ) -> Result<Self::ReturnType, RustCallError>
Source§impl<UT> TypeId<UT> for EsploraClient
impl<UT> TypeId<UT> for EsploraClient
const TYPE_ID_META: MetadataBuffer
Auto Trait Implementations§
impl Freeze for EsploraClient
impl RefUnwindSafe for EsploraClient
impl Send for EsploraClient
impl Sync for EsploraClient
impl Unpin for EsploraClient
impl UnwindSafe for EsploraClient
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
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
§unsafe fn consume_handle(handle: Handle) -> Arc<T>
unsafe fn consume_handle(handle: Handle) -> Arc<T>
Arc<> Read more