pub struct Query(/* private fields */);Implementations§
Source§impl Query
impl Query
Sourcepub fn addr_last_activity_height(
&self,
addr: &Addr,
before_txid: Option<&Txid>,
) -> Result<Height>
pub fn addr_last_activity_height( &self, addr: &Addr, before_txid: Option<&Txid>, ) -> Result<Height>
Height of the last on-chain activity for an address (last tx_index to height).
With before_txid, returns the newest activity strictly older than that
cursor. Used by paginated chain etags so a new tx above the cursor
doesn’t invalidate deeper pages.
Source§impl Query
impl Query
pub fn addr_hash_prefix_matches( &self, addr_type: OutputType, prefix: &str, ) -> Result<AddrHashPrefixMatches>
Source§impl Query
impl Query
pub fn addr_mempool_hash(&self, addr: &Addr) -> Option<u64>
pub fn addr_mempool_txs( &self, addr: &Addr, limit: usize, ) -> Result<Vec<Transaction>>
Source§impl Query
impl Query
Sourcepub fn block(&self, hash: &BlockHash) -> Result<BlockInfo>
pub fn block(&self, hash: &BlockHash) -> Result<BlockInfo>
Block by hash. Unknown hash → 404 via height_by_hash.
Sourcepub fn block_by_height(&self, height: Height) -> Result<BlockInfo>
pub fn block_by_height(&self, height: Height) -> Result<BlockInfo>
Block by height. Height past tip (or pre-genesis) → OutOfRange.
Sourcepub fn block_by_height_v1(&self, height: Height) -> Result<BlockInfoV1>
pub fn block_by_height_v1(&self, height: Height) -> Result<BlockInfoV1>
V1 block by height. Ceiling is min(indexed, computed) because
blocks_v1_range reads computer-stamped series (pools, fees,
supply state). Anything past computed_height would short-read.
Sourcepub fn block_header_hex(&self, hash: &BlockHash) -> Result<String>
pub fn block_header_hex(&self, hash: &BlockHash) -> Result<String>
Hex-encoded 80-byte block header. Decode-then-encode roundtrip doubles as a corruption check on the on-disk bytes.
Sourcepub fn block_hash_by_height(&self, height: Height) -> Result<BlockHash>
pub fn block_hash_by_height(&self, height: Height) -> Result<BlockHash>
Block hash by height. Cheap typed-index read with a semantic
bounds gate (OutOfRange for past-tip, Internal if the data
is unexpectedly missing inside the gate).
Sourcepub fn blocks(
&self,
start_height: Option<Height>,
count: u32,
) -> Result<Vec<BlockInfo>>
pub fn blocks( &self, start_height: Option<Height>, count: u32, ) -> Result<Vec<BlockInfo>>
Most recent count blocks ending at start_height (default tip),
returned in descending-height order.
Sourcepub fn blocks_v1(
&self,
start_height: Option<Height>,
count: u32,
) -> Result<Vec<BlockInfoV1>>
pub fn blocks_v1( &self, start_height: Option<Height>, count: u32, ) -> Result<Vec<BlockInfoV1>>
V1 most recent count blocks with extras ending at start_height
(default tip), returned in descending-height order.
Sourcepub fn height_by_hash(&self, hash: &BlockHash) -> Result<Height>
pub fn height_by_hash(&self, hash: &BlockHash) -> Result<Height>
Hash to height, clamped to the safe-lengths snapshot. The prefix
store keys on the first 8 bytes of the hash, so the resolved
height is verified against the full blockhash[height] before
being returned. Prefix collisions, unknown hashes, and hashes
past the snapshot all surface as NotFound.
Sourcepub fn read_block_header(&self, height: Height) -> Result<Header>
pub fn read_block_header(&self, height: Height) -> Result<Header>
Read the on-disk 80-byte header at height and decode it.
Caller must bounds-check height (no OutOfRange mapping here).
Returns bitcoin::block::Header because callers feed it into
upstream consensus-encoding APIs (serialize_hex, MerkleBlock).
Source§impl Query
impl Query
pub fn block_status(&self, hash: &BlockHash) -> Result<BlockStatus>
Source§impl Query
impl Query
Sourcepub fn block_by_timestamp(&self, timestamp: Timestamp) -> Result<BlockTimestamp>
pub fn block_by_timestamp(&self, timestamp: Timestamp) -> Result<BlockTimestamp>
Most recent block with timestamp ≤ ts. Backs mempool.space’s
GET /api/v1/mining/blocks/timestamp/{ts}. Future timestamps return
the chain tip; pre-genesis timestamps return 404.
Uses day1.first_height for an O(1) seek to the target date, then a
linear scan bounded by the BIP113 MTP rule (see MTP_TERMINAL_STREAK).
Symmetric backward scan handles targets earlier than the seeded day’s
first block.
Source§impl Query
impl Query
Sourcepub fn block_txids(&self, hash: &BlockHash) -> Result<Vec<Txid>>
pub fn block_txids(&self, hash: &BlockHash) -> Result<Vec<Txid>>
All txids in the block, canonical order (coinbase first).
NotFound if the hash is unknown (or only collides on the 8-byte
prefix), OutOfRange if the resolved height is past the indexed tip.
Unpaginated by design.
Sourcepub fn block_txs(
&self,
hash: &BlockHash,
start_index: BlockTxIndex,
count: u32,
) -> Result<Vec<Transaction>>
pub fn block_txs( &self, hash: &BlockHash, start_index: BlockTxIndex, count: u32, ) -> Result<Vec<Transaction>>
Up to count transactions from the block, starting at the in-block
offset start_index (0 = coinbase). OutOfRange when start_index
is past the last tx in the block. Caller (route layer) sets count.
Sourcepub fn block_txid_at_index(
&self,
hash: &BlockHash,
index: BlockTxIndex,
) -> Result<Txid>
pub fn block_txid_at_index( &self, hash: &BlockHash, index: BlockTxIndex, ) -> Result<Txid>
Txid at an in-block offset (index is the position within the block,
0 = coinbase). NotFound if the hash is unknown or only collides on
the 8-byte prefix; OutOfRange if index is past the last tx in
the block.
Sourcepub fn transactions_by_indices(
&self,
indices: &[TxIndex],
) -> Result<Vec<Transaction>>
pub fn transactions_by_indices( &self, indices: &[TxIndex], ) -> Result<Vec<Transaction>>
Batch-read transactions at arbitrary indices. Reads in ascending index order for I/O locality, returns in caller’s order.
Three-phase approach for sequential cursor I/O:
Phase 1: decode transactions, collect outpoints + per-input prevout
metadata (sorted by tx_index).
Phase 2: resolve each prevout’s script_pubkey (sorted by
output_type, then type_index, for sequential addr-vec reads).
Phase 3: assemble Transaction objects, compute fees.
The final unwrap is provably safe: order is a permutation of
0..len, Phase 1 produces exactly one DecodedTx per position, and
Phase 3 assigns each txs[pos] once before the collect.
Source§impl Query
impl Query
Sourcepub fn cpfp(&self, txid: &Txid) -> Result<CpfpInfo>
pub fn cpfp(&self, txid: &Txid) -> Result<CpfpInfo>
Returns live mempool information when available, otherwise reconstructs the confirmed same-block cluster from indexed data.
Sourcepub fn effective_fee_rate(&self, txid: &Txid) -> Result<FeeRate>
pub fn effective_fee_rate(&self, txid: &Txid) -> Result<FeeRate>
Effective SFL chunk rate for live, confirmed, or replaced transactions.
Source§impl Query
impl Query
pub fn mempool_info(&self) -> Result<MempoolInfo>
pub fn mempool_txids(&self) -> Result<Vec<Txid>>
pub fn recommended_fees(&self) -> Result<RecommendedFees>
pub fn mempool_blocks(&self) -> Result<Vec<MempoolBlock>>
Sourcepub fn indexer_prevout_resolver(
&self,
) -> Box<dyn Fn(&[(Txid, Vout)]) -> FxHashMap<(Txid, Vout), TxOut> + Send + Sync>
pub fn indexer_prevout_resolver( &self, ) -> Box<dyn Fn(&[(Txid, Vout)]) -> FxHashMap<(Txid, Vout), TxOut> + Send + Sync>
Indexer-backed resolver for confirmed-parent prevouts. Boxed so
the caller (typically Mempool::start_with) can stash one
resolver behind a stable type for the lifetime of the loop.
pub fn mempool_recent(&self) -> Result<Vec<MempoolRecentTx>>
Sourcepub fn tx_rbf(&self, txid: &Txid) -> Result<RbfResponse>
pub fn tx_rbf(&self, txid: &Txid) -> Result<RbfResponse>
RBF history for a tx. Matches mempool.space’s
GET /api/v1/tx/:txid/rbf. Mempool builds the owned tree under
one read-lock window; this then layers on mined + effective
fee rate from the indexer/computer.
Sourcepub fn recent_replacements(
&self,
full_rbf_only: bool,
) -> Result<Vec<ReplacementNode>>
pub fn recent_replacements( &self, full_rbf_only: bool, ) -> Result<Vec<ReplacementNode>>
Recent RBF replacements. Matches mempool.space’s
GET /api/v1/replacements and GET /api/v1/fullrbf/replacements.
Most-recent first, capped at 25. full_rbf_only keeps only
trees with at least one non-signaling predecessor.
Sourcepub fn transaction_times(&self, txids: &[Txid]) -> Result<Vec<u64>>
pub fn transaction_times(&self, txids: &[Txid]) -> Result<Vec<u64>>
first_seen Unix-second timestamps. Matches mempool.space’s
POST /api/v1/transaction-times. Returns 0 for unknowns.
Sourcepub fn mempool_hash(&self) -> Result<NextBlockHash>
pub fn mempool_hash(&self) -> Result<NextBlockHash>
Content hash of the projected next block. Same value as the mempool ETag. Polling lets monitors detect a stalled sync.
Sourcepub fn block_template(&self) -> Result<BlockTemplate>
pub fn block_template(&self) -> Result<BlockTemplate>
Full projected next block (Core’s getblocktemplate selection)
with stats and full tx bodies in GBT order.
Sourcepub fn block_template_diff(
&self,
since: NextBlockHash,
) -> Result<BlockTemplateDiff>
pub fn block_template_diff( &self, since: NextBlockHash, ) -> Result<BlockTemplateDiff>
Delta of the projected next block since since. NotFound
when since has aged out (client should fall back to
block_template).
Source§impl Query
impl Query
Sourcepub fn block_fee_rates(
&self,
time_period: TimePeriod,
) -> Result<Vec<BlockFeeRatesEntry>>
pub fn block_fee_rates( &self, time_period: TimePeriod, ) -> Result<Vec<BlockFeeRatesEntry>>
Time-bucketed fee-rate percentiles over time_period. One entry per
bucket, ordered chronologically. Each entry carries the bucket’s
average height/timestamp and the seven percentile means
(min, pct10, pct25, median, pct75, pct90, max).
Source§impl Query
impl Query
Sourcepub fn block_fees(&self, time_period: TimePeriod) -> Result<Vec<BlockFeesEntry>>
pub fn block_fees(&self, time_period: TimePeriod) -> Result<Vec<BlockFeesEntry>>
Time-bucketed average block fees over time_period. One entry per
bucket, ordered chronologically. Each entry carries the bucket’s
average height/timestamp, the round-half-up mean of block fees in
sats, and the bucket-mean USD spot price (the spot price, not
fees-in-USD: clients multiply).
Source§impl Query
impl Query
Sourcepub fn block_rewards(
&self,
time_period: TimePeriod,
) -> Result<Vec<BlockRewardsEntry>>
pub fn block_rewards( &self, time_period: TimePeriod, ) -> Result<Vec<BlockRewardsEntry>>
Time-bucketed average block rewards (subsidy + fees) over
time_period. One entry per bucket, ordered chronologically. Each
entry carries the bucket’s average height/timestamp, the round-half-up
mean of coinbase rewards in sats, and the bucket-mean USD spot price
(the spot price, not rewards-in-USD: clients multiply).
Source§impl Query
impl Query
Sourcepub fn block_sizes_weights(
&self,
time_period: TimePeriod,
) -> Result<BlockSizesWeights>
pub fn block_sizes_weights( &self, time_period: TimePeriod, ) -> Result<BlockSizesWeights>
Time-bucketed average block size and weight over time_period. Returns
two parallel vecs (one entry per bucket, ordered chronologically): byte
size in sizes, weight units in weights. Each entry carries the
bucket’s average height/timestamp and the round-half-up mean of the
corresponding metric. Single bucket-pass: built via .map(...).unzip()
to avoid re-walking buckets.
Source§impl Query
impl Query
Sourcepub fn difficulty_adjustment(&self) -> Result<DifficultyAdjustment>
pub fn difficulty_adjustment(&self) -> Result<DifficultyAdjustment>
Live difficulty-adjustment snapshot for the current epoch. Bundles progress through the 2016-block window, the projected next-retarget percentage from observed pace, an estimated wall-clock retarget time, remaining blocks/time, the previous retarget percentage (current epoch vs previous epoch first-block difficulty), and the time offset from a 600s/block schedule. Output time fields are in milliseconds.
Source§impl Query
impl Query
Sourcepub fn difficulty_adjustments(
&self,
time_period: Option<TimePeriod>,
) -> Result<Vec<DifficultyAdjustmentEntry>>
pub fn difficulty_adjustments( &self, time_period: Option<TimePeriod>, ) -> Result<Vec<DifficultyAdjustmentEntry>>
All difficulty adjustments (one entry per retarget) whose first block
lies within time_period, in reverse chronological order (newest
first). None walks every epoch from genesis. The window cutoff is
wall-clock (via start_height) rather than block-count, so the
returned set is “epochs whose first block lies within the period”,
not “the last N epochs”.
Source§impl Query
impl Query
Sourcepub fn hashrate(
&self,
time_period: Option<TimePeriod>,
max_points: usize,
) -> Result<HashrateSummary>
pub fn hashrate( &self, time_period: Option<TimePeriod>, max_points: usize, ) -> Result<HashrateSummary>
Network hashrate summary for time_period (None walks the full
chain). Bundles a downsampled daily hashrate series (at most
max_points samples; sampling step is total_days / max_points,
floored at 1), every difficulty retarget within the window, the
current 1-day hashrate, and the current block’s difficulty. The
window cutoff is wall-clock (via start_height), matching
difficulty_adjustments so the two endpoints agree on the same
time_period.
Source§impl Query
impl Query
Sourcepub fn mining_pools(&self, time_period: TimePeriod) -> Result<PoolsSummary>
pub fn mining_pools(&self, time_period: TimePeriod) -> Result<PoolsSummary>
Mining-pool leaderboard for time_period. For each pool, computes
block count over the window via cumulative(end) - cumulative(start - 1)
(tip-cumulative minus pre-window-cumulative), sorts pools by count
descending, assigns ranks, and emits the per-pool share. Also bundles
current / 3d / 1w network hashrate snapshots. Returns zeros early
when no blocks have been indexed. The window start uses the
timestamp-based lookback vecs (_24h, _3d, …) rather than
block-count math; TimePeriod::All walks from genesis.
Sourcepub fn all_pools(&self) -> Vec<PoolInfo>
pub fn all_pools(&self) -> Vec<PoolInfo>
All supported pools as PoolInfo. Static list, no indexer reads, can’t fail.
Sourcepub fn pool_detail(&self, slug: PoolSlug) -> Result<PoolDetail>
pub fn pool_detail(&self, slug: PoolSlug) -> Result<PoolDetail>
Per-pool detail: lifetime block count plus 24h and 1w windowed counts,
each as a share of network blocks in the same window. The 24h share is
also used to weight the current 1-day network hashrate into a per-pool
estimated_hashrate. total_reward is Some only for major pools
(minor pools don’t track per-pool reward sums); under stamp lag on a
major pool’s reward vec this errors rather than silently reporting
None.
Sourcepub fn pool_blocks(
&self,
slug: PoolSlug,
before_height: Option<Height>,
limit: usize,
) -> Result<Vec<BlockInfoV1>>
pub fn pool_blocks( &self, slug: PoolSlug, before_height: Option<Height>, limit: usize, ) -> Result<Vec<BlockInfoV1>>
Page of blocks mined by slug, in descending height order, capped at
limit. before_height is the inclusive upper bound to paginate from
(defaults to tip). Returns an empty Vec if the pool has no recorded
blocks. Heights come from a sorted-ascending per-pool index, so the
page is computed via partition_point then reversed; consecutive
runs are merged into a single bulk read of blocks_v1_range.
Sourcepub fn pool_hashrate(&self, slug: PoolSlug) -> Result<Vec<PoolHashrateEntry>>
pub fn pool_hashrate(&self, slug: PoolSlug) -> Result<Vec<PoolHashrateEntry>>
Weekly-sampled hashrate series for a single pool over the full chain.
Each point’s hashrate is network_hashrate(day) * pool_share_over_7d,
where the share is the pool’s last-7-days block count divided by the
network’s last-7-days block count.
Sourcepub fn pools_hashrate(
&self,
time_period: Option<TimePeriod>,
) -> Result<Vec<PoolHashrateEntry>>
pub fn pools_hashrate( &self, time_period: Option<TimePeriod>, ) -> Result<Vec<PoolHashrateEntry>>
Multi-pool weekly-sampled hashrate series over time_period. Walks
the full chain when time_period is None or Some(TimePeriod::All).
For each known pool, emits one entry per weekly sample where the
hashrate is network_hashrate(day) * pool_share_over_7d, tagged with
pool_name. Entries from all pools are concatenated; the chart layer
groups by pool name.
Source§impl Query
impl Query
Sourcepub fn reward_stats(&self, block_count: usize) -> Result<RewardStats>
pub fn reward_stats(&self, block_count: usize) -> Result<RewardStats>
Sums coinbase rewards, fees, and tx counts over the last block_count
blocks ending at the current tip. Errors OutOfRange if block_count
is zero, and Internal if any of the three per-block vecs (coinbase,
fees, tx count) is stamped short of the tip - silent truncation by
fold_range_at would otherwise produce a quietly low total.
Source§impl Query
impl Query
pub fn live_price(&self) -> Result<Dollars>
Sourcepub fn live_payment_histogram(&self) -> Result<HistogramEmaCompact>
pub fn live_payment_histogram(&self) -> Result<HistogramEmaCompact>
Smoothed payment output histogram at the live tip, quantized for the wire.
Sourcepub fn confirmed_payment_histogram(
&self,
height: usize,
) -> Result<HistogramEmaCompact>
pub fn confirmed_payment_histogram( &self, height: usize, ) -> Result<HistogramEmaCompact>
Smoothed payment output histogram for a confirmed height, deterministically
reconstructed by replaying the window ending at height. EMA values are
seed-independent, so the result is exact.
Sourcepub fn confirmed_payment_histogram_day(
&self,
day: Day1,
) -> Result<HistogramEmaCompact>
pub fn confirmed_payment_histogram_day( &self, day: Day1, ) -> Result<HistogramEmaCompact>
Smoothed payment output histogram for a calendar day: the bin-by-bin average of
every confirmed block’s per-block EMA. The first block in each EMA config
segment is reconstructed exactly, then later blocks in the segment are walked
sequentially. Averaging keeps the result an intensive per-block rate rather
than letting a busy day dominate.
Sourcepub fn live_output_histogram(&self) -> Result<HistogramRaw>
pub fn live_output_histogram(&self) -> Result<HistogramRaw>
Unfiltered per-bin output counts at the live tip: every forming-block mempool output binned by value, with none of the round-dollar payment filters applied. Zeros when no mempool is configured.
Sourcepub fn confirmed_output_histogram(&self, height: usize) -> Result<HistogramRaw>
pub fn confirmed_output_histogram(&self, height: usize) -> Result<HistogramRaw>
Unfiltered per-bin output counts for a confirmed height: every output
in the block binned by value, with no payment filtering.
Sourcepub fn confirmed_output_histogram_day(&self, day: Day1) -> Result<HistogramRaw>
pub fn confirmed_output_histogram_day(&self, day: Day1) -> Result<HistogramRaw>
Unfiltered per-bin output counts for a calendar day: every block’s output
histogram summed bin-by-bin. Raw counts are additive, so the day total is
just the sum across its confirmed blocks.
Source§impl Query
impl Query
pub fn historical_price( &self, timestamp: Option<Timestamp>, ) -> Result<HistoricalPrice>
Source§impl Query
impl Query
pub fn search_series(&self, query: &SearchQuery) -> Vec<&'static str>
Sourcepub fn series_not_found_error(&self, series: &SeriesName) -> Error
pub fn series_not_found_error(&self, series: &SeriesName) -> Error
Returns the error for a missing series: SeriesUnsupportedIndex if the name
exists at other indexes, else SeriesNotFound with fuzzy-match suggestions.
Sourcepub fn latest(&self, series: &SeriesName, index: Index) -> Result<Value>
pub fn latest(&self, series: &SeriesName, index: Index) -> Result<Value>
Returns the latest value for a single series as a JSON value.
Sourcepub fn len(&self, series: &SeriesName, index: Index) -> Result<usize>
pub fn len(&self, series: &SeriesName, index: Index) -> Result<usize>
Returns the length (total data points) for a single series.
Sourcepub fn version(&self, series: &SeriesName, index: Index) -> Result<Version>
pub fn version(&self, series: &SeriesName, index: Index) -> Result<Version>
Returns the version for a single series.
Sourcepub fn search(
&self,
params: &SeriesSelection,
) -> Result<Vec<&'static dyn AnyExportableVec>>
pub fn search( &self, params: &SeriesSelection, ) -> Result<Vec<&'static dyn AnyExportableVec>>
Search for vecs matching the given series and index. Returns error if no series requested or any requested series is not found.
Sourcepub fn weight(
vecs: &[&dyn AnyExportableVec],
from: Option<i64>,
to: Option<i64>,
) -> usize
pub fn weight( vecs: &[&dyn AnyExportableVec], from: Option<i64>, to: Option<i64>, ) -> usize
Calculate total weight of the vecs for the given range.
Sourcepub fn resolve(
&self,
params: SeriesSelection,
max_weight: usize,
) -> Result<ResolvedQuery>
pub fn resolve( &self, params: SeriesSelection, max_weight: usize, ) -> Result<ResolvedQuery>
Resolve query metadata without formatting (cheap).
Use with format for lazy formatting after ETag check.
Sourcepub fn stable_count(
&self,
index: Index,
total: usize,
tip_height: Height,
) -> Option<usize>
pub fn stable_count( &self, index: Index, total: usize, tip_height: Height, ) -> Option<usize>
Count of leading entries provably immutable across a 6-block reorg, used to gate the historical-branch series ETag.
- Bucketed indexes:
total - margin. - Entity indexes:
first_X_index[tip_height - 6], falling back to 0 if the tip is shallower than 6 blocks. Clamped tototalso a query whose vecs are shorter than the entity-type’s own count never marks its live tail as stable. - Mutable (Funded/Empty addr):
None. No immutable region exists, so the caller must use the tip-bound ETag for every range.
Sourcepub fn format(&self, resolved: ResolvedQuery) -> Result<SeriesOutput>
pub fn format(&self, resolved: ResolvedQuery) -> Result<SeriesOutput>
Format a resolved query (expensive). Call after ETag/cache checks to avoid unnecessary work.
Sourcepub fn format_raw(&self, resolved: ResolvedQuery) -> Result<SeriesOutput>
pub fn format_raw(&self, resolved: ResolvedQuery) -> Result<SeriesOutput>
Format a resolved query as raw data (just the JSON values, no SeriesData wrapper).
Single vec → [v1,v2,...]. Multi-vec → [[v1,v2],[v3,v4],...].
CSV output is identical to format (no wrapper distinction for CSV).
pub fn series_count(&self) -> DetailedSeriesCount
pub fn indexes(&self) -> &'static [IndexInfo]
pub fn series_list(&self, pagination: Pagination) -> PaginatedSeries
pub fn series_catalog(&self) -> &'static TreeNode
pub fn series_info(&self, series: &SeriesName) -> Option<SeriesInfo>
Sourcepub fn format_legacy(
&self,
resolved: ResolvedQuery,
) -> Result<SeriesOutputLegacy>
pub fn format_legacy( &self, resolved: ResolvedQuery, ) -> Result<SeriesOutputLegacy>
Deprecated - format a resolved query as legacy output (expensive).
Source§impl Query
impl Query
pub fn txid_by_index(&self, index: TxIndex) -> Result<Txid>
Sourcepub fn resolve_tx(&self, txid: &Txid) -> Result<(TxIndex, Height)>
pub fn resolve_tx(&self, txid: &Txid) -> Result<(TxIndex, Height)>
Resolve a txid to (TxIndex, Height).
pub fn transaction(&self, txid: &Txid) -> Result<Transaction>
pub fn transaction_status(&self, txid: &Txid) -> Result<TxStatus>
pub fn transaction_raw(&self, txid: &Txid) -> Result<Vec<u8>>
pub fn transaction_hex(&self, txid: &Txid) -> Result<String>
pub fn outspend(&self, txid: &Txid, vout: Vout) -> Result<TxOutspend>
pub fn outspends(&self, txid: &Txid) -> Result<Vec<TxOutspend>>
pub fn broadcast_transaction(&self, hex: &str) -> Result<Txid>
pub fn merkleblock_proof(&self, txid: &Txid) -> Result<String>
pub fn merkle_proof(&self, txid: &Txid) -> Result<MerkleProof>
Source§impl Query
impl Query
Sourcepub fn urpd_cohorts(&self) -> Result<Vec<Cohort>>
pub fn urpd_cohorts(&self) -> Result<Vec<Cohort>>
Available cohorts for URPD.
Sourcepub fn urpd_dates_with_weight(
&self,
cohort: &Cohort,
weight: UrpdWeight,
) -> Result<Vec<Date>>
pub fn urpd_dates_with_weight( &self, cohort: &Cohort, weight: UrpdWeight, ) -> Result<Vec<Date>>
Available dates for a cohort and weighting.
Sourcepub fn urpd_raw(&self, cohort: &Cohort, date: Date) -> Result<UrpdRaw>
pub fn urpd_raw(&self, cohort: &Cohort, date: Date) -> Result<UrpdRaw>
Raw URPD data for a cohort on a specific date.
Sourcepub fn urpd_raw_with_weight(
&self,
cohort: &Cohort,
date: Date,
weight: UrpdWeight,
) -> Result<UrpdRaw>
pub fn urpd_raw_with_weight( &self, cohort: &Cohort, date: Date, weight: UrpdWeight, ) -> Result<UrpdRaw>
Raw URPD data with an optional Bedrock weighting.
Sourcepub fn urpd_at(
&self,
cohort: &Cohort,
date: Date,
agg: UrpdAggregation,
) -> Result<Urpd>
pub fn urpd_at( &self, cohort: &Cohort, date: Date, agg: UrpdAggregation, ) -> Result<Urpd>
URPD for a cohort on a specific date.
Sourcepub fn urpd_at_with_weight(
&self,
cohort: &Cohort,
date: Date,
agg: UrpdAggregation,
weight: UrpdWeight,
) -> Result<Urpd>
pub fn urpd_at_with_weight( &self, cohort: &Cohort, date: Date, agg: UrpdAggregation, weight: UrpdWeight, ) -> Result<Urpd>
URPD for a cohort on a specific date and weighting.
Sourcepub fn urpd_latest(&self, cohort: &Cohort, agg: UrpdAggregation) -> Result<Urpd>
pub fn urpd_latest(&self, cohort: &Cohort, agg: UrpdAggregation) -> Result<Urpd>
URPD for the most recently available date in a cohort.
Sourcepub fn urpd_latest_with_weight(
&self,
cohort: &Cohort,
agg: UrpdAggregation,
weight: UrpdWeight,
) -> Result<Urpd>
pub fn urpd_latest_with_weight( &self, cohort: &Cohort, agg: UrpdAggregation, weight: UrpdWeight, ) -> Result<Urpd>
Most recent URPD for a cohort and weighting.
Source§impl Query
impl Query
pub fn build( reader: &Reader, indexer: &Indexer, computer: &Computer, mempool: Option<Mempool>, ) -> Self
Sourcepub fn height(&self) -> Height
pub fn height(&self) -> Height
Pipeline-safe ceiling: the highest height for which both the
indexer and computer have committed durable data. Backed by
Indexer::safe_lengths(), advanced by main.rs after each
compute pass and lowered before any rollback.
Returns a height (the last fully-written block), not a length.
safe_lengths().height is a count: N means heights 0..N are
committed, so the highest is N-1. Pre-genesis (N == 0) falls
back to Height::default() and clients treat it as “nothing
indexed yet”.
Sourcepub fn tip_blockhash(&self) -> BlockHash
pub fn tip_blockhash(&self) -> BlockHash
Tip block hash at the pipeline-safe ceiling.
Sourcepub fn tip_hash_prefix(&self) -> BlockHashPrefix
pub fn tip_hash_prefix(&self) -> BlockHashPrefix
Tip block hash prefix for cache etags.
Sourcepub fn sync_status(&self, tip_height: Height) -> Result<SyncStatus>
pub fn sync_status(&self, tip_height: Height) -> Result<SyncStatus>
Build sync status with the given tip height. indexed_height and
computed_height reflect live per-vec stamps (diagnostic) and may be
briefly ahead of fully-flushed data; the timestamp data read uses the
safe-lengths-derived height so it never outruns committed bytes.
pub fn reader(&self) -> &Reader
pub fn client(&self) -> &Client
pub fn blocks_dir(&self) -> &Path
pub fn indexer(&self) -> &Indexer<Ro>
pub fn computer(&self) -> &Computer<Ro>
pub fn mempool(&self) -> Option<&Mempool>
pub fn vecs(&self) -> &'static Vecs<'static>
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Query
impl !UnwindSafe for Query
impl Freeze for Query
impl Send for Query
impl Sync for Query
impl Unpin for Query
impl UnsafeUnpin for Query
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more