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 Summary
Constructors Constructor Description EsploraClient(Pointer pointer)EsploraClient(NoPointer noPointer)This constructor can be used to instantiate a fake object. EsploraClient(String url, String proxy)Creates a new bdk client from an esplora_client::BlockingClient.
-
Method Summary
Modifier and Type Method Description Unitdestroy()Unitclose()final PointeruniffiClonePointer()Unitbroadcast(Transaction transaction)Broadcast a `Transaction` to Esplora. UpdatefullScan(FullScanRequest request, ULong stopGap, ULong parallelRequests)Scan keychain scripts for transactions against Esplora, returning an update that can be applied to the receiving structures. StringgetBlockHash(UInt blockHeight)Get the `BlockHash` of a specific block height. 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). UIntgetHeight()Get the height of the current blockchain tip. TransactiongetTx(String txid)Get a `Transaction` option given its `Txid`. TxgetTxInfo(String txid)Get transaction info given its `Txid`. TxStatusgetTxStatus(String txid)Get the status of a `Transaction` given its `Txid`. Updatesync(SyncRequest request, ULong parallelRequests)Sync a set of scripts, txids, and/or outpoints against Esplora. -
-
Method Detail
-
uniffiClonePointer
final Pointer uniffiClonePointer()
-
broadcast
Unit broadcast(Transaction transaction)
Broadcast a `Transaction` to Esplora.
-
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.
requestprovides the data required to perform a script-pubkey-based full scan (see `FullScanRequest`). The full scan for each keychain (K) stops after a gap ofstop_gapscript pubkeys with no associated transactions.parallel_requestsspecifies the maximum number of HTTP requests to make in parallel.
-
getBlockHash
String getBlockHash(UInt blockHeight)
Get the `BlockHash` of a specific block height.
-
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).
-
getTx
Transaction getTx(String txid)
Get a `Transaction` option given its `Txid`.
-
getTxStatus
TxStatus getTxStatus(String txid)
Get the status of a `Transaction` given its `Txid`.
-
sync
Update sync(SyncRequest request, ULong parallelRequests)
Sync a set of scripts, txids, and/or outpoints against Esplora.
requestprovides the data required to perform a script-pubkey-based sync (see `SyncRequest`).parallel_requestsspecifies the maximum number of HTTP requests to make in parallel.
-
-
-
-