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)
Creates a new bdk client from a esplora_client::BlockingClient
-
Method Summary
Modifier and Type Method Description Unit
destroy()
Unit
close()
final Pointer
uniffiClonePointer()
Unit
broadcast(Transaction transaction)
Broadcast a `Transaction` to Esplora. 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. String
getBlockHash(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). UInt
getHeight()
Get the height of the current blockchain tip. Transaction
getTx(String txid)
Get a `Transaction` option given its `Txid`. Tx
getTxInfo(String txid)
Get transaction info given it's `Txid`. TxStatus
getTxStatus(String txid)
Get the status of a `Transaction` given its `Txid`. Update
sync(SyncRequest request, ULong parallelRequests)
Sync a set of scripts, txids, and/or outpoints against Esplora.
-
-
-
Constructor Detail
-
EsploraClient
EsploraClient(Pointer pointer)
-
EsploraClient
EsploraClient(NoPointer noPointer)
This constructor can be used to instantiate a fake object.
-
EsploraClient
EsploraClient(String url)
Creates a new bdk client from a esplora_client::BlockingClient
-
-
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.
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 ofstop_gap
script pubkeys with no associated transactions.parallel_requests
specifies 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.
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.
-
-