Skip to main content
bitcoinQuery() returns a typed BitcoinQueryBuilder. Add the fields you need, then add one or more range-scoped requests.

Methods

addFields() narrows both the TypeScript output and the fields requested from Portal. The stream always adds block.number and block.hash for cursor handling.

Field groups

Request filters

Values inside a filter list are ORed. Different fields in one request are ANDed. Separate request clauses are combined across their ranges.

Ranges

Request ranges accept block numbers, formatted block-number strings, ISO dates, Date objects, and 'latest' for from.
Dates are resolved through the dataset’s timestamp endpoint before streaming. Resolution is at Portal chunk granularity, so a date is a coarse starting point rather than an exact timestamp boundary. Use numeric block bounds when the range must be precise. If from is 'latest', to must be a block number.

Bitcoin-specific formats

  • Hashes, scripts, and witness items are bare hex without 0x.
  • Output and previous-output values are BTC numbers, not satoshis.
  • Block timestamps are Unix seconds.
  • Address fields are optional because not every script has a standard address.
See Handling Bitcoin data for join and value-conversion examples.