Package 

Class EsploraClient

  • All Implemented Interfaces:
    java.lang.AutoCloseable , org.bitcoindevkit.Disposable , org.bitcoindevkit.EsploraClientInterface

    
    public class EsploraClient
     implements Disposable, AutoCloseable, EsploraClientInterface
                        

    Wrapper around an esplora_client::BlockingClient which includes an internal in-memory transaction cache to avoid re-fetching already downloaded transactions.

    • Constructor Detail

      • EsploraClient

        EsploraClient(String url, String proxy)
        Creates a new bdk client from an esplora_client::BlockingClient.
    • Method Detail

      • fullScan

         Update fullScan(FullScanRequest request, ULong stopGap, ULong parallelRequests)

        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.

      • getAddressTxs

         List<Tx> getAddressTxs(Address address, Txid lastSeen)

        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.

      • getFeeEstimates

         Map<UShort, Double> getFeeEstimates()

        Get a map where the key is the confirmation target (in number of blocks) and the value is the estimated feerate (in sat/vB).

      • getHeight

         UInt getHeight()

        Get the height of the current blockchain tip.

      • getTxInfo

         Tx getTxInfo(Txid txid)

        Get transaction info given its `Txid`.

      • sync

         Update sync(SyncRequest request, ULong parallelRequests)

        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.