bdkffi::esplora

Struct EsploraClient

Source
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

Source

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.

Source

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.

Source

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.

Source

pub fn broadcast(&self, transaction: &Transaction) -> Result<(), EsploraError>

Broadcast a Transaction to Esplora.

Source

pub fn get_tx( &self, txid: Arc<Txid>, ) -> Result<Option<Arc<Transaction>>, EsploraError>

Get a Transaction option given its Txid.

Source

pub fn get_tx_no_opt( &self, txid: Arc<Txid>, ) -> Result<Arc<Transaction>, EsploraError>

Get a Transaction given its Txid.

Source

pub fn get_height(&self) -> Result<u32, EsploraError>

Get the height of the current blockchain tip.

Source

pub fn get_tip_hash(&self) -> Result<Arc<BlockHash>, EsploraError>

Get the BlockHash of the current blockchain tip.

Source

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).

Source

pub fn get_block_hash( &self, block_height: u32, ) -> Result<Arc<BlockHash>, EsploraError>

Get the BlockHash of a specific block height.

Source

pub fn get_block_by_hash( &self, block_hash: Arc<BlockHash>, ) -> Result<Option<Block>, EsploraError>

Get a Block given a particular BlockHash.

Source

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.

Source

pub fn get_header_by_hash( &self, block_hash: Arc<BlockHash>, ) -> Result<Header, EsploraError>

Get a Header given a particular block hash.

Source

pub fn get_tx_status(&self, txid: Arc<Txid>) -> Result<TxStatus, EsploraError>

Get the status of a Transaction given its Txid.

Source

pub fn get_tx_info(&self, txid: Arc<Txid>) -> Result<Option<Tx>, EsploraError>

Get transaction info given its Txid.

Source

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

Source§

impl<UT> LowerError<UT> for EsploraClient

Source§

fn lower_error(obj: Self) -> RustBuffer

Lower this value for scaffolding function return Read more
Source§

impl<UT> LowerReturn<UT> for EsploraClient

Source§

type ReturnType = <Arc<EsploraClient> as LowerReturn<UniFfiTag>>::ReturnType

The type that should be returned by scaffolding functions for this type. Read more
Source§

fn lower_return(obj: Self) -> Result<Self::ReturnType, RustCallError>

Lower the return value from an scaffolding call Read more
§

fn handle_failed_lift( error: LiftArgsError, ) -> Result<Self::ReturnType, RustCallError>

Lower the return value for failed argument lifts Read more
Source§

impl<UT> TypeId<UT> for EsploraClient

Source§

const TYPE_ID_META: MetadataBuffer

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.

§

impl<T, UT> HandleAlloc<UT> for T
where T: Send + Sync,

§

fn new_handle(value: Arc<T>) -> Handle

Create a new handle for an Arc value Read more
§

unsafe fn clone_handle(handle: Handle) -> Handle

Clone a handle Read more
§

unsafe fn consume_handle(handle: Handle) -> Arc<T>

Consume a handle, getting back the initial Arc<> Read more
§

unsafe fn get_arc(handle: Handle) -> Arc<Self>

Get a clone of the Arc<> using a “borrowed” handle. Read more
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, 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.
§

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

§

fn vzip(self) -> V