brk-client 0.3.0-beta.7 → 0.3.0-beta.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +1577 -1269
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -8,6 +8,13 @@
8
8
  *
9
9
  * @typedef {string} Addr
10
10
  */
11
+ /**
12
+ * Bitcoin address + last-seen txid path parameters (Esplora-style pagination)
13
+ *
14
+ * @typedef {Object} AddrAfterTxidParam
15
+ * @property {Addr} address
16
+ * @property {Txid} afterTxid - Last txid from the previous page (return transactions strictly older than this)
17
+ */
11
18
  /**
12
19
  * Address statistics on the blockchain (confirmed transactions only)
13
20
  *
@@ -47,11 +54,7 @@
47
54
  * @property {Addr} address - Bitcoin address string
48
55
  * @property {OutputType} addrType - Address type (p2pkh, p2sh, v0_p2wpkh, v0_p2wsh, v1_p2tr, etc.)
49
56
  * @property {AddrChainStats} chainStats - Statistics for confirmed transactions on the blockchain
50
- * @property {(AddrMempoolStats|null)=} mempoolStats - Statistics for unconfirmed transactions in the mempool
51
- */
52
- /**
53
- * @typedef {Object} AddrTxidsParam
54
- * @property {(Txid|null)=} afterTxid - Txid to paginate from (return transactions before this one)
57
+ * @property {AddrMempoolStats} mempoolStats - Statistics for unconfirmed transactions in the mempool
55
58
  */
56
59
  /**
57
60
  * Address validation result
@@ -190,14 +193,14 @@ Matches mempool.space/bitcoin-cli behavior.
190
193
  *
191
194
  * @typedef {Object} BlockHashStartIndex
192
195
  * @property {BlockHash} hash - Bitcoin block hash
193
- * @property {TxIndex} startIndex - Starting transaction index within the block (0-based)
196
+ * @property {BlockTxIndex} startIndex - Starting transaction index within the block (0-based)
194
197
  */
195
198
  /**
196
199
  * Block hash + transaction index path parameters
197
200
  *
198
201
  * @typedef {Object} BlockHashTxIndex
199
202
  * @property {BlockHash} hash - Bitcoin block hash
200
- * @property {TxIndex} index - Transaction index within the block (0-based)
203
+ * @property {BlockTxIndex} index - Transaction index within the block (0-based)
201
204
  */
202
205
  /**
203
206
  * Block information matching mempool.space /api/block/{hash}
@@ -286,6 +289,12 @@ Matches mempool.space/bitcoin-cli behavior.
286
289
  * @property {BlockHash} hash - Block hash
287
290
  * @property {string} timestamp - Block timestamp in ISO 8601 format
288
291
  */
292
+ /**
293
+ * Position of a transaction within a single block (0 = coinbase).
294
+ * Distinct from `TxIndex`, which is the chain-wide global tx index.
295
+ *
296
+ * @typedef {number} BlockTxIndex
297
+ */
289
298
  /**
290
299
  * A single block weight data point.
291
300
  *
@@ -327,6 +336,10 @@ Matches mempool.space/bitcoin-cli behavior.
327
336
  /**
328
337
  * URPD cohort identifier. Use `GET /api/urpd` to list available cohorts.
329
338
  *
339
+ * Validated at construction: non-empty, ASCII `[a-z0-9_]+`. Matches the
340
+ * schemars enum value set; the type therefore proves "this is a valid
341
+ * cohort name" wherever a `Cohort` is held.
342
+ *
330
343
  * @typedef {("all"|"sth"|"lth"|"utxos_under_1h_old"|"utxos_1h_to_1d_old"|"utxos_1d_to_1w_old"|"utxos_1w_to_1m_old"|"utxos_1m_to_2m_old"|"utxos_2m_to_3m_old"|"utxos_3m_to_4m_old"|"utxos_4m_to_5m_old"|"utxos_5m_to_6m_old"|"utxos_6m_to_1y_old"|"utxos_1y_to_2y_old"|"utxos_2y_to_3y_old"|"utxos_3y_to_4y_old"|"utxos_4y_to_5y_old"|"utxos_5y_to_6y_old"|"utxos_6y_to_7y_old"|"utxos_7y_to_8y_old"|"utxos_8y_to_10y_old"|"utxos_10y_to_12y_old"|"utxos_12y_to_15y_old"|"utxos_over_15y_old")} Cohort
331
344
  */
332
345
  /**
@@ -360,23 +373,64 @@ Matches mempool.space/bitcoin-cli behavior.
360
373
  * @typedef {("supply"|"realized"|"unrealized")} CostBasisValue
361
374
  */
362
375
  /**
363
- * A transaction in a CPFP relationship
376
+ * CPFP cluster: the connected component the seed belongs to, plus its
377
+ * SFL linearization.
378
+ *
379
+ * @typedef {Object} CpfpCluster
380
+ * @property {CpfpClusterTx[]} txs - All txs in the cluster, in topological order (parents before children).
381
+ * @property {CpfpClusterChunk[]} chunks - SFL-emitted chunks ordered by descending feerate.
382
+ * @property {number} chunkIndex - Index into `chunks` of the chunk containing the seed tx.
383
+ */
384
+ /**
385
+ * One SFL chunk inside a `CpfpCluster`. `txs` is in topological order
386
+ * (matches `CpfpCluster.txs` ordering); the chunk's `feerate` is the
387
+ * per-chunk SFL feerate and is the same for every tx in this chunk.
388
+ *
389
+ * @typedef {Object} CpfpClusterChunk
390
+ * @property {CpfpClusterTxIndex[]} txs
391
+ * @property {FeeRate} feerate
392
+ */
393
+ /**
394
+ * One entry in a `CpfpCluster.txs` array.
395
+ *
396
+ * @typedef {Object} CpfpClusterTx
397
+ * @property {Txid} txid
398
+ * @property {Weight} weight
399
+ * @property {Sats} fee
400
+ * @property {CpfpClusterTxIndex[]} parents - In-cluster parents of this tx.
401
+ */
402
+ /**
403
+ * Position of a transaction inside a `CpfpCluster.txs` array. Cluster-local,
404
+ * has no meaning outside the enclosing cluster.
405
+ *
406
+ * @typedef {number} CpfpClusterTxIndex
407
+ */
408
+ /**
409
+ * A transaction in a CPFP relationship.
364
410
  *
365
411
  * @typedef {Object} CpfpEntry
366
- * @property {Txid} txid - Transaction ID
367
- * @property {Weight} weight - Transaction weight
368
- * @property {Sats} fee - Transaction fee (sats)
412
+ * @property {Txid} txid
413
+ * @property {Weight} weight
414
+ * @property {Sats} fee
369
415
  */
370
416
  /**
371
- * CPFP (Child Pays For Parent) information for a transaction
417
+ * CPFP (Child Pays For Parent) information for a transaction.
372
418
  *
373
419
  * @typedef {Object} CpfpInfo
374
- * @property {CpfpEntry[]} ancestors - Ancestor transactions in the CPFP chain
375
- * @property {(CpfpEntry|null)=} bestDescendant - Best (highest fee rate) descendant, if any
376
- * @property {CpfpEntry[]} descendants - Descendant transactions in the CPFP chain
377
- * @property {(FeeRate|null)=} effectiveFeePerVsize - Effective fee rate considering CPFP relationships (sat/vB)
378
- * @property {(Sats|null)=} fee - Transaction fee (sats)
379
- * @property {(VSize|null)=} adjustedVsize - Adjusted virtual size (accounting for sigops)
420
+ * @property {CpfpEntry[]} ancestors - Ancestor transactions in the CPFP chain.
421
+ * @property {(CpfpEntry|null)=} bestDescendant - Best (highest fee rate) descendant, if any.
422
+ * @property {CpfpEntry[]} descendants - Descendant transactions in the CPFP chain.
423
+ * @property {FeeRate} effectiveFeePerVsize - Effective fee rate considering CPFP relationships (sat/vB).
424
+ This is the seed's chunk feerate after lift-merging, i.e. the
425
+ rate Core/mempool.space would surface for this tx.
426
+ * @property {SigOps} sigops - BIP-141 sigop cost for the seed tx (witness sigops count as 1,
427
+ legacy and P2SH-redeem sigops count as 4).
428
+ * @property {Sats} fee - Transaction fee (sats).
429
+ * @property {VSize} vsize - Virtual size of the seed tx (vbytes).
430
+ * @property {VSize} adjustedVsize - Policy-adjusted virtual size: `max(vsize, sigops * 5)`.
431
+ * @property {(CpfpCluster|null)=} cluster - Cluster the seed belongs to: full tx list, SFL-linearized chunks,
432
+ and the seed's chunk index. Omitted when the seed has no
433
+ ancestors and no descendants (matches mempool.space).
380
434
  */
381
435
  /**
382
436
  * Range parameters with output format for API query parameters.
@@ -550,6 +604,13 @@ Matches mempool.space/bitcoin-cli behavior.
550
604
  * @typedef {Object} HeightParam
551
605
  * @property {Height} height
552
606
  */
607
+ /**
608
+ * Hex-encoded string. Transparent wrapper over `String`: serializes
609
+ * as a plain JSON string and derefs to `str`, so anywhere `&str` or
610
+ * `AsRef<[u8]>` is expected the `Hex` "just works".
611
+ *
612
+ * @typedef {string} Hex
613
+ */
553
614
  /**
554
615
  * Highest price value for a time period
555
616
  *
@@ -789,7 +850,7 @@ Matches mempool.space/bitcoin-cli behavior.
789
850
  /**
790
851
  * URL-friendly mining pool identifier
791
852
  *
792
- * @typedef {("unknown"|"blockfills"|"ultimuspool"|"terrapool"|"luxor"|"onethash"|"btccom"|"bitfarms"|"huobipool"|"wayicn"|"canoepool"|"btctop"|"bitcoincom"|"pool175btc"|"gbminers"|"axbt"|"asicminer"|"bitminter"|"bitcoinrussia"|"btcserv"|"simplecoinus"|"btcguild"|"eligius"|"ozcoin"|"eclipsemc"|"maxbtc"|"triplemining"|"coinlab"|"pool50btc"|"ghashio"|"stminingcorp"|"bitparking"|"mmpool"|"polmine"|"kncminer"|"bitalo"|"f2pool"|"hhtt"|"megabigpower"|"mtred"|"nmcbit"|"yourbtcnet"|"givemecoins"|"braiinspool"|"antpool"|"multicoinco"|"bcpoolio"|"cointerra"|"kanopool"|"solock"|"ckpool"|"nicehash"|"bitclub"|"bitcoinaffiliatenetwork"|"btcc"|"bwpool"|"exxbw"|"bitsolo"|"bitfury"|"twentyoneinc"|"digitalbtc"|"eightbaochi"|"mybtccoinpool"|"tbdice"|"hashpool"|"nexious"|"bravomining"|"hotpool"|"okexpool"|"bcmonster"|"onehash"|"bixin"|"tatmaspool"|"viabtc"|"connectbtc"|"batpool"|"waterhole"|"dcexploration"|"dcex"|"btpool"|"fiftyeightcoin"|"bitcoinindia"|"shawnp0wers"|"phashio"|"rigpool"|"haozhuzhu"|"sevenpool"|"miningkings"|"hashbx"|"dpool"|"rawpool"|"haominer"|"helix"|"bitcoinukraine"|"poolin"|"secretsuperstar"|"tigerpoolnet"|"sigmapoolcom"|"okpooltop"|"hummerpool"|"tangpool"|"bytepool"|"spiderpool"|"novablock"|"miningcity"|"binancepool"|"minerium"|"lubiancom"|"okkong"|"aaopool"|"emcdpool"|"foundryusa"|"sbicrypto"|"arkpool"|"purebtccom"|"marapool"|"kucoinpool"|"entrustcharitypool"|"okminer"|"titan"|"pegapool"|"btcnuggets"|"cloudhashing"|"digitalxmintsy"|"telco214"|"btcpoolparty"|"multipool"|"transactioncoinmining"|"btcdig"|"trickysbtcpool"|"btcmp"|"eobot"|"unomp"|"patels"|"gogreenlight"|"bitcoinindiapool"|"ekanembtc"|"canoe"|"tiger"|"onem1x"|"zulupool"|"secpool"|"ocean"|"whitepool"|"wiz"|"wk057"|"futurebitapollosolo"|"carbonnegative"|"portlandhodl"|"phoenix"|"neopool"|"maxipool"|"bitfufupool"|"gdpool"|"miningdutch"|"publicpool"|"miningsquared"|"innopolistech"|"btclab"|"parasite"|"redrockpool"|"est3lar"|"braiinssolo"|"solopool"|"noderunners")} PoolSlug
853
+ * @typedef {("unknown"|"blockfills"|"ultimuspool"|"terrapool"|"luxor"|"1thash"|"btccom"|"bitfarms"|"huobipool"|"wayicn"|"canoepool"|"btctop"|"bitcoincom"|"175btc"|"gbminers"|"axbt"|"asicminer"|"bitminter"|"bitcoinrussia"|"btcserv"|"simplecoinus"|"btcguild"|"eligius"|"ozcoin"|"eclipsemc"|"maxbtc"|"triplemining"|"coinlab"|"50btc"|"ghashio"|"stminingcorp"|"bitparking"|"mmpool"|"polmine"|"kncminer"|"bitalo"|"f2pool"|"hhtt"|"megabigpower"|"mtred"|"nmcbit"|"yourbtcnet"|"givemecoins"|"braiinspool"|"antpool"|"multicoinco"|"bcpoolio"|"cointerra"|"kanopool"|"solock"|"ckpool"|"nicehash"|"bitclub"|"bitcoinaffiliatenetwork"|"btcc"|"bwpool"|"exxbw"|"bitsolo"|"bitfury"|"21inc"|"digitalbtc"|"8baochi"|"mybtccoinpool"|"tbdice"|"hashpool"|"nexious"|"bravomining"|"hotpool"|"okexpool"|"bcmonster"|"1hash"|"bixin"|"tatmaspool"|"viabtc"|"connectbtc"|"batpool"|"waterhole"|"dcexploration"|"dcex"|"btpool"|"58coin"|"bitcoinindia"|"shawnp0wers"|"phashio"|"rigpool"|"haozhuzhu"|"7pool"|"miningkings"|"hashbx"|"dpool"|"rawpool"|"haominer"|"helix"|"bitcoinukraine"|"poolin"|"secretsuperstar"|"tigerpoolnet"|"sigmapoolcom"|"okpooltop"|"hummerpool"|"tangpool"|"bytepool"|"spiderpool"|"novablock"|"miningcity"|"binancepool"|"minerium"|"lubiancom"|"okkong"|"aaopool"|"emcdpool"|"foundryusa"|"sbicrypto"|"arkpool"|"purebtccom"|"marapool"|"kucoinpool"|"entrustcharitypool"|"okminer"|"titan"|"pegapool"|"btcnuggets"|"cloudhashing"|"digitalxmintsy"|"telco214"|"btcpoolparty"|"multipool"|"transactioncoinmining"|"btcdig"|"trickysbtcpool"|"btcmp"|"eobot"|"unomp"|"patels"|"gogreenlight"|"bitcoinindiapool"|"ekanembtc"|"canoe"|"tiger"|"1m1x"|"zulupool"|"secpool"|"ocean"|"whitepool"|"wiz"|"wk057"|"futurebitapollosolo"|"carbonnegative"|"portlandhodl"|"phoenix"|"neopool"|"maxipool"|"bitfufupool"|"gdpool"|"miningdutch"|"publicpool"|"miningsquared"|"innopolistech"|"btclab"|"parasite"|"redrockpool"|"est3lar"|"braiinssolo"|"solopoolcom"|"noderunners")} PoolSlug
793
854
  */
794
855
  /**
795
856
  * Mining pool slug + block height path parameters
@@ -891,6 +952,8 @@ on-the-wire shape.
891
952
  * @property {boolean} fullRbf - Any predecessor in this subtree was non-signaling.
892
953
  * @property {?number=} interval - Seconds between this node's `time` and the successor that
893
954
  replaced it. Omitted on the root of an RBF response.
955
+ * @property {?boolean=} mined - `Some(true)` iff this node's tx is currently confirmed. Absent
956
+ on serialization otherwise.
894
957
  * @property {ReplacementNode[]} replaces
895
958
  */
896
959
  /**
@@ -997,6 +1060,16 @@ replaced it. Omitted on the root of an RBF response.
997
1060
  * @property {(Limit|null)=} limit - Maximum number of values to return (ignored if `end` is set). Aliases: `count`, `c`, `l`
998
1061
  * @property {Format=} format - Format of the output
999
1062
  */
1063
+ /**
1064
+ * BIP-141 sigop cost. The block-level budget is 80,000, so a `u32`
1065
+ * fits a single tx's count with room to spare.
1066
+ *
1067
+ * Witness sigops count as 1; legacy and P2SH-redeem sigops count as 4.
1068
+ * Five vbytes per sigop is the policy adjustment Core applies in
1069
+ * `nSigOpCost` to discourage sigop-heavy txs (`max(weight/4, sigops*5)`).
1070
+ *
1071
+ * @typedef {number} SigOps
1072
+ */
1000
1073
  /** @typedef {boolean} StoredBool */
1001
1074
  /**
1002
1075
  * Stored 32-bit floating point value
@@ -1080,7 +1153,7 @@ replaced it. Omitted on the root of an RBF response.
1080
1153
  * @property {TxOut[]} vout - Transaction outputs
1081
1154
  * @property {number} size - Transaction size in bytes
1082
1155
  * @property {Weight} weight - Transaction weight
1083
- * @property {number} sigops - Number of signature operations
1156
+ * @property {SigOps} sigops - Number of signature operations
1084
1157
  * @property {Sats} fee - Transaction fee in satoshis
1085
1158
  * @property {TxStatus} status - Confirmation status (confirmed, block height/hash/time)
1086
1159
  */
@@ -1106,7 +1179,8 @@ replaced it. Omitted on the root of an RBF response.
1106
1179
  */
1107
1180
  /** @typedef {number} TxInIndex */
1108
1181
  /**
1109
- * Transaction index within a block (0 = coinbase)
1182
+ * Chain-wide transaction index (0 = the genesis coinbase). For an
1183
+ * in-block position, use `BlockTxIndex` instead.
1110
1184
  *
1111
1185
  * @typedef {number} TxIndex
1112
1186
  */
@@ -1172,6 +1246,17 @@ replaced it. Omitted on the root of an RBF response.
1172
1246
  * @property {Txid} txid - Transaction ID
1173
1247
  * @property {Vout} vout - Output index
1174
1248
  */
1249
+ /**
1250
+ * Query parameter for transaction-times endpoint.
1251
+ *
1252
+ * Extracted manually because `serde_urlencoded` (and serde derive in general)
1253
+ * doesn't support repeated keys like `txId[]=a&txId[]=b`. The schema is still
1254
+ * declared via `JsonSchema` so the OpenAPI spec lists the parameter and the
1255
+ * generated client SDKs see `txids: List[Txid]`.
1256
+ *
1257
+ * @typedef {Object} TxidsParam
1258
+ * @property {Txid[]} txId - Transaction IDs to look up (max 250 per request).
1259
+ */
1175
1260
  /**
1176
1261
  * Index within its type (e.g., 0 for first P2WPKH address)
1177
1262
  *
@@ -1187,10 +1272,9 @@ replaced it. Omitted on the root of an RBF response.
1187
1272
  * UTXO Realized Price Distribution for a cohort on a specific date.
1188
1273
  *
1189
1274
  * Supply is grouped by the close price at which each UTXO was last moved.
1190
- * Each bucket exposes three values derived from the same `(price_floor, supply)`
1191
- * pairs: supply in BTC, realized cap contribution in USD (`price_floor * supply`),
1192
- * and unrealized P&L against that date's close in USD
1193
- * (`(close - price_floor) * supply`, can be negative).
1275
+ * Each bucket exposes three values: supply in BTC, realized cap contribution
1276
+ * in USD (sum of `realized_price * supply` over the coins in the bucket), and
1277
+ * unrealized P&L in USD (`close * supply - realized_cap`, can be negative).
1194
1278
  *
1195
1279
  * @typedef {Object} Urpd
1196
1280
  * @property {Cohort} cohort
@@ -1211,10 +1295,10 @@ replaced it. Omitted on the root of an RBF response.
1211
1295
  * A single bucket in a URPD snapshot.
1212
1296
  *
1213
1297
  * @typedef {Object} UrpdBucket
1214
- * @property {Dollars} priceFloor - Inclusive lower bound of the bucket, in USD.
1298
+ * @property {Dollars} priceFloor - Lower bound of the bucket, in USD. Equals the exact realized price for `Raw`.
1215
1299
  * @property {Bitcoin} supply - Supply held with a last-move price inside this bucket, in BTC.
1216
- * @property {Dollars} realizedCap - Realized cap contribution in USD: `price_floor * supply`.
1217
- * @property {Dollars} unrealizedPnl - Unrealized P&L in USD against the close on the snapshot date: `(close - price_floor) * supply`. Can be negative.
1300
+ * @property {Dollars} realizedCap - Realized cap contribution in USD: sum of `realized_price * supply` over the coins in this bucket.
1301
+ * @property {Dollars} unrealizedPnl - Unrealized P&L in USD against the close on the snapshot date: `close * supply - realized_cap`. Can be negative.
1218
1302
  */
1219
1303
  /**
1220
1304
  * Path parameters for per-cohort URPD endpoints.
@@ -1296,12 +1380,16 @@ replaced it. Omitted on the root of an RBF response.
1296
1380
  * @typedef {Object} BrkClientOptions
1297
1381
  * @property {string} baseUrl - Base URL for the API
1298
1382
  * @property {number} [timeout] - Request timeout in milliseconds
1299
- * @property {string|boolean} [cache] - Enable browser cache with default name (true), custom name (string), or disable (false). No effect in Node.js. Default: true
1383
+ * @property {string|boolean} [browserCache] - Enable browser Cache API with default name (true), custom name (string), or disable (false). No effect in Node.js. Default: true
1384
+ * @property {number|boolean} [memCache] - In-memory parsed-response cache size (LRU). true/undefined → 1000, false/0 → disabled. Lets 304 responses skip the JSON parse entirely. Default: 1000
1300
1385
  */
1301
1386
 
1302
1387
  const _isBrowser = typeof window !== 'undefined' && 'caches' in window;
1303
1388
  const _runIdle = (/** @type {VoidFunction} */ fn) => (globalThis.requestIdleCallback ?? setTimeout)(fn);
1304
- const _defaultCacheName = '__BRK_CLIENT__';
1389
+ const _defaultBrowserCacheName = '__BRK_CLIENT__';
1390
+ const _DEFAULT_MEM_CACHE_SIZE = 1000;
1391
+
1392
+ /** @template T @typedef {{ etag: string | null, value: T }} _MemEntry */
1305
1393
  /** @param {*} v */
1306
1394
  const _addCamelGetters = (v) => {
1307
1395
  if (Array.isArray(v)) { v.forEach(_addCamelGetters); return v; }
@@ -1318,12 +1406,12 @@ const _addCamelGetters = (v) => {
1318
1406
  };
1319
1407
 
1320
1408
  /**
1321
- * @param {string|boolean|undefined} cache
1409
+ * @param {string|boolean|undefined} option
1322
1410
  * @returns {Promise<Cache | null>}
1323
1411
  */
1324
- const _openCache = (cache) => {
1325
- if (!_isBrowser || cache === false) return Promise.resolve(null);
1326
- const name = typeof cache === 'string' ? cache : _defaultCacheName;
1412
+ const _openBrowserCache = (option) => {
1413
+ if (!_isBrowser || option === false) return Promise.resolve(null);
1414
+ const name = typeof option === 'string' ? option : _defaultBrowserCacheName;
1327
1415
  return caches.open(name).catch(() => null);
1328
1416
  };
1329
1417
 
@@ -1478,7 +1566,6 @@ function _wrapSeriesData(raw) {
1478
1566
  * @property {number} version - Version of the series data
1479
1567
  * @property {Index} index - The index type used for this query
1480
1568
  * @property {string} type - Value type (e.g. "f32", "u64", "Sats")
1481
- * @property {number} total - Total number of data points
1482
1569
  * @property {number} start - Start index (inclusive)
1483
1570
  * @property {number} end - End index (exclusive)
1484
1571
  * @property {string} stamp - ISO 8601 timestamp of when the response was generated
@@ -1514,8 +1601,10 @@ function _wrapSeriesData(raw) {
1514
1601
  * @property {(n: number) => RangeBuilder<T>} first - Get first n items
1515
1602
  * @property {(n: number) => RangeBuilder<T>} last - Get last n items
1516
1603
  * @property {(n: number) => SkippedBuilder<T>} skip - Skip first n items, chain with take()
1517
- * @property {(onUpdate?: (value: SeriesData<T>) => void) => Promise<SeriesData<T>>} fetch - Fetch all data
1604
+ * @property {(onValue?: (value: SeriesData<T>) => void) => Promise<SeriesData<T>>} fetch - Fetch all data
1518
1605
  * @property {() => Promise<string>} fetchCsv - Fetch all data as CSV
1606
+ * @property {() => Promise<number>} len - Get total number of data points
1607
+ * @property {() => Promise<Version>} version - Get the current version of the series
1519
1608
  * @property {Thenable<T>} then - Thenable (await endpoint)
1520
1609
  * @property {string} path - The endpoint path
1521
1610
  */
@@ -1528,8 +1617,10 @@ function _wrapSeriesData(raw) {
1528
1617
  * @property {(n: number) => DateRangeBuilder<T>} first - Get first n items
1529
1618
  * @property {(n: number) => DateRangeBuilder<T>} last - Get last n items
1530
1619
  * @property {(n: number) => DateSkippedBuilder<T>} skip - Skip first n items, chain with take()
1531
- * @property {(onUpdate?: (value: DateSeriesData<T>) => void) => Promise<DateSeriesData<T>>} fetch - Fetch all data
1620
+ * @property {(onValue?: (value: DateSeriesData<T>) => void) => Promise<DateSeriesData<T>>} fetch - Fetch all data
1532
1621
  * @property {() => Promise<string>} fetchCsv - Fetch all data as CSV
1622
+ * @property {() => Promise<number>} len - Get total number of data points
1623
+ * @property {() => Promise<Version>} version - Get the current version of the series
1533
1624
  * @property {DateThenable<T>} then - Thenable (await endpoint)
1534
1625
  * @property {string} path - The endpoint path
1535
1626
  */
@@ -1537,39 +1628,39 @@ function _wrapSeriesData(raw) {
1537
1628
  /** @typedef {SeriesEndpoint<any>} AnySeriesEndpoint */
1538
1629
 
1539
1630
  /** @template T @typedef {Object} SingleItemBuilder
1540
- * @property {(onUpdate?: (value: SeriesData<T>) => void) => Promise<SeriesData<T>>} fetch - Fetch the item
1631
+ * @property {(onValue?: (value: SeriesData<T>) => void) => Promise<SeriesData<T>>} fetch - Fetch the item
1541
1632
  * @property {() => Promise<string>} fetchCsv - Fetch as CSV
1542
1633
  * @property {Thenable<T>} then - Thenable
1543
1634
  */
1544
1635
 
1545
1636
  /** @template T @typedef {Object} DateSingleItemBuilder
1546
- * @property {(onUpdate?: (value: DateSeriesData<T>) => void) => Promise<DateSeriesData<T>>} fetch - Fetch the item
1637
+ * @property {(onValue?: (value: DateSeriesData<T>) => void) => Promise<DateSeriesData<T>>} fetch - Fetch the item
1547
1638
  * @property {() => Promise<string>} fetchCsv - Fetch as CSV
1548
1639
  * @property {DateThenable<T>} then - Thenable
1549
1640
  */
1550
1641
 
1551
1642
  /** @template T @typedef {Object} SkippedBuilder
1552
1643
  * @property {(n: number) => RangeBuilder<T>} take - Take n items after skipped position
1553
- * @property {(onUpdate?: (value: SeriesData<T>) => void) => Promise<SeriesData<T>>} fetch - Fetch from skipped position to end
1644
+ * @property {(onValue?: (value: SeriesData<T>) => void) => Promise<SeriesData<T>>} fetch - Fetch from skipped position to end
1554
1645
  * @property {() => Promise<string>} fetchCsv - Fetch as CSV
1555
1646
  * @property {Thenable<T>} then - Thenable
1556
1647
  */
1557
1648
 
1558
1649
  /** @template T @typedef {Object} DateSkippedBuilder
1559
1650
  * @property {(n: number) => DateRangeBuilder<T>} take - Take n items after skipped position
1560
- * @property {(onUpdate?: (value: DateSeriesData<T>) => void) => Promise<DateSeriesData<T>>} fetch - Fetch from skipped position to end
1651
+ * @property {(onValue?: (value: DateSeriesData<T>) => void) => Promise<DateSeriesData<T>>} fetch - Fetch from skipped position to end
1561
1652
  * @property {() => Promise<string>} fetchCsv - Fetch as CSV
1562
1653
  * @property {DateThenable<T>} then - Thenable
1563
1654
  */
1564
1655
 
1565
1656
  /** @template T @typedef {Object} RangeBuilder
1566
- * @property {(onUpdate?: (value: SeriesData<T>) => void) => Promise<SeriesData<T>>} fetch - Fetch the range
1657
+ * @property {(onValue?: (value: SeriesData<T>) => void) => Promise<SeriesData<T>>} fetch - Fetch the range
1567
1658
  * @property {() => Promise<string>} fetchCsv - Fetch as CSV
1568
1659
  * @property {Thenable<T>} then - Thenable
1569
1660
  */
1570
1661
 
1571
1662
  /** @template T @typedef {Object} DateRangeBuilder
1572
- * @property {(onUpdate?: (value: DateSeriesData<T>) => void) => Promise<DateSeriesData<T>>} fetch - Fetch the range
1663
+ * @property {(onValue?: (value: DateSeriesData<T>) => void) => Promise<DateSeriesData<T>>} fetch - Fetch the range
1573
1664
  * @property {() => Promise<string>} fetchCsv - Fetch as CSV
1574
1665
  * @property {DateThenable<T>} then - Thenable
1575
1666
  */
@@ -1588,7 +1679,7 @@ function _wrapSeriesData(raw) {
1588
1679
  /**
1589
1680
  * Create a series endpoint builder with typestate pattern.
1590
1681
  * @template T
1591
- * @param {BrkClientBase} client
1682
+ * @param {BrkClient} client
1592
1683
  * @param {string} name - The series vec name
1593
1684
  * @param {Index} index - The index name
1594
1685
  * @returns {DateSeriesEndpoint<T>}
@@ -1617,7 +1708,7 @@ function _endpoint(client, name, index) {
1617
1708
  * @returns {DateRangeBuilder<T>}
1618
1709
  */
1619
1710
  const rangeBuilder = (start, end) => ({
1620
- fetch(onUpdate) { return client._fetchSeriesData(buildPath(start, end), onUpdate); },
1711
+ fetch(onValue) { return client._fetchSeriesData(buildPath(start, end), onValue); },
1621
1712
  fetchCsv() { return client.getText(buildPath(start, end, 'csv')); },
1622
1713
  then(resolve, reject) { return this.fetch().then(resolve, reject); },
1623
1714
  });
@@ -1627,7 +1718,7 @@ function _endpoint(client, name, index) {
1627
1718
  * @returns {DateSingleItemBuilder<T>}
1628
1719
  */
1629
1720
  const singleItemBuilder = (idx) => ({
1630
- fetch(onUpdate) { return client._fetchSeriesData(buildPath(idx, idx + 1), onUpdate); },
1721
+ fetch(onValue) { return client._fetchSeriesData(buildPath(idx, idx + 1), onValue); },
1631
1722
  fetchCsv() { return client.getText(buildPath(idx, idx + 1, 'csv')); },
1632
1723
  then(resolve, reject) { return this.fetch().then(resolve, reject); },
1633
1724
  });
@@ -1638,7 +1729,7 @@ function _endpoint(client, name, index) {
1638
1729
  */
1639
1730
  const skippedBuilder = (start) => ({
1640
1731
  take(n) { return rangeBuilder(start, start + n); },
1641
- fetch(onUpdate) { return client._fetchSeriesData(buildPath(start, undefined), onUpdate); },
1732
+ fetch(onValue) { return client._fetchSeriesData(buildPath(start, undefined), onValue); },
1642
1733
  fetchCsv() { return client.getText(buildPath(start, undefined, 'csv')); },
1643
1734
  then(resolve, reject) { return this.fetch().then(resolve, reject); },
1644
1735
  });
@@ -1654,8 +1745,10 @@ function _endpoint(client, name, index) {
1654
1745
  first(n) { return rangeBuilder(undefined, n); },
1655
1746
  last(n) { return n === 0 ? rangeBuilder(undefined, 0) : rangeBuilder(-n, undefined); },
1656
1747
  skip(n) { return skippedBuilder(n); },
1657
- fetch(onUpdate) { return client._fetchSeriesData(buildPath(), onUpdate); },
1748
+ fetch(onValue) { return client._fetchSeriesData(buildPath(), onValue); },
1658
1749
  fetchCsv() { return client.getText(buildPath(undefined, undefined, 'csv')); },
1750
+ len() { return client.getSeriesLen(name, index); },
1751
+ version() { return client.getSeriesVersion(name, index); },
1659
1752
  then(resolve, reject) { return this.fetch().then(resolve, reject); },
1660
1753
  get path() { return p; },
1661
1754
  };
@@ -1676,10 +1769,45 @@ class BrkClientBase {
1676
1769
  this.baseUrl = rawUrl.endsWith('/') ? rawUrl.slice(0, -1) : rawUrl;
1677
1770
  this.timeout = isString ? 5000 : (options.timeout ?? 5000);
1678
1771
  /** @type {Promise<Cache | null>} */
1679
- this._cachePromise = _openCache(isString ? undefined : options.cache);
1772
+ this._browserCachePromise = _openBrowserCache(isString ? undefined : options.browserCache);
1680
1773
  /** @type {Cache | null} */
1681
- this._cache = null;
1682
- this._cachePromise.then(c => this._cache = c);
1774
+ this._browserCache = null;
1775
+ this._browserCachePromise.then(c => this._browserCache = c);
1776
+ const memOpt = isString ? undefined : options.memCache;
1777
+ this._memCacheMax = memOpt === false || memOpt === 0
1778
+ ? 0
1779
+ : (typeof memOpt === 'number' ? memOpt : _DEFAULT_MEM_CACHE_SIZE);
1780
+ /** @type {Map<string, _MemEntry<unknown>>} */
1781
+ this._memCache = new Map();
1782
+ }
1783
+
1784
+ /**
1785
+ * @template T
1786
+ * @param {string} key
1787
+ * @returns {_MemEntry<T> | undefined}
1788
+ */
1789
+ _memGet(key) {
1790
+ if (!this._memCacheMax) return undefined;
1791
+ const hit = this._memCache.get(key);
1792
+ if (!hit) return undefined;
1793
+ this._memCache.delete(key);
1794
+ this._memCache.set(key, hit);
1795
+ return /** @type {_MemEntry<T>} */ (hit);
1796
+ }
1797
+
1798
+ /**
1799
+ * @param {string} key
1800
+ * @param {string | null} etag
1801
+ * @param {unknown} value
1802
+ */
1803
+ _memSet(key, etag, value) {
1804
+ if (!this._memCacheMax) return;
1805
+ if (this._memCache.has(key)) this._memCache.delete(key);
1806
+ else if (this._memCache.size >= this._memCacheMax) {
1807
+ const oldest = this._memCache.keys().next().value;
1808
+ if (oldest !== undefined) this._memCache.delete(oldest);
1809
+ }
1810
+ this._memCache.set(key, { etag, value });
1683
1811
  }
1684
1812
 
1685
1813
  /**
@@ -1697,66 +1825,92 @@ class BrkClientBase {
1697
1825
  }
1698
1826
 
1699
1827
  /**
1700
- * Make a GET request - races cache vs network, first to resolve calls onUpdate.
1701
- * Shared implementation backing `getJson` and `getText`.
1828
+ * Make a GET request with layered caching.
1829
+ *
1830
+ * Contract:
1831
+ * - The returned Promise resolves with the **freshest** value (post-revalidation).
1832
+ * - `onValue` fires once with the freshest value, or twice if a stale snapshot
1833
+ * could be shown first (stale-while-revalidate). On a 304 there is no second fire.
1834
+ *
1835
+ * Layers:
1836
+ * - L1 (memCache): in-memory parsed values keyed by URL+ETag. Lets 304s skip the parse entirely.
1837
+ * - L2 (browserCache): Cache API, survives reload and feeds onValue fast on cold start.
1838
+ *
1702
1839
  * @template T
1703
1840
  * @param {string} path
1704
1841
  * @param {(res: Response) => Promise<T>} parse - Response body reader
1705
- * @param {{ onUpdate?: (value: T) => void, signal?: AbortSignal }} [options]
1842
+ * @param {{ onValue?: (value: T) => void, signal?: AbortSignal }} [options]
1706
1843
  * @returns {Promise<T>}
1707
1844
  */
1708
- async _getCached(path, parse, { onUpdate, signal } = {}) {
1845
+ async _getCached(path, parse, { onValue, signal } = {}) {
1709
1846
  const url = `${this.baseUrl}${path}`;
1710
- const cache = this._cache ?? await this._cachePromise;
1711
-
1712
- let resolved = false;
1713
- /** @type {Response | null} */
1714
- let cachedRes = null;
1715
-
1716
- // Race cache vs network - first to resolve calls onUpdate
1717
- const cachePromise = cache?.match(url).then(async (res) => {
1718
- cachedRes = res ?? null;
1719
- if (!res) return null;
1720
- const value = await parse(res);
1721
- if (!resolved && onUpdate) {
1722
- resolved = true;
1723
- onUpdate(value);
1724
- }
1725
- return value;
1726
- });
1727
-
1728
- const networkPromise = this.get(path, { signal }).then(async (res) => {
1729
- const cloned = res.clone();
1730
- const value = await parse(res);
1731
- // Skip update if ETag matches and cache already delivered
1732
- if (cachedRes?.headers.get('ETag') === res.headers.get('ETag')) {
1733
- if (!resolved && onUpdate) {
1734
- resolved = true;
1735
- onUpdate(value);
1847
+ /** @type {_MemEntry<T> | undefined} */
1848
+ const memHit = this._memGet(url);
1849
+ const browserCache = this._browserCache ?? await this._browserCachePromise;
1850
+
1851
+ // L1 fast path: deliver from memCache, revalidate via network.
1852
+ // ETag match → zero parse, zero clone, zero cache write, no second onValue fire.
1853
+ if (memHit) {
1854
+ if (onValue) onValue(memHit.value);
1855
+ try {
1856
+ const res = await this.get(path, { signal });
1857
+ const netEtag = res.headers.get('ETag');
1858
+ if (netEtag && netEtag === memHit.etag) return memHit.value;
1859
+ const cloned = browserCache ? res.clone() : null;
1860
+ const value = await parse(res);
1861
+ this._memSet(url, netEtag, value);
1862
+ if (onValue) onValue(value);
1863
+ if (cloned && browserCache) {
1864
+ const cache = browserCache;
1865
+ _runIdle(() => cache.put(url, cloned));
1736
1866
  }
1737
1867
  return value;
1868
+ } catch {
1869
+ return memHit.value;
1738
1870
  }
1739
- resolved = true;
1740
- if (onUpdate) onUpdate(value);
1741
- if (cache) _runIdle(() => cache.put(url, cloned));
1742
- return value;
1743
- });
1871
+ }
1872
+
1873
+ // L1 miss: race browserCache (stale snapshot) vs network (fresh).
1874
+ let networkSettled = false;
1875
+ const stalePromise = onValue && browserCache
1876
+ ? browserCache.match(url).then(async (res) => {
1877
+ if (!res || networkSettled) return null;
1878
+ const value = await parse(res);
1879
+ if (networkSettled) return value;
1880
+ this._memSet(url, res.headers.get('ETag'), value);
1881
+ onValue(value);
1882
+ return value;
1883
+ }).catch(() => null)
1884
+ : null;
1744
1885
 
1745
1886
  try {
1746
- return await networkPromise;
1887
+ const res = await this.get(path, { signal });
1888
+ networkSettled = true;
1889
+ const netEtag = res.headers.get('ETag');
1890
+ // Stale won and populated memCache with matching ETag → reuse, skip parse + second onValue.
1891
+ const populated = /** @type {_MemEntry<T> | undefined} */ (this._memGet(url));
1892
+ if (populated && netEtag && netEtag === populated.etag) return populated.value;
1893
+ const cloned = browserCache ? res.clone() : null;
1894
+ const value = await parse(res);
1895
+ this._memSet(url, netEtag, value);
1896
+ if (onValue) onValue(value);
1897
+ if (cloned && browserCache) {
1898
+ const cache = browserCache;
1899
+ _runIdle(() => cache.put(url, cloned));
1900
+ }
1901
+ return value;
1747
1902
  } catch (e) {
1748
- // Network failed - wait for cache
1749
- const cachedValue = await cachePromise?.catch(() => null);
1750
- if (cachedValue != null) return cachedValue;
1903
+ const stale = await stalePromise;
1904
+ if (stale != null) return stale;
1751
1905
  throw e;
1752
1906
  }
1753
1907
  }
1754
1908
 
1755
1909
  /**
1756
- * Make a GET request expecting a JSON response. Cached and supports `onUpdate`.
1910
+ * Make a GET request expecting a JSON response. Cached and supports `onValue`.
1757
1911
  * @template T
1758
1912
  * @param {string} path
1759
- * @param {{ onUpdate?: (value: T) => void, signal?: AbortSignal }} [options]
1913
+ * @param {{ onValue?: (value: T) => void, signal?: AbortSignal }} [options]
1760
1914
  * @returns {Promise<T>}
1761
1915
  */
1762
1916
  getJson(path, options) {
@@ -1765,25 +1919,97 @@ class BrkClientBase {
1765
1919
 
1766
1920
  /**
1767
1921
  * Make a GET request expecting a text response (text/plain, text/csv, ...).
1768
- * Cached and supports `onUpdate`, same as `getJson`.
1922
+ * Cached and supports `onValue`, same as `getJson`.
1769
1923
  * @param {string} path
1770
- * @param {{ onUpdate?: (value: string) => void, signal?: AbortSignal }} [options]
1924
+ * @param {{ onValue?: (value: string) => void, signal?: AbortSignal }} [options]
1771
1925
  * @returns {Promise<string>}
1772
1926
  */
1773
1927
  getText(path, options) {
1774
1928
  return this._getCached(path, (res) => res.text(), options);
1775
1929
  }
1776
1930
 
1931
+ /**
1932
+ * Make a GET request expecting binary data (application/octet-stream).
1933
+ * Cached and supports `onValue`, same as `getJson`.
1934
+ * @param {string} path
1935
+ * @param {{ onValue?: (value: Uint8Array) => void, signal?: AbortSignal }} [options]
1936
+ * @returns {Promise<Uint8Array>}
1937
+ */
1938
+ getBytes(path, options) {
1939
+ return this._getCached(path, async (res) => new Uint8Array(await res.arrayBuffer()), options);
1940
+ }
1941
+
1942
+ /**
1943
+ * Make a POST request with a string body.
1944
+ *
1945
+ * POST responses are uncached and never invoke `onValue` — every call hits
1946
+ * the network with the same body and returns the upstream response.
1947
+ *
1948
+ * @param {string} path
1949
+ * @param {string} body
1950
+ * @param {{ signal?: AbortSignal }} [options]
1951
+ * @returns {Promise<Response>}
1952
+ */
1953
+ async post(path, body, { signal } = {}) {
1954
+ const url = `${this.baseUrl}${path}`;
1955
+ const signals = [AbortSignal.timeout(this.timeout)];
1956
+ if (signal) signals.push(signal);
1957
+ const res = await fetch(url, {
1958
+ method: 'POST',
1959
+ body,
1960
+ signal: AbortSignal.any(signals),
1961
+ });
1962
+ if (!res.ok) throw new BrkError(`HTTP ${res.status}: ${url}`, res.status);
1963
+ return res;
1964
+ }
1965
+
1966
+ /**
1967
+ * Make a POST request expecting a JSON response.
1968
+ * @template T
1969
+ * @param {string} path
1970
+ * @param {string} body
1971
+ * @param {{ signal?: AbortSignal }} [options]
1972
+ * @returns {Promise<T>}
1973
+ */
1974
+ async postJson(path, body, options) {
1975
+ const res = await this.post(path, body, options);
1976
+ return _addCamelGetters(await res.json());
1977
+ }
1978
+
1979
+ /**
1980
+ * Make a POST request expecting a text response.
1981
+ * @param {string} path
1982
+ * @param {string} body
1983
+ * @param {{ signal?: AbortSignal }} [options]
1984
+ * @returns {Promise<string>}
1985
+ */
1986
+ async postText(path, body, options) {
1987
+ const res = await this.post(path, body, options);
1988
+ return res.text();
1989
+ }
1990
+
1991
+ /**
1992
+ * Make a POST request expecting binary data (application/octet-stream).
1993
+ * @param {string} path
1994
+ * @param {string} body
1995
+ * @param {{ signal?: AbortSignal }} [options]
1996
+ * @returns {Promise<Uint8Array>}
1997
+ */
1998
+ async postBytes(path, body, options) {
1999
+ const res = await this.post(path, body, options);
2000
+ return new Uint8Array(await res.arrayBuffer());
2001
+ }
2002
+
1777
2003
  /**
1778
2004
  * Fetch series data and wrap with helper methods (internal)
1779
2005
  * @template T
1780
2006
  * @param {string} path
1781
- * @param {(value: DateSeriesData<T>) => void} [onUpdate]
2007
+ * @param {(value: DateSeriesData<T>) => void} [onValue]
1782
2008
  * @returns {Promise<DateSeriesData<T>>}
1783
2009
  */
1784
- async _fetchSeriesData(path, onUpdate) {
1785
- const wrappedOnUpdate = onUpdate ? (/** @type {SeriesData<T>} */ raw) => onUpdate(_wrapSeriesData(raw)) : undefined;
1786
- const raw = await this.getJson(path, { onUpdate: wrappedOnUpdate });
2010
+ async _fetchSeriesData(path, onValue) {
2011
+ const wrappedOnValue = onValue ? (/** @type {SeriesData<T>} */ raw) => onValue(_wrapSeriesData(raw)) : undefined;
2012
+ const raw = await this.getJson(path, { onValue: wrappedOnValue });
1787
2013
  return _wrapSeriesData(raw);
1788
2014
  }
1789
2015
  }
@@ -1846,7 +2072,7 @@ const _i35 = /** @type {const} */ (["empty_addr_index"]);
1846
2072
  /**
1847
2073
  * Generic series pattern factory.
1848
2074
  * @template T
1849
- * @param {BrkClientBase} client
2075
+ * @param {BrkClient} client
1850
2076
  * @param {string} name - The series vec name
1851
2077
  * @param {readonly Index[]} indexes - The supported indexes
1852
2078
  */
@@ -1870,109 +2096,109 @@ function _mp(client, name, indexes) {
1870
2096
  }
1871
2097
 
1872
2098
  /** @template T @typedef {{ name: string, by: { readonly minute10: DateSeriesEndpoint<T>, readonly minute30: DateSeriesEndpoint<T>, readonly hour1: DateSeriesEndpoint<T>, readonly hour4: DateSeriesEndpoint<T>, readonly hour12: DateSeriesEndpoint<T>, readonly day1: DateSeriesEndpoint<T>, readonly day3: DateSeriesEndpoint<T>, readonly week1: DateSeriesEndpoint<T>, readonly month1: DateSeriesEndpoint<T>, readonly month3: DateSeriesEndpoint<T>, readonly month6: DateSeriesEndpoint<T>, readonly year1: DateSeriesEndpoint<T>, readonly year10: DateSeriesEndpoint<T>, readonly halving: SeriesEndpoint<T>, readonly epoch: SeriesEndpoint<T>, readonly height: SeriesEndpoint<T> }, indexes: () => readonly Index[], get: (index: Index) => SeriesEndpoint<T>|undefined }} SeriesPattern1 */
1873
- /** @template T @param {BrkClientBase} client @param {string} name @returns {SeriesPattern1<T>} */
2099
+ /** @template T @param {BrkClient} client @param {string} name @returns {SeriesPattern1<T>} */
1874
2100
  function createSeriesPattern1(client, name) { return /** @type {SeriesPattern1<T>} */ (_mp(client, name, _i1)); }
1875
2101
  /** @template T @typedef {{ name: string, by: { readonly minute10: DateSeriesEndpoint<T>, readonly minute30: DateSeriesEndpoint<T>, readonly hour1: DateSeriesEndpoint<T>, readonly hour4: DateSeriesEndpoint<T>, readonly hour12: DateSeriesEndpoint<T>, readonly day1: DateSeriesEndpoint<T>, readonly day3: DateSeriesEndpoint<T>, readonly week1: DateSeriesEndpoint<T>, readonly month1: DateSeriesEndpoint<T>, readonly month3: DateSeriesEndpoint<T>, readonly month6: DateSeriesEndpoint<T>, readonly year1: DateSeriesEndpoint<T>, readonly year10: DateSeriesEndpoint<T>, readonly halving: SeriesEndpoint<T>, readonly epoch: SeriesEndpoint<T> }, indexes: () => readonly Index[], get: (index: Index) => SeriesEndpoint<T>|undefined }} SeriesPattern2 */
1876
- /** @template T @param {BrkClientBase} client @param {string} name @returns {SeriesPattern2<T>} */
2102
+ /** @template T @param {BrkClient} client @param {string} name @returns {SeriesPattern2<T>} */
1877
2103
  function createSeriesPattern2(client, name) { return /** @type {SeriesPattern2<T>} */ (_mp(client, name, _i2)); }
1878
2104
  /** @template T @typedef {{ name: string, by: { readonly minute10: DateSeriesEndpoint<T> }, indexes: () => readonly Index[], get: (index: Index) => SeriesEndpoint<T>|undefined }} SeriesPattern3 */
1879
- /** @template T @param {BrkClientBase} client @param {string} name @returns {SeriesPattern3<T>} */
2105
+ /** @template T @param {BrkClient} client @param {string} name @returns {SeriesPattern3<T>} */
1880
2106
  function createSeriesPattern3(client, name) { return /** @type {SeriesPattern3<T>} */ (_mp(client, name, _i3)); }
1881
2107
  /** @template T @typedef {{ name: string, by: { readonly minute30: DateSeriesEndpoint<T> }, indexes: () => readonly Index[], get: (index: Index) => SeriesEndpoint<T>|undefined }} SeriesPattern4 */
1882
- /** @template T @param {BrkClientBase} client @param {string} name @returns {SeriesPattern4<T>} */
2108
+ /** @template T @param {BrkClient} client @param {string} name @returns {SeriesPattern4<T>} */
1883
2109
  function createSeriesPattern4(client, name) { return /** @type {SeriesPattern4<T>} */ (_mp(client, name, _i4)); }
1884
2110
  /** @template T @typedef {{ name: string, by: { readonly hour1: DateSeriesEndpoint<T> }, indexes: () => readonly Index[], get: (index: Index) => SeriesEndpoint<T>|undefined }} SeriesPattern5 */
1885
- /** @template T @param {BrkClientBase} client @param {string} name @returns {SeriesPattern5<T>} */
2111
+ /** @template T @param {BrkClient} client @param {string} name @returns {SeriesPattern5<T>} */
1886
2112
  function createSeriesPattern5(client, name) { return /** @type {SeriesPattern5<T>} */ (_mp(client, name, _i5)); }
1887
2113
  /** @template T @typedef {{ name: string, by: { readonly hour4: DateSeriesEndpoint<T> }, indexes: () => readonly Index[], get: (index: Index) => SeriesEndpoint<T>|undefined }} SeriesPattern6 */
1888
- /** @template T @param {BrkClientBase} client @param {string} name @returns {SeriesPattern6<T>} */
2114
+ /** @template T @param {BrkClient} client @param {string} name @returns {SeriesPattern6<T>} */
1889
2115
  function createSeriesPattern6(client, name) { return /** @type {SeriesPattern6<T>} */ (_mp(client, name, _i6)); }
1890
2116
  /** @template T @typedef {{ name: string, by: { readonly hour12: DateSeriesEndpoint<T> }, indexes: () => readonly Index[], get: (index: Index) => SeriesEndpoint<T>|undefined }} SeriesPattern7 */
1891
- /** @template T @param {BrkClientBase} client @param {string} name @returns {SeriesPattern7<T>} */
2117
+ /** @template T @param {BrkClient} client @param {string} name @returns {SeriesPattern7<T>} */
1892
2118
  function createSeriesPattern7(client, name) { return /** @type {SeriesPattern7<T>} */ (_mp(client, name, _i7)); }
1893
2119
  /** @template T @typedef {{ name: string, by: { readonly day1: DateSeriesEndpoint<T> }, indexes: () => readonly Index[], get: (index: Index) => SeriesEndpoint<T>|undefined }} SeriesPattern8 */
1894
- /** @template T @param {BrkClientBase} client @param {string} name @returns {SeriesPattern8<T>} */
2120
+ /** @template T @param {BrkClient} client @param {string} name @returns {SeriesPattern8<T>} */
1895
2121
  function createSeriesPattern8(client, name) { return /** @type {SeriesPattern8<T>} */ (_mp(client, name, _i8)); }
1896
2122
  /** @template T @typedef {{ name: string, by: { readonly day3: DateSeriesEndpoint<T> }, indexes: () => readonly Index[], get: (index: Index) => SeriesEndpoint<T>|undefined }} SeriesPattern9 */
1897
- /** @template T @param {BrkClientBase} client @param {string} name @returns {SeriesPattern9<T>} */
2123
+ /** @template T @param {BrkClient} client @param {string} name @returns {SeriesPattern9<T>} */
1898
2124
  function createSeriesPattern9(client, name) { return /** @type {SeriesPattern9<T>} */ (_mp(client, name, _i9)); }
1899
2125
  /** @template T @typedef {{ name: string, by: { readonly week1: DateSeriesEndpoint<T> }, indexes: () => readonly Index[], get: (index: Index) => SeriesEndpoint<T>|undefined }} SeriesPattern10 */
1900
- /** @template T @param {BrkClientBase} client @param {string} name @returns {SeriesPattern10<T>} */
2126
+ /** @template T @param {BrkClient} client @param {string} name @returns {SeriesPattern10<T>} */
1901
2127
  function createSeriesPattern10(client, name) { return /** @type {SeriesPattern10<T>} */ (_mp(client, name, _i10)); }
1902
2128
  /** @template T @typedef {{ name: string, by: { readonly month1: DateSeriesEndpoint<T> }, indexes: () => readonly Index[], get: (index: Index) => SeriesEndpoint<T>|undefined }} SeriesPattern11 */
1903
- /** @template T @param {BrkClientBase} client @param {string} name @returns {SeriesPattern11<T>} */
2129
+ /** @template T @param {BrkClient} client @param {string} name @returns {SeriesPattern11<T>} */
1904
2130
  function createSeriesPattern11(client, name) { return /** @type {SeriesPattern11<T>} */ (_mp(client, name, _i11)); }
1905
2131
  /** @template T @typedef {{ name: string, by: { readonly month3: DateSeriesEndpoint<T> }, indexes: () => readonly Index[], get: (index: Index) => SeriesEndpoint<T>|undefined }} SeriesPattern12 */
1906
- /** @template T @param {BrkClientBase} client @param {string} name @returns {SeriesPattern12<T>} */
2132
+ /** @template T @param {BrkClient} client @param {string} name @returns {SeriesPattern12<T>} */
1907
2133
  function createSeriesPattern12(client, name) { return /** @type {SeriesPattern12<T>} */ (_mp(client, name, _i12)); }
1908
2134
  /** @template T @typedef {{ name: string, by: { readonly month6: DateSeriesEndpoint<T> }, indexes: () => readonly Index[], get: (index: Index) => SeriesEndpoint<T>|undefined }} SeriesPattern13 */
1909
- /** @template T @param {BrkClientBase} client @param {string} name @returns {SeriesPattern13<T>} */
2135
+ /** @template T @param {BrkClient} client @param {string} name @returns {SeriesPattern13<T>} */
1910
2136
  function createSeriesPattern13(client, name) { return /** @type {SeriesPattern13<T>} */ (_mp(client, name, _i13)); }
1911
2137
  /** @template T @typedef {{ name: string, by: { readonly year1: DateSeriesEndpoint<T> }, indexes: () => readonly Index[], get: (index: Index) => SeriesEndpoint<T>|undefined }} SeriesPattern14 */
1912
- /** @template T @param {BrkClientBase} client @param {string} name @returns {SeriesPattern14<T>} */
2138
+ /** @template T @param {BrkClient} client @param {string} name @returns {SeriesPattern14<T>} */
1913
2139
  function createSeriesPattern14(client, name) { return /** @type {SeriesPattern14<T>} */ (_mp(client, name, _i14)); }
1914
2140
  /** @template T @typedef {{ name: string, by: { readonly year10: DateSeriesEndpoint<T> }, indexes: () => readonly Index[], get: (index: Index) => SeriesEndpoint<T>|undefined }} SeriesPattern15 */
1915
- /** @template T @param {BrkClientBase} client @param {string} name @returns {SeriesPattern15<T>} */
2141
+ /** @template T @param {BrkClient} client @param {string} name @returns {SeriesPattern15<T>} */
1916
2142
  function createSeriesPattern15(client, name) { return /** @type {SeriesPattern15<T>} */ (_mp(client, name, _i15)); }
1917
2143
  /** @template T @typedef {{ name: string, by: { readonly halving: SeriesEndpoint<T> }, indexes: () => readonly Index[], get: (index: Index) => SeriesEndpoint<T>|undefined }} SeriesPattern16 */
1918
- /** @template T @param {BrkClientBase} client @param {string} name @returns {SeriesPattern16<T>} */
2144
+ /** @template T @param {BrkClient} client @param {string} name @returns {SeriesPattern16<T>} */
1919
2145
  function createSeriesPattern16(client, name) { return /** @type {SeriesPattern16<T>} */ (_mp(client, name, _i16)); }
1920
2146
  /** @template T @typedef {{ name: string, by: { readonly epoch: SeriesEndpoint<T> }, indexes: () => readonly Index[], get: (index: Index) => SeriesEndpoint<T>|undefined }} SeriesPattern17 */
1921
- /** @template T @param {BrkClientBase} client @param {string} name @returns {SeriesPattern17<T>} */
2147
+ /** @template T @param {BrkClient} client @param {string} name @returns {SeriesPattern17<T>} */
1922
2148
  function createSeriesPattern17(client, name) { return /** @type {SeriesPattern17<T>} */ (_mp(client, name, _i17)); }
1923
2149
  /** @template T @typedef {{ name: string, by: { readonly height: SeriesEndpoint<T> }, indexes: () => readonly Index[], get: (index: Index) => SeriesEndpoint<T>|undefined }} SeriesPattern18 */
1924
- /** @template T @param {BrkClientBase} client @param {string} name @returns {SeriesPattern18<T>} */
2150
+ /** @template T @param {BrkClient} client @param {string} name @returns {SeriesPattern18<T>} */
1925
2151
  function createSeriesPattern18(client, name) { return /** @type {SeriesPattern18<T>} */ (_mp(client, name, _i18)); }
1926
2152
  /** @template T @typedef {{ name: string, by: { readonly tx_index: SeriesEndpoint<T> }, indexes: () => readonly Index[], get: (index: Index) => SeriesEndpoint<T>|undefined }} SeriesPattern19 */
1927
- /** @template T @param {BrkClientBase} client @param {string} name @returns {SeriesPattern19<T>} */
2153
+ /** @template T @param {BrkClient} client @param {string} name @returns {SeriesPattern19<T>} */
1928
2154
  function createSeriesPattern19(client, name) { return /** @type {SeriesPattern19<T>} */ (_mp(client, name, _i19)); }
1929
2155
  /** @template T @typedef {{ name: string, by: { readonly txin_index: SeriesEndpoint<T> }, indexes: () => readonly Index[], get: (index: Index) => SeriesEndpoint<T>|undefined }} SeriesPattern20 */
1930
- /** @template T @param {BrkClientBase} client @param {string} name @returns {SeriesPattern20<T>} */
2156
+ /** @template T @param {BrkClient} client @param {string} name @returns {SeriesPattern20<T>} */
1931
2157
  function createSeriesPattern20(client, name) { return /** @type {SeriesPattern20<T>} */ (_mp(client, name, _i20)); }
1932
2158
  /** @template T @typedef {{ name: string, by: { readonly txout_index: SeriesEndpoint<T> }, indexes: () => readonly Index[], get: (index: Index) => SeriesEndpoint<T>|undefined }} SeriesPattern21 */
1933
- /** @template T @param {BrkClientBase} client @param {string} name @returns {SeriesPattern21<T>} */
2159
+ /** @template T @param {BrkClient} client @param {string} name @returns {SeriesPattern21<T>} */
1934
2160
  function createSeriesPattern21(client, name) { return /** @type {SeriesPattern21<T>} */ (_mp(client, name, _i21)); }
1935
2161
  /** @template T @typedef {{ name: string, by: { readonly empty_output_index: SeriesEndpoint<T> }, indexes: () => readonly Index[], get: (index: Index) => SeriesEndpoint<T>|undefined }} SeriesPattern22 */
1936
- /** @template T @param {BrkClientBase} client @param {string} name @returns {SeriesPattern22<T>} */
2162
+ /** @template T @param {BrkClient} client @param {string} name @returns {SeriesPattern22<T>} */
1937
2163
  function createSeriesPattern22(client, name) { return /** @type {SeriesPattern22<T>} */ (_mp(client, name, _i22)); }
1938
2164
  /** @template T @typedef {{ name: string, by: { readonly op_return_index: SeriesEndpoint<T> }, indexes: () => readonly Index[], get: (index: Index) => SeriesEndpoint<T>|undefined }} SeriesPattern23 */
1939
- /** @template T @param {BrkClientBase} client @param {string} name @returns {SeriesPattern23<T>} */
2165
+ /** @template T @param {BrkClient} client @param {string} name @returns {SeriesPattern23<T>} */
1940
2166
  function createSeriesPattern23(client, name) { return /** @type {SeriesPattern23<T>} */ (_mp(client, name, _i23)); }
1941
2167
  /** @template T @typedef {{ name: string, by: { readonly p2a_addr_index: SeriesEndpoint<T> }, indexes: () => readonly Index[], get: (index: Index) => SeriesEndpoint<T>|undefined }} SeriesPattern24 */
1942
- /** @template T @param {BrkClientBase} client @param {string} name @returns {SeriesPattern24<T>} */
2168
+ /** @template T @param {BrkClient} client @param {string} name @returns {SeriesPattern24<T>} */
1943
2169
  function createSeriesPattern24(client, name) { return /** @type {SeriesPattern24<T>} */ (_mp(client, name, _i24)); }
1944
2170
  /** @template T @typedef {{ name: string, by: { readonly p2ms_output_index: SeriesEndpoint<T> }, indexes: () => readonly Index[], get: (index: Index) => SeriesEndpoint<T>|undefined }} SeriesPattern25 */
1945
- /** @template T @param {BrkClientBase} client @param {string} name @returns {SeriesPattern25<T>} */
2171
+ /** @template T @param {BrkClient} client @param {string} name @returns {SeriesPattern25<T>} */
1946
2172
  function createSeriesPattern25(client, name) { return /** @type {SeriesPattern25<T>} */ (_mp(client, name, _i25)); }
1947
2173
  /** @template T @typedef {{ name: string, by: { readonly p2pk33_addr_index: SeriesEndpoint<T> }, indexes: () => readonly Index[], get: (index: Index) => SeriesEndpoint<T>|undefined }} SeriesPattern26 */
1948
- /** @template T @param {BrkClientBase} client @param {string} name @returns {SeriesPattern26<T>} */
2174
+ /** @template T @param {BrkClient} client @param {string} name @returns {SeriesPattern26<T>} */
1949
2175
  function createSeriesPattern26(client, name) { return /** @type {SeriesPattern26<T>} */ (_mp(client, name, _i26)); }
1950
2176
  /** @template T @typedef {{ name: string, by: { readonly p2pk65_addr_index: SeriesEndpoint<T> }, indexes: () => readonly Index[], get: (index: Index) => SeriesEndpoint<T>|undefined }} SeriesPattern27 */
1951
- /** @template T @param {BrkClientBase} client @param {string} name @returns {SeriesPattern27<T>} */
2177
+ /** @template T @param {BrkClient} client @param {string} name @returns {SeriesPattern27<T>} */
1952
2178
  function createSeriesPattern27(client, name) { return /** @type {SeriesPattern27<T>} */ (_mp(client, name, _i27)); }
1953
2179
  /** @template T @typedef {{ name: string, by: { readonly p2pkh_addr_index: SeriesEndpoint<T> }, indexes: () => readonly Index[], get: (index: Index) => SeriesEndpoint<T>|undefined }} SeriesPattern28 */
1954
- /** @template T @param {BrkClientBase} client @param {string} name @returns {SeriesPattern28<T>} */
2180
+ /** @template T @param {BrkClient} client @param {string} name @returns {SeriesPattern28<T>} */
1955
2181
  function createSeriesPattern28(client, name) { return /** @type {SeriesPattern28<T>} */ (_mp(client, name, _i28)); }
1956
2182
  /** @template T @typedef {{ name: string, by: { readonly p2sh_addr_index: SeriesEndpoint<T> }, indexes: () => readonly Index[], get: (index: Index) => SeriesEndpoint<T>|undefined }} SeriesPattern29 */
1957
- /** @template T @param {BrkClientBase} client @param {string} name @returns {SeriesPattern29<T>} */
2183
+ /** @template T @param {BrkClient} client @param {string} name @returns {SeriesPattern29<T>} */
1958
2184
  function createSeriesPattern29(client, name) { return /** @type {SeriesPattern29<T>} */ (_mp(client, name, _i29)); }
1959
2185
  /** @template T @typedef {{ name: string, by: { readonly p2tr_addr_index: SeriesEndpoint<T> }, indexes: () => readonly Index[], get: (index: Index) => SeriesEndpoint<T>|undefined }} SeriesPattern30 */
1960
- /** @template T @param {BrkClientBase} client @param {string} name @returns {SeriesPattern30<T>} */
2186
+ /** @template T @param {BrkClient} client @param {string} name @returns {SeriesPattern30<T>} */
1961
2187
  function createSeriesPattern30(client, name) { return /** @type {SeriesPattern30<T>} */ (_mp(client, name, _i30)); }
1962
2188
  /** @template T @typedef {{ name: string, by: { readonly p2wpkh_addr_index: SeriesEndpoint<T> }, indexes: () => readonly Index[], get: (index: Index) => SeriesEndpoint<T>|undefined }} SeriesPattern31 */
1963
- /** @template T @param {BrkClientBase} client @param {string} name @returns {SeriesPattern31<T>} */
2189
+ /** @template T @param {BrkClient} client @param {string} name @returns {SeriesPattern31<T>} */
1964
2190
  function createSeriesPattern31(client, name) { return /** @type {SeriesPattern31<T>} */ (_mp(client, name, _i31)); }
1965
2191
  /** @template T @typedef {{ name: string, by: { readonly p2wsh_addr_index: SeriesEndpoint<T> }, indexes: () => readonly Index[], get: (index: Index) => SeriesEndpoint<T>|undefined }} SeriesPattern32 */
1966
- /** @template T @param {BrkClientBase} client @param {string} name @returns {SeriesPattern32<T>} */
2192
+ /** @template T @param {BrkClient} client @param {string} name @returns {SeriesPattern32<T>} */
1967
2193
  function createSeriesPattern32(client, name) { return /** @type {SeriesPattern32<T>} */ (_mp(client, name, _i32)); }
1968
2194
  /** @template T @typedef {{ name: string, by: { readonly unknown_output_index: SeriesEndpoint<T> }, indexes: () => readonly Index[], get: (index: Index) => SeriesEndpoint<T>|undefined }} SeriesPattern33 */
1969
- /** @template T @param {BrkClientBase} client @param {string} name @returns {SeriesPattern33<T>} */
2195
+ /** @template T @param {BrkClient} client @param {string} name @returns {SeriesPattern33<T>} */
1970
2196
  function createSeriesPattern33(client, name) { return /** @type {SeriesPattern33<T>} */ (_mp(client, name, _i33)); }
1971
2197
  /** @template T @typedef {{ name: string, by: { readonly funded_addr_index: SeriesEndpoint<T> }, indexes: () => readonly Index[], get: (index: Index) => SeriesEndpoint<T>|undefined }} SeriesPattern34 */
1972
- /** @template T @param {BrkClientBase} client @param {string} name @returns {SeriesPattern34<T>} */
2198
+ /** @template T @param {BrkClient} client @param {string} name @returns {SeriesPattern34<T>} */
1973
2199
  function createSeriesPattern34(client, name) { return /** @type {SeriesPattern34<T>} */ (_mp(client, name, _i34)); }
1974
2200
  /** @template T @typedef {{ name: string, by: { readonly empty_addr_index: SeriesEndpoint<T> }, indexes: () => readonly Index[], get: (index: Index) => SeriesEndpoint<T>|undefined }} SeriesPattern35 */
1975
- /** @template T @param {BrkClientBase} client @param {string} name @returns {SeriesPattern35<T>} */
2201
+ /** @template T @param {BrkClient} client @param {string} name @returns {SeriesPattern35<T>} */
1976
2202
  function createSeriesPattern35(client, name) { return /** @type {SeriesPattern35<T>} */ (_mp(client, name, _i35)); }
1977
2203
 
1978
2204
  // Reusable structural pattern factories
@@ -2002,7 +2228,7 @@ function createSeriesPattern35(client, name) { return /** @type {SeriesPattern35
2002
2228
 
2003
2229
  /**
2004
2230
  * Create a Pct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern pattern node
2005
- * @param {BrkClientBase} client
2231
+ * @param {BrkClient} client
2006
2232
  * @param {string} acc - Accumulated series name
2007
2233
  * @returns {Pct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern}
2008
2234
  */
@@ -2068,7 +2294,7 @@ function createPct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65
2068
2294
 
2069
2295
  /**
2070
2296
  * Create a AllEmptyOpP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern pattern node
2071
- * @param {BrkClientBase} client
2297
+ * @param {BrkClient} client
2072
2298
  * @param {string} acc - Accumulated series name
2073
2299
  * @returns {AllEmptyOpP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern}
2074
2300
  */
@@ -2108,7 +2334,7 @@ function createAllEmptyOpP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPatte
2108
2334
 
2109
2335
  /**
2110
2336
  * Create a _10y1m1w1y2y3m3y4y5y6m6y8yPattern2 pattern node
2111
- * @param {BrkClientBase} client
2337
+ * @param {BrkClient} client
2112
2338
  * @param {string} acc - Accumulated series name
2113
2339
  * @returns {_10y1m1w1y2y3m3y4y5y6m6y8yPattern2}
2114
2340
  */
@@ -2147,7 +2373,7 @@ function create_10y1m1w1y2y3m3y4y5y6m6y8yPattern2(client, acc) {
2147
2373
 
2148
2374
  /**
2149
2375
  * Create a _10y1m1w1y2y3m3y4y5y6m6y8yPattern3 pattern node
2150
- * @param {BrkClientBase} client
2376
+ * @param {BrkClient} client
2151
2377
  * @param {string} acc - Accumulated series name
2152
2378
  * @returns {_10y1m1w1y2y3m3y4y5y6m6y8yPattern3}
2153
2379
  */
@@ -2218,7 +2444,7 @@ function create_10y1m1w1y2y3m3y4y5y6m6y8yPattern3(client, acc) {
2218
2444
 
2219
2445
  /**
2220
2446
  * Create a EmptyOpP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern2 pattern node
2221
- * @param {BrkClientBase} client
2447
+ * @param {BrkClient} client
2222
2448
  * @param {string} acc - Accumulated series name
2223
2449
  * @returns {EmptyOpP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern2}
2224
2450
  */
@@ -2256,7 +2482,7 @@ function createEmptyOpP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern2
2256
2482
 
2257
2483
  /**
2258
2484
  * Create a AverageBlockCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern pattern node
2259
- * @param {BrkClientBase} client
2485
+ * @param {BrkClient} client
2260
2486
  * @param {string} acc - Accumulated series name
2261
2487
  * @returns {AverageBlockCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern}
2262
2488
  */
@@ -2293,7 +2519,7 @@ function createAverageBlockCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern(
2293
2519
 
2294
2520
  /**
2295
2521
  * Create a EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern2 pattern node
2296
- * @param {BrkClientBase} client
2522
+ * @param {BrkClient} client
2297
2523
  * @param {string} acc - Accumulated series name
2298
2524
  * @returns {EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern2}
2299
2525
  */
@@ -2332,7 +2558,7 @@ function createEmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern2(c
2332
2558
  /**
2333
2559
  * Create a AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern pattern node
2334
2560
  * @template T
2335
- * @param {BrkClientBase} client
2561
+ * @param {BrkClient} client
2336
2562
  * @param {string} acc - Accumulated series name
2337
2563
  * @returns {AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern<T>}
2338
2564
  */
@@ -2382,7 +2608,7 @@ function createAverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern(c
2382
2608
 
2383
2609
  /**
2384
2610
  * Create a IndexPct0Pct1Pct2Pct5Pct95Pct98Pct99ScorePattern pattern node
2385
- * @param {BrkClientBase} client
2611
+ * @param {BrkClient} client
2386
2612
  * @param {string} acc - Accumulated series name
2387
2613
  * @returns {IndexPct0Pct1Pct2Pct5Pct95Pct98Pct99ScorePattern}
2388
2614
  */
@@ -2416,7 +2642,7 @@ function createIndexPct0Pct1Pct2Pct5Pct95Pct98Pct99ScorePattern(client, acc) {
2416
2642
 
2417
2643
  /**
2418
2644
  * Create a AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern6 pattern node
2419
- * @param {BrkClientBase} client
2645
+ * @param {BrkClient} client
2420
2646
  * @param {string} acc - Accumulated series name
2421
2647
  * @returns {AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern6}
2422
2648
  */
@@ -2449,7 +2675,7 @@ function createAllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern6(client, acc) {
2449
2675
 
2450
2676
  /**
2451
2677
  * Create a AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern5 pattern node
2452
- * @param {BrkClientBase} client
2678
+ * @param {BrkClient} client
2453
2679
  * @param {string} acc - Accumulated series name
2454
2680
  * @returns {AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern5}
2455
2681
  */
@@ -2482,7 +2708,7 @@ function createAllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern5(client, acc) {
2482
2708
 
2483
2709
  /**
2484
2710
  * Create a AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern4 pattern node
2485
- * @param {BrkClientBase} client
2711
+ * @param {BrkClient} client
2486
2712
  * @param {string} acc - Accumulated series name
2487
2713
  * @returns {AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern4}
2488
2714
  */
@@ -2515,7 +2741,7 @@ function createAllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern4(client, acc) {
2515
2741
 
2516
2742
  /**
2517
2743
  * Create a AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern7 pattern node
2518
- * @param {BrkClientBase} client
2744
+ * @param {BrkClient} client
2519
2745
  * @param {string} acc - Accumulated series name
2520
2746
  * @returns {AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern7}
2521
2747
  */
@@ -2548,7 +2774,7 @@ function createAllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern7(client, acc) {
2548
2774
 
2549
2775
  /**
2550
2776
  * Create a AverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern pattern node
2551
- * @param {BrkClientBase} client
2777
+ * @param {BrkClient} client
2552
2778
  * @param {string} acc - Accumulated series name
2553
2779
  * @returns {AverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern}
2554
2780
  */
@@ -2581,7 +2807,7 @@ function createAverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern(client, acc) {
2581
2807
 
2582
2808
  /**
2583
2809
  * Create a CapitalizedGrossInvestedLossNetNuplProfitSentimentPattern2 pattern node
2584
- * @param {BrkClientBase} client
2810
+ * @param {BrkClient} client
2585
2811
  * @param {string} acc - Accumulated series name
2586
2812
  * @returns {CapitalizedGrossInvestedLossNetNuplProfitSentimentPattern2}
2587
2813
  */
@@ -2625,7 +2851,7 @@ function createCapitalizedGrossInvestedLossNetNuplProfitSentimentPattern2(client
2625
2851
 
2626
2852
  /**
2627
2853
  * Create a Pct0Pct1Pct2Pct5Pct95Pct98Pct99Pattern pattern node
2628
- * @param {BrkClientBase} client
2854
+ * @param {BrkClient} client
2629
2855
  * @param {string} acc - Accumulated series name
2630
2856
  * @returns {Pct0Pct1Pct2Pct5Pct95Pct98Pct99Pattern}
2631
2857
  */
@@ -2655,7 +2881,7 @@ function createPct0Pct1Pct2Pct5Pct95Pct98Pct99Pattern(client, acc) {
2655
2881
 
2656
2882
  /**
2657
2883
  * Create a _10y2y3y4y5y6y8yPattern pattern node
2658
- * @param {BrkClientBase} client
2884
+ * @param {BrkClient} client
2659
2885
  * @param {string} acc - Accumulated series name
2660
2886
  * @returns {_10y2y3y4y5y6y8yPattern}
2661
2887
  */
@@ -2684,7 +2910,7 @@ function create_10y2y3y4y5y6y8yPattern(client, acc) {
2684
2910
 
2685
2911
  /**
2686
2912
  * Create a _1m1w1y24hBpsPercentRatioPattern pattern node
2687
- * @param {BrkClientBase} client
2913
+ * @param {BrkClient} client
2688
2914
  * @param {string} acc - Accumulated series name
2689
2915
  * @returns {_1m1w1y24hBpsPercentRatioPattern}
2690
2916
  */
@@ -2724,7 +2950,7 @@ function create_1m1w1y24hBpsPercentRatioPattern(client, acc) {
2724
2950
 
2725
2951
  /**
2726
2952
  * Create a CapLossMvrvNetPriceProfitSoprPattern pattern node
2727
- * @param {BrkClientBase} client
2953
+ * @param {BrkClient} client
2728
2954
  * @param {string} acc - Accumulated series name
2729
2955
  * @returns {CapLossMvrvNetPriceProfitSoprPattern}
2730
2956
  */
@@ -2753,7 +2979,7 @@ function createCapLossMvrvNetPriceProfitSoprPattern(client, acc) {
2753
2979
 
2754
2980
  /**
2755
2981
  * Create a InMaxMinPerSupplyPattern pattern node
2756
- * @param {BrkClientBase} client
2982
+ * @param {BrkClient} client
2757
2983
  * @param {string} acc - Accumulated series name
2758
2984
  * @returns {InMaxMinPerSupplyPattern}
2759
2985
  */
@@ -2782,7 +3008,7 @@ function createInMaxMinPerSupplyPattern(client, acc) {
2782
3008
 
2783
3009
  /**
2784
3010
  * Create a MaxMedianMinPct10Pct25Pct75Pct90Pattern2 pattern node
2785
- * @param {BrkClientBase} client
3011
+ * @param {BrkClient} client
2786
3012
  * @param {string} acc - Accumulated series name
2787
3013
  * @returns {MaxMedianMinPct10Pct25Pct75Pct90Pattern2}
2788
3014
  */
@@ -2813,7 +3039,7 @@ function createMaxMedianMinPct10Pct25Pct75Pct90Pattern2(client, acc) {
2813
3039
  /**
2814
3040
  * Create a MaxMedianMinPct10Pct25Pct75Pct90Pattern pattern node
2815
3041
  * @template T
2816
- * @param {BrkClientBase} client
3042
+ * @param {BrkClient} client
2817
3043
  * @param {string} acc - Accumulated series name
2818
3044
  * @returns {MaxMedianMinPct10Pct25Pct75Pct90Pattern<T>}
2819
3045
  */
@@ -2841,7 +3067,7 @@ function createMaxMedianMinPct10Pct25Pct75Pct90Pattern(client, acc) {
2841
3067
 
2842
3068
  /**
2843
3069
  * Create a _1m1w1y2y4yAllPattern pattern node
2844
- * @param {BrkClientBase} client
3070
+ * @param {BrkClient} client
2845
3071
  * @param {string} acc - Accumulated series name
2846
3072
  * @returns {_1m1w1y2y4yAllPattern}
2847
3073
  */
@@ -2868,7 +3094,7 @@ function create_1m1w1y2y4yAllPattern(client, acc) {
2868
3094
 
2869
3095
  /**
2870
3096
  * Create a ActivityAddrOutputsRealizedSupplyUnrealizedPattern pattern node
2871
- * @param {BrkClientBase} client
3097
+ * @param {BrkClient} client
2872
3098
  * @param {string} acc - Accumulated series name
2873
3099
  * @returns {ActivityAddrOutputsRealizedSupplyUnrealizedPattern}
2874
3100
  */
@@ -2895,7 +3121,7 @@ function createActivityAddrOutputsRealizedSupplyUnrealizedPattern(client, acc) {
2895
3121
 
2896
3122
  /**
2897
3123
  * Create a AverageBlockCumulativeInSumPattern pattern node
2898
- * @param {BrkClientBase} client
3124
+ * @param {BrkClient} client
2899
3125
  * @param {string} acc - Accumulated series name
2900
3126
  * @returns {AverageBlockCumulativeInSumPattern}
2901
3127
  */
@@ -2922,7 +3148,7 @@ function createAverageBlockCumulativeInSumPattern(client, acc) {
2922
3148
 
2923
3149
  /**
2924
3150
  * Create a BpsCentsPercentilesRatioSatsUsdPattern pattern node
2925
- * @param {BrkClientBase} client
3151
+ * @param {BrkClient} client
2926
3152
  * @param {string} acc - Accumulated series name
2927
3153
  * @returns {BpsCentsPercentilesRatioSatsUsdPattern}
2928
3154
  */
@@ -2949,7 +3175,7 @@ function createBpsCentsPercentilesRatioSatsUsdPattern(client, acc) {
2949
3175
 
2950
3176
  /**
2951
3177
  * Create a CentsNegativeToUsdPattern2 pattern node
2952
- * @param {BrkClientBase} client
3178
+ * @param {BrkClient} client
2953
3179
  * @param {string} acc - Accumulated series name
2954
3180
  * @returns {CentsNegativeToUsdPattern2}
2955
3181
  */
@@ -2976,7 +3202,7 @@ function createCentsNegativeToUsdPattern2(client, acc) {
2976
3202
 
2977
3203
  /**
2978
3204
  * Create a DeltaDominanceHalfInTotalPattern2 pattern node
2979
- * @param {BrkClientBase} client
3205
+ * @param {BrkClient} client
2980
3206
  * @param {string} acc - Accumulated series name
2981
3207
  * @returns {DeltaDominanceHalfInTotalPattern2}
2982
3208
  */
@@ -3003,7 +3229,7 @@ function createDeltaDominanceHalfInTotalPattern2(client, acc) {
3003
3229
 
3004
3230
  /**
3005
3231
  * Create a DeltaDominanceHalfInTotalPattern pattern node
3006
- * @param {BrkClientBase} client
3232
+ * @param {BrkClient} client
3007
3233
  * @param {string} acc - Accumulated series name
3008
3234
  * @returns {DeltaDominanceHalfInTotalPattern}
3009
3235
  */
@@ -3029,7 +3255,7 @@ function createDeltaDominanceHalfInTotalPattern(client, acc) {
3029
3255
 
3030
3256
  /**
3031
3257
  * Create a _1m1w1y24hBlockPattern2 pattern node
3032
- * @param {BrkClientBase} client
3258
+ * @param {BrkClient} client
3033
3259
  * @param {string} acc - Accumulated series name
3034
3260
  * @returns {_1m1w1y24hBlockPattern2}
3035
3261
  */
@@ -3054,7 +3280,7 @@ function create_1m1w1y24hBlockPattern2(client, acc) {
3054
3280
 
3055
3281
  /**
3056
3282
  * Create a _1m1w1y24hBlockPattern pattern node
3057
- * @param {BrkClientBase} client
3283
+ * @param {BrkClient} client
3058
3284
  * @param {string} acc - Accumulated series name
3059
3285
  * @returns {_1m1w1y24hBlockPattern}
3060
3286
  */
@@ -3079,7 +3305,7 @@ function create_1m1w1y24hBlockPattern(client, acc) {
3079
3305
 
3080
3306
  /**
3081
3307
  * Create a ActiveBidirectionalReactivatedReceivingSendingPattern pattern node
3082
- * @param {BrkClientBase} client
3308
+ * @param {BrkClient} client
3083
3309
  * @param {string} acc - Accumulated series name
3084
3310
  * @returns {ActiveBidirectionalReactivatedReceivingSendingPattern}
3085
3311
  */
@@ -3104,7 +3330,7 @@ function createActiveBidirectionalReactivatedReceivingSendingPattern(client, acc
3104
3330
 
3105
3331
  /**
3106
3332
  * Create a ActivityOutputsRealizedSupplyUnrealizedPattern pattern node
3107
- * @param {BrkClientBase} client
3333
+ * @param {BrkClient} client
3108
3334
  * @param {string} acc - Accumulated series name
3109
3335
  * @returns {ActivityOutputsRealizedSupplyUnrealizedPattern}
3110
3336
  */
@@ -3129,7 +3355,7 @@ function createActivityOutputsRealizedSupplyUnrealizedPattern(client, acc) {
3129
3355
 
3130
3356
  /**
3131
3357
  * Create a ActivityOutputsRealizedSupplyUnrealizedPattern3 pattern node
3132
- * @param {BrkClientBase} client
3358
+ * @param {BrkClient} client
3133
3359
  * @param {string} acc - Accumulated series name
3134
3360
  * @returns {ActivityOutputsRealizedSupplyUnrealizedPattern3}
3135
3361
  */
@@ -3154,7 +3380,7 @@ function createActivityOutputsRealizedSupplyUnrealizedPattern3(client, acc) {
3154
3380
 
3155
3381
  /**
3156
3382
  * Create a ActivityOutputsRealizedSupplyUnrealizedPattern2 pattern node
3157
- * @param {BrkClientBase} client
3383
+ * @param {BrkClient} client
3158
3384
  * @param {string} acc - Accumulated series name
3159
3385
  * @returns {ActivityOutputsRealizedSupplyUnrealizedPattern2}
3160
3386
  */
@@ -3179,7 +3405,7 @@ function createActivityOutputsRealizedSupplyUnrealizedPattern2(client, acc) {
3179
3405
 
3180
3406
  /**
3181
3407
  * Create a BlockChangeCumulativeDeltaSumPattern pattern node
3182
- * @param {BrkClientBase} client
3408
+ * @param {BrkClient} client
3183
3409
  * @param {string} acc - Accumulated series name
3184
3410
  * @returns {BlockChangeCumulativeDeltaSumPattern}
3185
3411
  */
@@ -3204,7 +3430,7 @@ function createBlockChangeCumulativeDeltaSumPattern(client, acc) {
3204
3430
 
3205
3431
  /**
3206
3432
  * Create a BpsCentsRatioSatsUsdPattern pattern node
3207
- * @param {BrkClientBase} client
3433
+ * @param {BrkClient} client
3208
3434
  * @param {string} acc - Accumulated series name
3209
3435
  * @returns {BpsCentsRatioSatsUsdPattern}
3210
3436
  */
@@ -3229,7 +3455,7 @@ function createBpsCentsRatioSatsUsdPattern(client, acc) {
3229
3455
 
3230
3456
  /**
3231
3457
  * Create a BtcCentsDeltaSatsUsdPattern pattern node
3232
- * @param {BrkClientBase} client
3458
+ * @param {BrkClient} client
3233
3459
  * @param {string} acc - Accumulated series name
3234
3460
  * @returns {BtcCentsDeltaSatsUsdPattern}
3235
3461
  */
@@ -3254,7 +3480,7 @@ function createBtcCentsDeltaSatsUsdPattern(client, acc) {
3254
3480
 
3255
3481
  /**
3256
3482
  * Create a BtcCentsSatsShareUsdPattern pattern node
3257
- * @param {BrkClientBase} client
3483
+ * @param {BrkClient} client
3258
3484
  * @param {string} acc - Accumulated series name
3259
3485
  * @returns {BtcCentsSatsShareUsdPattern}
3260
3486
  */
@@ -3279,7 +3505,7 @@ function createBtcCentsSatsShareUsdPattern(client, acc) {
3279
3505
 
3280
3506
  /**
3281
3507
  * Create a CapLossMvrvPriceProfitPattern pattern node
3282
- * @param {BrkClientBase} client
3508
+ * @param {BrkClient} client
3283
3509
  * @param {string} acc - Accumulated series name
3284
3510
  * @returns {CapLossMvrvPriceProfitPattern}
3285
3511
  */
@@ -3304,7 +3530,7 @@ function createCapLossMvrvPriceProfitPattern(client, acc) {
3304
3530
 
3305
3531
  /**
3306
3532
  * Create a CentsToUsdPattern4 pattern node
3307
- * @param {BrkClientBase} client
3533
+ * @param {BrkClient} client
3308
3534
  * @param {string} acc - Accumulated series name
3309
3535
  * @returns {CentsToUsdPattern4}
3310
3536
  */
@@ -3338,7 +3564,7 @@ function createCentsToUsdPattern4(client, acc) {
3338
3564
 
3339
3565
  /**
3340
3566
  * Create a PhsReboundThsPattern pattern node
3341
- * @param {BrkClientBase} client
3567
+ * @param {BrkClient} client
3342
3568
  * @param {string} acc - Accumulated series name
3343
3569
  * @returns {PhsReboundThsPattern}
3344
3570
  */
@@ -3362,7 +3588,7 @@ function createPhsReboundThsPattern(client, acc) {
3362
3588
 
3363
3589
  /**
3364
3590
  * Create a _1m1w1y24hPattern2 pattern node
3365
- * @param {BrkClientBase} client
3591
+ * @param {BrkClient} client
3366
3592
  * @param {string} acc - Accumulated series name
3367
3593
  * @returns {_1m1w1y24hPattern2}
3368
3594
  */
@@ -3385,7 +3611,7 @@ function create_1m1w1y24hPattern2(client, acc) {
3385
3611
 
3386
3612
  /**
3387
3613
  * Create a _1m1w1y24hPattern8 pattern node
3388
- * @param {BrkClientBase} client
3614
+ * @param {BrkClient} client
3389
3615
  * @param {string} acc - Accumulated series name
3390
3616
  * @returns {_1m1w1y24hPattern8}
3391
3617
  */
@@ -3408,7 +3634,7 @@ function create_1m1w1y24hPattern8(client, acc) {
3408
3634
 
3409
3635
  /**
3410
3636
  * Create a _1m1w1y24hPattern4 pattern node
3411
- * @param {BrkClientBase} client
3637
+ * @param {BrkClient} client
3412
3638
  * @param {string} acc - Accumulated series name
3413
3639
  * @returns {_1m1w1y24hPattern4}
3414
3640
  */
@@ -3431,7 +3657,7 @@ function create_1m1w1y24hPattern4(client, acc) {
3431
3657
 
3432
3658
  /**
3433
3659
  * Create a _1m1w1y24hPattern3 pattern node
3434
- * @param {BrkClientBase} client
3660
+ * @param {BrkClient} client
3435
3661
  * @param {string} acc - Accumulated series name
3436
3662
  * @returns {_1m1w1y24hPattern3}
3437
3663
  */
@@ -3454,7 +3680,7 @@ function create_1m1w1y24hPattern3(client, acc) {
3454
3680
 
3455
3681
  /**
3456
3682
  * Create a _1m1w1y24hPattern7 pattern node
3457
- * @param {BrkClientBase} client
3683
+ * @param {BrkClient} client
3458
3684
  * @param {string} acc - Accumulated series name
3459
3685
  * @returns {_1m1w1y24hPattern7}
3460
3686
  */
@@ -3477,7 +3703,7 @@ function create_1m1w1y24hPattern7(client, acc) {
3477
3703
 
3478
3704
  /**
3479
3705
  * Create a _1m1w1y2wPattern pattern node
3480
- * @param {BrkClientBase} client
3706
+ * @param {BrkClient} client
3481
3707
  * @param {string} acc - Accumulated series name
3482
3708
  * @returns {_1m1w1y2wPattern}
3483
3709
  */
@@ -3500,7 +3726,7 @@ function create_1m1w1y2wPattern(client, acc) {
3500
3726
 
3501
3727
  /**
3502
3728
  * Create a _1m1w1y24hPattern5 pattern node
3503
- * @param {BrkClientBase} client
3729
+ * @param {BrkClient} client
3504
3730
  * @param {string} acc - Accumulated series name
3505
3731
  * @returns {_1m1w1y24hPattern5}
3506
3732
  */
@@ -3523,7 +3749,7 @@ function create_1m1w1y24hPattern5(client, acc) {
3523
3749
 
3524
3750
  /**
3525
3751
  * Create a _1m1w1y24hPattern6 pattern node
3526
- * @param {BrkClientBase} client
3752
+ * @param {BrkClient} client
3527
3753
  * @param {string} acc - Accumulated series name
3528
3754
  * @returns {_1m1w1y24hPattern6}
3529
3755
  */
@@ -3554,7 +3780,7 @@ function create_1m1w1y24hPattern6(client, acc) {
3554
3780
 
3555
3781
  /**
3556
3782
  * Create a AverageBlockCumulativeSumPattern2 pattern node
3557
- * @param {BrkClientBase} client
3783
+ * @param {BrkClient} client
3558
3784
  * @param {string} acc - Accumulated series name
3559
3785
  * @returns {AverageBlockCumulativeSumPattern2}
3560
3786
  */
@@ -3577,7 +3803,7 @@ function createAverageBlockCumulativeSumPattern2(client, acc) {
3577
3803
 
3578
3804
  /**
3579
3805
  * Create a AverageBlockCumulativeSumPattern3 pattern node
3580
- * @param {BrkClientBase} client
3806
+ * @param {BrkClient} client
3581
3807
  * @param {string} acc - Accumulated series name
3582
3808
  * @returns {AverageBlockCumulativeSumPattern3}
3583
3809
  */
@@ -3600,7 +3826,7 @@ function createAverageBlockCumulativeSumPattern3(client, acc) {
3600
3826
 
3601
3827
  /**
3602
3828
  * Create a BlockCumulativeNegativeSumPattern pattern node
3603
- * @param {BrkClientBase} client
3829
+ * @param {BrkClient} client
3604
3830
  * @param {string} acc - Accumulated series name
3605
3831
  * @returns {BlockCumulativeNegativeSumPattern}
3606
3832
  */
@@ -3623,7 +3849,7 @@ function createBlockCumulativeNegativeSumPattern(client, acc) {
3623
3849
 
3624
3850
  /**
3625
3851
  * Create a BlockCumulativeDeltaSumPattern pattern node
3626
- * @param {BrkClientBase} client
3852
+ * @param {BrkClient} client
3627
3853
  * @param {string} acc - Accumulated series name
3628
3854
  * @returns {BlockCumulativeDeltaSumPattern}
3629
3855
  */
@@ -3646,7 +3872,7 @@ function createBlockCumulativeDeltaSumPattern(client, acc) {
3646
3872
 
3647
3873
  /**
3648
3874
  * Create a BtcCentsSatsUsdPattern pattern node
3649
- * @param {BrkClientBase} client
3875
+ * @param {BrkClient} client
3650
3876
  * @param {string} acc - Accumulated series name
3651
3877
  * @returns {BtcCentsSatsUsdPattern}
3652
3878
  */
@@ -3669,7 +3895,7 @@ function createBtcCentsSatsUsdPattern(client, acc) {
3669
3895
 
3670
3896
  /**
3671
3897
  * Create a BtcCentsSatsUsdPattern2 pattern node
3672
- * @param {BrkClientBase} client
3898
+ * @param {BrkClient} client
3673
3899
  * @param {string} acc - Accumulated series name
3674
3900
  * @returns {BtcCentsSatsUsdPattern2}
3675
3901
  */
@@ -3692,7 +3918,7 @@ function createBtcCentsSatsUsdPattern2(client, acc) {
3692
3918
 
3693
3919
  /**
3694
3920
  * Create a BtcCentsSatsUsdPattern3 pattern node
3695
- * @param {BrkClientBase} client
3921
+ * @param {BrkClient} client
3696
3922
  * @param {string} acc - Accumulated series name
3697
3923
  * @returns {BtcCentsSatsUsdPattern3}
3698
3924
  */
@@ -3715,7 +3941,7 @@ function createBtcCentsSatsUsdPattern3(client, acc) {
3715
3941
 
3716
3942
  /**
3717
3943
  * Create a CentsDeltaToUsdPattern pattern node
3718
- * @param {BrkClientBase} client
3944
+ * @param {BrkClient} client
3719
3945
  * @param {string} acc - Accumulated series name
3720
3946
  * @returns {CentsDeltaToUsdPattern}
3721
3947
  */
@@ -3738,7 +3964,7 @@ function createCentsDeltaToUsdPattern(client, acc) {
3738
3964
 
3739
3965
  /**
3740
3966
  * Create a CentsToUsdPattern3 pattern node
3741
- * @param {BrkClientBase} client
3967
+ * @param {BrkClient} client
3742
3968
  * @param {string} acc - Accumulated series name
3743
3969
  * @returns {CentsToUsdPattern3}
3744
3970
  */
@@ -3761,7 +3987,7 @@ function createCentsToUsdPattern3(client, acc) {
3761
3987
 
3762
3988
  /**
3763
3989
  * Create a CoindaysCoinyearsDormancyTransferPattern pattern node
3764
- * @param {BrkClientBase} client
3990
+ * @param {BrkClient} client
3765
3991
  * @param {string} acc - Accumulated series name
3766
3992
  * @returns {CoindaysCoinyearsDormancyTransferPattern}
3767
3993
  */
@@ -3784,7 +4010,7 @@ function createCoindaysCoinyearsDormancyTransferPattern(client, acc) {
3784
4010
 
3785
4011
  /**
3786
4012
  * Create a LossNetNuplProfitPattern pattern node
3787
- * @param {BrkClientBase} client
4013
+ * @param {BrkClient} client
3788
4014
  * @param {string} acc - Accumulated series name
3789
4015
  * @returns {LossNetNuplProfitPattern}
3790
4016
  */
@@ -3807,7 +4033,7 @@ function createLossNetNuplProfitPattern(client, acc) {
3807
4033
 
3808
4034
  /**
3809
4035
  * Create a NuplRealizedSupplyUnrealizedPattern pattern node
3810
- * @param {BrkClientBase} client
4036
+ * @param {BrkClient} client
3811
4037
  * @param {string} acc - Accumulated series name
3812
4038
  * @returns {NuplRealizedSupplyUnrealizedPattern}
3813
4039
  */
@@ -3832,7 +4058,7 @@ function createNuplRealizedSupplyUnrealizedPattern(client, acc) {
3832
4058
  /**
3833
4059
  * Create a _1m1w1y24hPattern pattern node
3834
4060
  * @template T
3835
- * @param {BrkClientBase} client
4061
+ * @param {BrkClient} client
3836
4062
  * @param {string} acc - Accumulated series name
3837
4063
  * @returns {_1m1w1y24hPattern<T>}
3838
4064
  */
@@ -3857,7 +4083,7 @@ function create_1m1w1y24hPattern(client, acc) {
3857
4083
  /**
3858
4084
  * Create a AverageBlockCumulativeSumPattern pattern node
3859
4085
  * @template T
3860
- * @param {BrkClientBase} client
4086
+ * @param {BrkClient} client
3861
4087
  * @param {string} acc - Accumulated series name
3862
4088
  * @returns {AverageBlockCumulativeSumPattern<T>}
3863
4089
  */
@@ -3879,7 +4105,7 @@ function createAverageBlockCumulativeSumPattern(client, acc) {
3879
4105
 
3880
4106
  /**
3881
4107
  * Create a AdjustedRatioValuePattern pattern node
3882
- * @param {BrkClientBase} client
4108
+ * @param {BrkClient} client
3883
4109
  * @param {string} acc - Accumulated series name
3884
4110
  * @returns {AdjustedRatioValuePattern}
3885
4111
  */
@@ -3900,7 +4126,7 @@ function createAdjustedRatioValuePattern(client, acc) {
3900
4126
 
3901
4127
  /**
3902
4128
  * Create a BlockCumulativeSumPattern pattern node
3903
- * @param {BrkClientBase} client
4129
+ * @param {BrkClient} client
3904
4130
  * @param {string} acc - Accumulated series name
3905
4131
  * @returns {BlockCumulativeSumPattern}
3906
4132
  */
@@ -3921,7 +4147,7 @@ function createBlockCumulativeSumPattern(client, acc) {
3921
4147
 
3922
4148
  /**
3923
4149
  * Create a BlocksDominanceRewardsPattern pattern node
3924
- * @param {BrkClientBase} client
4150
+ * @param {BrkClient} client
3925
4151
  * @param {string} acc - Accumulated series name
3926
4152
  * @returns {BlocksDominanceRewardsPattern}
3927
4153
  */
@@ -3942,7 +4168,7 @@ function createBlocksDominanceRewardsPattern(client, acc) {
3942
4168
 
3943
4169
  /**
3944
4170
  * Create a BpsPercentRatioPattern2 pattern node
3945
- * @param {BrkClientBase} client
4171
+ * @param {BrkClient} client
3946
4172
  * @param {string} acc - Accumulated series name
3947
4173
  * @returns {BpsPercentRatioPattern2}
3948
4174
  */
@@ -3963,7 +4189,7 @@ function createBpsPercentRatioPattern2(client, acc) {
3963
4189
 
3964
4190
  /**
3965
4191
  * Create a BpsPercentRatioPattern4 pattern node
3966
- * @param {BrkClientBase} client
4192
+ * @param {BrkClient} client
3967
4193
  * @param {string} acc - Accumulated series name
3968
4194
  * @returns {BpsPercentRatioPattern4}
3969
4195
  */
@@ -3984,7 +4210,7 @@ function createBpsPercentRatioPattern4(client, acc) {
3984
4210
 
3985
4211
  /**
3986
4212
  * Create a BpsPriceRatioPattern pattern node
3987
- * @param {BrkClientBase} client
4213
+ * @param {BrkClient} client
3988
4214
  * @param {string} acc - Accumulated series name
3989
4215
  * @param {string} disc - Discriminator suffix
3990
4216
  * @returns {BpsPriceRatioPattern}
@@ -4006,7 +4232,7 @@ function createBpsPriceRatioPattern(client, acc, disc) {
4006
4232
 
4007
4233
  /**
4008
4234
  * Create a BpsPercentRatioPattern5 pattern node
4009
- * @param {BrkClientBase} client
4235
+ * @param {BrkClient} client
4010
4236
  * @param {string} acc - Accumulated series name
4011
4237
  * @returns {BpsPercentRatioPattern5}
4012
4238
  */
@@ -4027,7 +4253,7 @@ function createBpsPercentRatioPattern5(client, acc) {
4027
4253
 
4028
4254
  /**
4029
4255
  * Create a BpsPercentRatioPattern pattern node
4030
- * @param {BrkClientBase} client
4256
+ * @param {BrkClient} client
4031
4257
  * @param {string} acc - Accumulated series name
4032
4258
  * @returns {BpsPercentRatioPattern}
4033
4259
  */
@@ -4048,7 +4274,7 @@ function createBpsPercentRatioPattern(client, acc) {
4048
4274
 
4049
4275
  /**
4050
4276
  * Create a CentsSatsUsdPattern3 pattern node
4051
- * @param {BrkClientBase} client
4277
+ * @param {BrkClient} client
4052
4278
  * @param {string} acc - Accumulated series name
4053
4279
  * @returns {CentsSatsUsdPattern3}
4054
4280
  */
@@ -4069,7 +4295,7 @@ function createCentsSatsUsdPattern3(client, acc) {
4069
4295
 
4070
4296
  /**
4071
4297
  * Create a CentsDeltaUsdPattern pattern node
4072
- * @param {BrkClientBase} client
4298
+ * @param {BrkClient} client
4073
4299
  * @param {string} acc - Accumulated series name
4074
4300
  * @returns {CentsDeltaUsdPattern}
4075
4301
  */
@@ -4090,7 +4316,7 @@ function createCentsDeltaUsdPattern(client, acc) {
4090
4316
 
4091
4317
  /**
4092
4318
  * Create a CentsNegativeUsdPattern pattern node
4093
- * @param {BrkClientBase} client
4319
+ * @param {BrkClient} client
4094
4320
  * @param {string} acc - Accumulated series name
4095
4321
  * @returns {CentsNegativeUsdPattern}
4096
4322
  */
@@ -4111,7 +4337,7 @@ function createCentsNegativeUsdPattern(client, acc) {
4111
4337
 
4112
4338
  /**
4113
4339
  * Create a CentsSatsUsdPattern pattern node
4114
- * @param {BrkClientBase} client
4340
+ * @param {BrkClient} client
4115
4341
  * @param {string} acc - Accumulated series name
4116
4342
  * @returns {CentsSatsUsdPattern}
4117
4343
  */
@@ -4139,7 +4365,7 @@ function createCentsSatsUsdPattern(client, acc) {
4139
4365
 
4140
4366
  /**
4141
4367
  * Create a CumulativeRollingSumPattern pattern node
4142
- * @param {BrkClientBase} client
4368
+ * @param {BrkClient} client
4143
4369
  * @param {string} acc - Accumulated series name
4144
4370
  * @returns {CumulativeRollingSumPattern}
4145
4371
  */
@@ -4160,7 +4386,7 @@ function createCumulativeRollingSumPattern(client, acc) {
4160
4386
 
4161
4387
  /**
4162
4388
  * Create a DeltaDominanceTotalPattern pattern node
4163
- * @param {BrkClientBase} client
4389
+ * @param {BrkClient} client
4164
4390
  * @param {string} acc - Accumulated series name
4165
4391
  * @returns {DeltaDominanceTotalPattern}
4166
4392
  */
@@ -4181,7 +4407,7 @@ function createDeltaDominanceTotalPattern(client, acc) {
4181
4407
 
4182
4408
  /**
4183
4409
  * Create a GreedNetPainPattern pattern node
4184
- * @param {BrkClientBase} client
4410
+ * @param {BrkClient} client
4185
4411
  * @param {string} acc - Accumulated series name
4186
4412
  * @returns {GreedNetPainPattern}
4187
4413
  */
@@ -4202,7 +4428,7 @@ function createGreedNetPainPattern(client, acc) {
4202
4428
 
4203
4429
  /**
4204
4430
  * Create a LossNuplProfitPattern pattern node
4205
- * @param {BrkClientBase} client
4431
+ * @param {BrkClient} client
4206
4432
  * @param {string} acc - Accumulated series name
4207
4433
  * @returns {LossNuplProfitPattern}
4208
4434
  */
@@ -4223,7 +4449,7 @@ function createLossNuplProfitPattern(client, acc) {
4223
4449
 
4224
4450
  /**
4225
4451
  * Create a RatioTransferValuePattern pattern node
4226
- * @param {BrkClientBase} client
4452
+ * @param {BrkClient} client
4227
4453
  * @param {string} acc - Accumulated series name
4228
4454
  * @returns {RatioTransferValuePattern}
4229
4455
  */
@@ -4244,7 +4470,7 @@ function createRatioTransferValuePattern(client, acc) {
4244
4470
 
4245
4471
  /**
4246
4472
  * Create a RsiStochPattern pattern node
4247
- * @param {BrkClientBase} client
4473
+ * @param {BrkClient} client
4248
4474
  * @param {string} acc - Accumulated series name
4249
4475
  * @param {string} disc - Discriminator suffix
4250
4476
  * @returns {RsiStochPattern}
@@ -4266,7 +4492,7 @@ function createRsiStochPattern(client, acc, disc) {
4266
4492
 
4267
4493
  /**
4268
4494
  * Create a SpendingSpentUnspentPattern pattern node
4269
- * @param {BrkClientBase} client
4495
+ * @param {BrkClient} client
4270
4496
  * @param {string} acc - Accumulated series name
4271
4497
  * @returns {SpendingSpentUnspentPattern}
4272
4498
  */
@@ -4289,7 +4515,7 @@ function createSpendingSpentUnspentPattern(client, acc) {
4289
4515
  /**
4290
4516
  * Create a _6bBlockTxPattern pattern node
4291
4517
  * @template T
4292
- * @param {BrkClientBase} client
4518
+ * @param {BrkClient} client
4293
4519
  * @param {string} acc - Accumulated series name
4294
4520
  * @returns {_6bBlockTxPattern<T>}
4295
4521
  */
@@ -4309,7 +4535,7 @@ function create_6bBlockTxPattern(client, acc) {
4309
4535
 
4310
4536
  /**
4311
4537
  * Create a AbsoluteRatePattern pattern node
4312
- * @param {BrkClientBase} client
4538
+ * @param {BrkClient} client
4313
4539
  * @param {string} acc - Accumulated series name
4314
4540
  * @returns {AbsoluteRatePattern}
4315
4541
  */
@@ -4328,7 +4554,7 @@ function createAbsoluteRatePattern(client, acc) {
4328
4554
 
4329
4555
  /**
4330
4556
  * Create a AbsoluteRatePattern2 pattern node
4331
- * @param {BrkClientBase} client
4557
+ * @param {BrkClient} client
4332
4558
  * @param {string} acc - Accumulated series name
4333
4559
  * @returns {AbsoluteRatePattern2}
4334
4560
  */
@@ -4347,7 +4573,7 @@ function createAbsoluteRatePattern2(client, acc) {
4347
4573
 
4348
4574
  /**
4349
4575
  * Create a AbsoluteRatePattern3 pattern node
4350
- * @param {BrkClientBase} client
4576
+ * @param {BrkClient} client
4351
4577
  * @param {string} acc - Accumulated series name
4352
4578
  * @returns {AbsoluteRatePattern3}
4353
4579
  */
@@ -4366,7 +4592,7 @@ function createAbsoluteRatePattern3(client, acc) {
4366
4592
 
4367
4593
  /**
4368
4594
  * Create a AddrUtxoPattern pattern node
4369
- * @param {BrkClientBase} client
4595
+ * @param {BrkClient} client
4370
4596
  * @param {string} acc - Accumulated series name
4371
4597
  * @returns {AddrUtxoPattern}
4372
4598
  */
@@ -4385,7 +4611,7 @@ function createAddrUtxoPattern(client, acc) {
4385
4611
 
4386
4612
  /**
4387
4613
  * Create a AllSthPattern2 pattern node
4388
- * @param {BrkClientBase} client
4614
+ * @param {BrkClient} client
4389
4615
  * @param {string} acc - Accumulated series name
4390
4616
  * @returns {AllSthPattern2}
4391
4617
  */
@@ -4404,7 +4630,7 @@ function createAllSthPattern2(client, acc) {
4404
4630
 
4405
4631
  /**
4406
4632
  * Create a AllSthPattern pattern node
4407
- * @param {BrkClientBase} client
4633
+ * @param {BrkClient} client
4408
4634
  * @param {string} acc - Accumulated series name
4409
4635
  * @param {string} disc - Discriminator suffix
4410
4636
  * @returns {AllSthPattern}
@@ -4424,7 +4650,7 @@ function createAllSthPattern(client, acc, disc) {
4424
4650
 
4425
4651
  /**
4426
4652
  * Create a BaseSumPattern pattern node
4427
- * @param {BrkClientBase} client
4653
+ * @param {BrkClient} client
4428
4654
  * @param {string} acc - Accumulated series name
4429
4655
  * @returns {BaseSumPattern}
4430
4656
  */
@@ -4443,7 +4669,7 @@ function createBaseSumPattern(client, acc) {
4443
4669
 
4444
4670
  /**
4445
4671
  * Create a BaseDeltaPattern pattern node
4446
- * @param {BrkClientBase} client
4672
+ * @param {BrkClient} client
4447
4673
  * @param {string} acc - Accumulated series name
4448
4674
  * @returns {BaseDeltaPattern}
4449
4675
  */
@@ -4462,7 +4688,7 @@ function createBaseDeltaPattern(client, acc) {
4462
4688
 
4463
4689
  /**
4464
4690
  * Create a BlockCumulativePattern pattern node
4465
- * @param {BrkClientBase} client
4691
+ * @param {BrkClient} client
4466
4692
  * @param {string} acc - Accumulated series name
4467
4693
  * @returns {BlockCumulativePattern}
4468
4694
  */
@@ -4481,7 +4707,7 @@ function createBlockCumulativePattern(client, acc) {
4481
4707
 
4482
4708
  /**
4483
4709
  * Create a BlocksDominancePattern pattern node
4484
- * @param {BrkClientBase} client
4710
+ * @param {BrkClient} client
4485
4711
  * @param {string} acc - Accumulated series name
4486
4712
  * @returns {BlocksDominancePattern}
4487
4713
  */
@@ -4500,7 +4726,7 @@ function createBlocksDominancePattern(client, acc) {
4500
4726
 
4501
4727
  /**
4502
4728
  * Create a BpsRatioPattern2 pattern node
4503
- * @param {BrkClientBase} client
4729
+ * @param {BrkClient} client
4504
4730
  * @param {string} acc - Accumulated series name
4505
4731
  * @returns {BpsRatioPattern2}
4506
4732
  */
@@ -4519,7 +4745,7 @@ function createBpsRatioPattern2(client, acc) {
4519
4745
 
4520
4746
  /**
4521
4747
  * Create a BpsRatioPattern pattern node
4522
- * @param {BrkClientBase} client
4748
+ * @param {BrkClient} client
4523
4749
  * @param {string} acc - Accumulated series name
4524
4750
  * @returns {BpsRatioPattern}
4525
4751
  */
@@ -4538,7 +4764,7 @@ function createBpsRatioPattern(client, acc) {
4538
4764
 
4539
4765
  /**
4540
4766
  * Create a BtcSatsPattern pattern node
4541
- * @param {BrkClientBase} client
4767
+ * @param {BrkClient} client
4542
4768
  * @param {string} acc - Accumulated series name
4543
4769
  * @returns {BtcSatsPattern}
4544
4770
  */
@@ -4557,7 +4783,7 @@ function createBtcSatsPattern(client, acc) {
4557
4783
 
4558
4784
  /**
4559
4785
  * Create a CentsUsdPattern3 pattern node
4560
- * @param {BrkClientBase} client
4786
+ * @param {BrkClient} client
4561
4787
  * @param {string} acc - Accumulated series name
4562
4788
  * @returns {CentsUsdPattern3}
4563
4789
  */
@@ -4576,7 +4802,7 @@ function createCentsUsdPattern3(client, acc) {
4576
4802
 
4577
4803
  /**
4578
4804
  * Create a CentsUsdPattern2 pattern node
4579
- * @param {BrkClientBase} client
4805
+ * @param {BrkClient} client
4580
4806
  * @param {string} acc - Accumulated series name
4581
4807
  * @returns {CentsUsdPattern2}
4582
4808
  */
@@ -4595,7 +4821,7 @@ function createCentsUsdPattern2(client, acc) {
4595
4821
 
4596
4822
  /**
4597
4823
  * Create a CentsUsdPattern pattern node
4598
- * @param {BrkClientBase} client
4824
+ * @param {BrkClient} client
4599
4825
  * @param {string} acc - Accumulated series name
4600
4826
  * @returns {CentsUsdPattern}
4601
4827
  */
@@ -4614,7 +4840,7 @@ function createCentsUsdPattern(client, acc) {
4614
4840
 
4615
4841
  /**
4616
4842
  * Create a CentsUsdPattern4 pattern node
4617
- * @param {BrkClientBase} client
4843
+ * @param {BrkClient} client
4618
4844
  * @param {string} acc - Accumulated series name
4619
4845
  * @returns {CentsUsdPattern4}
4620
4846
  */
@@ -4633,7 +4859,7 @@ function createCentsUsdPattern4(client, acc) {
4633
4859
 
4634
4860
  /**
4635
4861
  * Create a CoindaysTransferPattern pattern node
4636
- * @param {BrkClientBase} client
4862
+ * @param {BrkClient} client
4637
4863
  * @param {string} acc - Accumulated series name
4638
4864
  * @returns {CoindaysTransferPattern}
4639
4865
  */
@@ -4652,7 +4878,7 @@ function createCoindaysTransferPattern(client, acc) {
4652
4878
 
4653
4879
  /**
4654
4880
  * Create a FundedTotalPattern pattern node
4655
- * @param {BrkClientBase} client
4881
+ * @param {BrkClient} client
4656
4882
  * @param {string} acc - Accumulated series name
4657
4883
  * @returns {FundedTotalPattern}
4658
4884
  */
@@ -4671,7 +4897,7 @@ function createFundedTotalPattern(client, acc) {
4671
4897
 
4672
4898
  /**
4673
4899
  * Create a InPattern2 pattern node
4674
- * @param {BrkClientBase} client
4900
+ * @param {BrkClient} client
4675
4901
  * @param {string} acc - Accumulated series name
4676
4902
  * @returns {InPattern2}
4677
4903
  */
@@ -4690,7 +4916,7 @@ function createInPattern2(client, acc) {
4690
4916
 
4691
4917
  /**
4692
4918
  * Create a InPattern pattern node
4693
- * @param {BrkClientBase} client
4919
+ * @param {BrkClient} client
4694
4920
  * @param {string} acc - Accumulated series name
4695
4921
  * @returns {InPattern}
4696
4922
  */
@@ -4709,7 +4935,7 @@ function createInPattern(client, acc) {
4709
4935
 
4710
4936
  /**
4711
4937
  * Create a PerPattern pattern node
4712
- * @param {BrkClientBase} client
4938
+ * @param {BrkClient} client
4713
4939
  * @param {string} acc - Accumulated series name
4714
4940
  * @returns {PerPattern}
4715
4941
  */
@@ -4728,7 +4954,7 @@ function createPerPattern(client, acc) {
4728
4954
 
4729
4955
  /**
4730
4956
  * Create a PriceRatioPattern pattern node
4731
- * @param {BrkClientBase} client
4957
+ * @param {BrkClient} client
4732
4958
  * @param {string} acc - Accumulated series name
4733
4959
  * @param {string} disc - Discriminator suffix
4734
4960
  * @returns {PriceRatioPattern}
@@ -4748,7 +4974,7 @@ function createPriceRatioPattern(client, acc, disc) {
4748
4974
 
4749
4975
  /**
4750
4976
  * Create a RatioValuePattern pattern node
4751
- * @param {BrkClientBase} client
4977
+ * @param {BrkClient} client
4752
4978
  * @param {string} acc - Accumulated series name
4753
4979
  * @returns {RatioValuePattern}
4754
4980
  */
@@ -4773,7 +4999,7 @@ function createRatioValuePattern(client, acc) {
4773
4999
 
4774
5000
  /**
4775
5001
  * Create a ToPattern pattern node
4776
- * @param {BrkClientBase} client
5002
+ * @param {BrkClient} client
4777
5003
  * @param {string} acc - Accumulated series name
4778
5004
  * @returns {ToPattern}
4779
5005
  */
@@ -4791,7 +5017,7 @@ function createToPattern(client, acc) {
4791
5017
 
4792
5018
  /**
4793
5019
  * Create a _24hPattern pattern node
4794
- * @param {BrkClientBase} client
5020
+ * @param {BrkClient} client
4795
5021
  * @param {string} acc - Accumulated series name
4796
5022
  * @returns {_24hPattern}
4797
5023
  */
@@ -4808,7 +5034,7 @@ function create_24hPattern(client, acc) {
4808
5034
 
4809
5035
  /**
4810
5036
  * Create a NuplPattern pattern node
4811
- * @param {BrkClientBase} client
5037
+ * @param {BrkClient} client
4812
5038
  * @param {string} acc - Accumulated series name
4813
5039
  * @returns {NuplPattern}
4814
5040
  */
@@ -4825,7 +5051,7 @@ function createNuplPattern(client, acc) {
4825
5051
 
4826
5052
  /**
4827
5053
  * Create a PricePattern pattern node
4828
- * @param {BrkClientBase} client
5054
+ * @param {BrkClient} client
4829
5055
  * @param {string} acc - Accumulated series name
4830
5056
  * @returns {PricePattern}
4831
5057
  */
@@ -4842,7 +5068,7 @@ function createPricePattern(client, acc) {
4842
5068
 
4843
5069
  /**
4844
5070
  * Create a SharePattern pattern node
4845
- * @param {BrkClientBase} client
5071
+ * @param {BrkClient} client
4846
5072
  * @param {string} acc - Accumulated series name
4847
5073
  * @returns {SharePattern}
4848
5074
  */
@@ -4859,7 +5085,7 @@ function createSharePattern(client, acc) {
4859
5085
 
4860
5086
  /**
4861
5087
  * Create a TransferPattern pattern node
4862
- * @param {BrkClientBase} client
5088
+ * @param {BrkClient} client
4863
5089
  * @param {string} acc - Accumulated series name
4864
5090
  * @returns {TransferPattern}
4865
5091
  */
@@ -5035,6 +5261,7 @@ function createTransferPattern(client, acc) {
5035
5261
  * @property {SeriesPattern19<RawLockTime>} rawLocktime
5036
5262
  * @property {SeriesPattern19<StoredU32>} baseSize
5037
5263
  * @property {SeriesPattern19<StoredU32>} totalSize
5264
+ * @property {SeriesPattern19<SigOps>} totalSigopCost
5038
5265
  * @property {SeriesPattern19<StoredBool>} isExplicitlyRbf
5039
5266
  * @property {SeriesPattern19<TxInIndex>} firstTxinIndex
5040
5267
  * @property {SeriesPattern19<TxOutIndex>} firstTxoutIndex
@@ -7272,7 +7499,7 @@ function createTransferPattern(client, acc) {
7272
7499
  * @extends BrkClientBase
7273
7500
  */
7274
7501
  class BrkClient extends BrkClientBase {
7275
- VERSION = "v0.3.0-beta.7";
7502
+ VERSION = "v0.3.0-beta.9";
7276
7503
 
7277
7504
  INDEXES = /** @type {const} */ ([
7278
7505
  "minute10",
@@ -7311,171 +7538,171 @@ class BrkClient extends BrkClientBase {
7311
7538
  ]);
7312
7539
 
7313
7540
  POOL_ID_TO_POOL_NAME = /** @type {const} */ ({
7314
- "unknown": "Unknown",
7315
- "blockfills": "BlockFills",
7316
- "ultimuspool": "ULTIMUSPOOL",
7317
- "terrapool": "Terra Pool",
7318
- "luxor": "Luxor",
7319
- "onethash": "1THash",
7320
- "btccom": "BTC.com",
7321
- "bitfarms": "Bitfarms",
7322
- "huobipool": "Huobi.pool",
7323
- "wayicn": "WAYI.CN",
7324
- "canoepool": "CanoePool",
7325
- "btctop": "BTC.TOP",
7326
- "bitcoincom": "Bitcoin.com",
7327
- "pool175btc": "175btc",
7328
- "gbminers": "GBMiners",
7329
- "axbt": "A-XBT",
7330
- "asicminer": "ASICMiner",
7331
- "bitminter": "BitMinter",
7332
- "bitcoinrussia": "BitcoinRussia",
7333
- "btcserv": "BTCServ",
7334
- "simplecoinus": "simplecoin.us",
7335
- "btcguild": "BTC Guild",
7336
- "eligius": "Eligius",
7337
- "ozcoin": "OzCoin",
7338
- "eclipsemc": "EclipseMC",
7339
- "maxbtc": "MaxBTC",
7340
- "triplemining": "TripleMining",
7341
- "coinlab": "CoinLab",
7342
- "pool50btc": "50BTC",
7343
- "ghashio": "GHash.IO",
7344
- "stminingcorp": "ST Mining Corp",
7345
- "bitparking": "Bitparking",
7346
- "mmpool": "mmpool",
7347
- "polmine": "Polmine",
7348
- "kncminer": "KnCMiner",
7349
- "bitalo": "Bitalo",
7350
- "f2pool": "F2Pool",
7351
- "hhtt": "HHTT",
7352
- "megabigpower": "MegaBigPower",
7353
- "mtred": "Mt Red",
7354
- "nmcbit": "NMCbit",
7355
- "yourbtcnet": "Yourbtc.net",
7356
- "givemecoins": "Give Me Coins",
7357
- "braiinspool": "Braiins Pool",
7541
+ "aaopool": "AAO Pool",
7358
7542
  "antpool": "AntPool",
7359
- "multicoinco": "MultiCoin.co",
7543
+ "arkpool": "ArkPool",
7544
+ "asicminer": "ASICMiner",
7545
+ "axbt": "A-XBT",
7546
+ "batpool": "BATPOOL",
7547
+ "bcmonster": "BCMonster",
7360
7548
  "bcpoolio": "bcpool.io",
7361
- "cointerra": "Cointerra",
7362
- "kanopool": "KanoPool",
7363
- "solock": "Solo CK",
7364
- "ckpool": "CKPool",
7365
- "nicehash": "NiceHash",
7549
+ "binancepool": "Binance Pool",
7550
+ "bitalo": "Bitalo",
7366
7551
  "bitclub": "BitClub",
7367
7552
  "bitcoinaffiliatenetwork": "Bitcoin Affiliate Network",
7368
- "btcc": "BTCC",
7369
- "bwpool": "BWPool",
7370
- "exxbw": "EXX&BW",
7371
- "bitsolo": "Bitsolo",
7553
+ "bitcoincom": "Bitcoin.com",
7554
+ "bitcoinindia": "Bitcoin India",
7555
+ "bitcoinindiapool": "BitcoinIndia",
7556
+ "bitcoinrussia": "BitcoinRussia",
7557
+ "bitcoinukraine": "Bitcoin-Ukraine",
7558
+ "bitfarms": "Bitfarms",
7559
+ "bitfufupool": "BitFuFuPool",
7372
7560
  "bitfury": "BitFury",
7373
- "twentyoneinc": "21 Inc.",
7374
- "digitalbtc": "digitalBTC",
7375
- "eightbaochi": "8baochi",
7376
- "mybtccoinpool": "myBTCcoin Pool",
7377
- "tbdice": "TBDice",
7378
- "hashpool": "HASHPOOL",
7379
- "nexious": "Nexious",
7380
- "bravomining": "Bravo Mining",
7381
- "hotpool": "HotPool",
7382
- "okexpool": "OKExPool",
7383
- "bcmonster": "BCMonster",
7384
- "onehash": "1Hash",
7561
+ "bitminter": "BitMinter",
7562
+ "bitparking": "Bitparking",
7563
+ "bitsolo": "Bitsolo",
7385
7564
  "bixin": "Bixin",
7386
- "tatmaspool": "TATMAS Pool",
7387
- "viabtc": "ViaBTC",
7565
+ "blockfills": "BlockFills",
7566
+ "braiinspool": "Braiins Pool",
7567
+ "braiinssolo": "Braiins Solo",
7568
+ "bravomining": "Bravo Mining",
7569
+ "btcc": "BTCC",
7570
+ "btccom": "BTC.com",
7571
+ "btcdig": "BTCDig",
7572
+ "btcguild": "BTC Guild",
7573
+ "btclab": "BTCLab",
7574
+ "btcmp": "BTCMP",
7575
+ "btcnuggets": "BTC Nuggets",
7576
+ "btcpoolparty": "BTC Pool Party",
7577
+ "btcserv": "BTCServ",
7578
+ "btctop": "BTC.TOP",
7579
+ "btpool": "BTPOOL",
7580
+ "bwpool": "BWPool",
7581
+ "bytepool": "BytePool",
7582
+ "canoe": "CANOE",
7583
+ "canoepool": "CanoePool",
7584
+ "carbonnegative": "Carbon Negative",
7585
+ "ckpool": "CKPool",
7586
+ "cloudhashing": "CloudHashing",
7587
+ "coinlab": "CoinLab",
7588
+ "cointerra": "Cointerra",
7388
7589
  "connectbtc": "ConnectBTC",
7389
- "batpool": "BATPOOL",
7390
- "waterhole": "Waterhole",
7391
- "dcexploration": "DCExploration",
7392
7590
  "dcex": "DCEX",
7393
- "btpool": "BTPOOL",
7591
+ "dcexploration": "DCExploration",
7592
+ "digitalbtc": "digitalBTC",
7593
+ "digitalxmintsy": "digitalX Mintsy",
7594
+ "dpool": "DPOOL",
7595
+ "eclipsemc": "EclipseMC",
7596
+ "eightbaochi": "8baochi",
7597
+ "ekanembtc": "EkanemBTC",
7598
+ "eligius": "Eligius",
7599
+ "emcdpool": "EMCDPool",
7600
+ "entrustcharitypool": "Entrust Charity Pool",
7601
+ "eobot": "Eobot",
7602
+ "est3lar": "Est3lar",
7603
+ "exxbw": "EXX&BW",
7604
+ "f2pool": "F2Pool",
7394
7605
  "fiftyeightcoin": "58COIN",
7395
- "bitcoinindia": "Bitcoin India",
7396
- "shawnp0wers": "shawnp0wers",
7397
- "phashio": "PHash.IO",
7398
- "rigpool": "RigPool",
7606
+ "foundryusa": "Foundry USA",
7607
+ "futurebitapollosolo": "FutureBit Apollo Solo",
7608
+ "gbminers": "GBMiners",
7609
+ "gdpool": "GDPool",
7610
+ "ghashio": "GHash.IO",
7611
+ "givemecoins": "Give Me Coins",
7612
+ "gogreenlight": "GoGreenLight",
7613
+ "haominer": "haominer",
7399
7614
  "haozhuzhu": "HAOZHUZHU",
7400
- "sevenpool": "7pool",
7401
- "miningkings": "MiningKings",
7402
7615
  "hashbx": "HashBX",
7403
- "dpool": "DPOOL",
7404
- "rawpool": "Rawpool",
7405
- "haominer": "haominer",
7616
+ "hashpool": "HASHPOOL",
7406
7617
  "helix": "Helix",
7407
- "bitcoinukraine": "Bitcoin-Ukraine",
7408
- "poolin": "Poolin",
7409
- "secretsuperstar": "SecretSuperstar",
7410
- "tigerpoolnet": "tigerpool.net",
7411
- "sigmapoolcom": "Sigmapool.com",
7412
- "okpooltop": "okpool.top",
7618
+ "hhtt": "HHTT",
7619
+ "hotpool": "HotPool",
7413
7620
  "hummerpool": "Hummerpool",
7414
- "tangpool": "Tangpool",
7415
- "bytepool": "BytePool",
7416
- "spiderpool": "SpiderPool",
7417
- "novablock": "NovaBlock",
7418
- "miningcity": "MiningCity",
7419
- "binancepool": "Binance Pool",
7420
- "minerium": "Minerium",
7621
+ "huobipool": "Huobi.pool",
7622
+ "innopolistech": "Innopolis Tech",
7623
+ "kanopool": "KanoPool",
7624
+ "kncminer": "KnCMiner",
7625
+ "kucoinpool": "KuCoinPool",
7421
7626
  "lubiancom": "Lubian.com",
7422
- "okkong": "OKKONG",
7423
- "aaopool": "AAO Pool",
7424
- "emcdpool": "EMCDPool",
7425
- "foundryusa": "Foundry USA",
7426
- "sbicrypto": "SBI Crypto",
7427
- "arkpool": "ArkPool",
7428
- "purebtccom": "PureBTC.COM",
7627
+ "luxor": "Luxor",
7429
7628
  "marapool": "MARA Pool",
7430
- "kucoinpool": "KuCoinPool",
7431
- "entrustcharitypool": "Entrust Charity Pool",
7629
+ "maxbtc": "MaxBTC",
7630
+ "maxipool": "MaxiPool",
7631
+ "megabigpower": "MegaBigPower",
7632
+ "minerium": "Minerium",
7633
+ "miningcity": "MiningCity",
7634
+ "miningdutch": "Mining-Dutch",
7635
+ "miningkings": "MiningKings",
7636
+ "miningsquared": "Mining Squared",
7637
+ "mmpool": "mmpool",
7638
+ "mtred": "Mt Red",
7639
+ "multicoinco": "MultiCoin.co",
7640
+ "multipool": "Multipool",
7641
+ "mybtccoinpool": "myBTCcoin Pool",
7642
+ "neopool": "Neopool",
7643
+ "nexious": "Nexious",
7644
+ "nicehash": "NiceHash",
7645
+ "nmcbit": "NMCbit",
7646
+ "noderunners": "Noderunners",
7647
+ "novablock": "NovaBlock",
7648
+ "ocean": "OCEAN",
7649
+ "okexpool": "OKExPool",
7650
+ "okkong": "OKKONG",
7432
7651
  "okminer": "OKMINER",
7433
- "titan": "Titan",
7652
+ "okpooltop": "okpool.top",
7653
+ "onehash": "1Hash",
7654
+ "onem1x": "1M1X",
7655
+ "onethash": "1THash",
7656
+ "ozcoin": "OzCoin",
7657
+ "parasite": "Parasite",
7658
+ "patels": "Patels",
7434
7659
  "pegapool": "PEGA Pool",
7435
- "btcnuggets": "BTC Nuggets",
7436
- "cloudhashing": "CloudHashing",
7437
- "digitalxmintsy": "digitalX Mintsy",
7660
+ "phashio": "PHash.IO",
7661
+ "phoenix": "Phoenix",
7662
+ "polmine": "Polmine",
7663
+ "pool175btc": "175btc",
7664
+ "pool50btc": "50BTC",
7665
+ "poolin": "Poolin",
7666
+ "portlandhodl": "Portland.HODL",
7667
+ "publicpool": "Public Pool",
7668
+ "purebtccom": "PureBTC.COM",
7669
+ "rawpool": "Rawpool",
7670
+ "redrockpool": "RedRock Pool",
7671
+ "rigpool": "RigPool",
7672
+ "sbicrypto": "SBI Crypto",
7673
+ "secpool": "SECPOOL",
7674
+ "secretsuperstar": "SecretSuperstar",
7675
+ "sevenpool": "7pool",
7676
+ "shawnp0wers": "shawnp0wers",
7677
+ "sigmapoolcom": "Sigmapool.com",
7678
+ "simplecoinus": "simplecoin.us",
7679
+ "solock": "Solo CK",
7680
+ "solopool": "SoloPool.com",
7681
+ "spiderpool": "SpiderPool",
7682
+ "stminingcorp": "ST Mining Corp",
7683
+ "tangpool": "Tangpool",
7684
+ "tatmaspool": "TATMAS Pool",
7685
+ "tbdice": "TBDice",
7438
7686
  "telco214": "Telco 214",
7439
- "btcpoolparty": "BTC Pool Party",
7440
- "multipool": "Multipool",
7687
+ "terrapool": "Terra Pool",
7688
+ "tiger": "tiger",
7689
+ "tigerpoolnet": "tigerpool.net",
7690
+ "titan": "Titan",
7441
7691
  "transactioncoinmining": "transactioncoinmining",
7442
- "btcdig": "BTCDig",
7443
7692
  "trickysbtcpool": "Tricky's BTC Pool",
7444
- "btcmp": "BTCMP",
7445
- "eobot": "Eobot",
7693
+ "triplemining": "TripleMining",
7694
+ "twentyoneinc": "21 Inc.",
7695
+ "ultimuspool": "ULTIMUSPOOL",
7696
+ "unknown": "Unknown",
7446
7697
  "unomp": "UNOMP",
7447
- "patels": "Patels",
7448
- "gogreenlight": "GoGreenLight",
7449
- "bitcoinindiapool": "BitcoinIndia",
7450
- "ekanembtc": "EkanemBTC",
7451
- "canoe": "CANOE",
7452
- "tiger": "tiger",
7453
- "onem1x": "1M1X",
7454
- "zulupool": "Zulupool",
7455
- "secpool": "SECPOOL",
7456
- "ocean": "OCEAN",
7698
+ "viabtc": "ViaBTC",
7699
+ "waterhole": "Waterhole",
7700
+ "wayicn": "WAYI.CN",
7457
7701
  "whitepool": "WhitePool",
7458
7702
  "wiz": "wiz",
7459
7703
  "wk057": "wk057",
7460
- "futurebitapollosolo": "FutureBit Apollo Solo",
7461
- "carbonnegative": "Carbon Negative",
7462
- "portlandhodl": "Portland.HODL",
7463
- "phoenix": "Phoenix",
7464
- "neopool": "Neopool",
7465
- "maxipool": "MaxiPool",
7466
- "bitfufupool": "BitFuFuPool",
7467
- "gdpool": "GDPool",
7468
- "miningdutch": "Mining-Dutch",
7469
- "publicpool": "Public Pool",
7470
- "miningsquared": "Mining Squared",
7471
- "innopolistech": "Innopolis Tech",
7472
- "btclab": "BTCLab",
7473
- "parasite": "Parasite",
7474
- "redrockpool": "RedRock Pool",
7475
- "est3lar": "Est3lar",
7476
- "braiinssolo": "Braiins Solo",
7477
- "solopool": "SoloPool.com",
7478
- "noderunners": "Noderunners"
7704
+ "yourbtcnet": "Yourbtc.net",
7705
+ "zulupool": "Zulupool"
7479
7706
  });
7480
7707
 
7481
7708
  TERM_NAMES = /** @type {const} */ ({
@@ -8570,6 +8797,7 @@ class BrkClient extends BrkClientBase {
8570
8797
  rawLocktime: createSeriesPattern19(this, 'raw_locktime'),
8571
8798
  baseSize: createSeriesPattern19(this, 'base_size'),
8572
8799
  totalSize: createSeriesPattern19(this, 'total_size'),
8800
+ totalSigopCost: createSeriesPattern19(this, 'total_sigop_cost'),
8573
8801
  isExplicitlyRbf: createSeriesPattern19(this, 'is_explicitly_rbf'),
8574
8802
  firstTxinIndex: createSeriesPattern19(this, 'first_txin_index'),
8575
8803
  firstTxoutIndex: createSeriesPattern19(this, 'first_txout_index'),
@@ -10243,1063 +10471,1114 @@ class BrkClient extends BrkClientBase {
10243
10471
  }
10244
10472
 
10245
10473
  /**
10246
- * Compact OpenAPI specification
10474
+ * Health check
10247
10475
  *
10248
- * Compact OpenAPI specification optimized for LLM consumption. Removes redundant fields while preserving essential API information. Full spec available at `/openapi.json`.
10476
+ * Returns the health status of the API server, including uptime information.
10249
10477
  *
10250
- * Endpoint: `GET /api.json`
10251
- * @param {{ signal?: AbortSignal, onUpdate?: (value: *) => void }} [options]
10252
- * @returns {Promise<*>}
10478
+ * Endpoint: `GET /health`
10479
+ * @param {{ signal?: AbortSignal, onValue?: (value: Health) => void }} [options]
10480
+ * @returns {Promise<Health>}
10253
10481
  */
10254
- async getApi({ signal, onUpdate } = {}) {
10255
- const path = `/api.json`;
10256
- return this.getText(path, { signal, onUpdate });
10482
+ async getHealth({ signal, onValue } = {}) {
10483
+ const path = `/health`;
10484
+ return this.getJson(path, { signal, onValue });
10257
10485
  }
10258
10486
 
10259
10487
  /**
10260
- * Address information
10261
- *
10262
- * Retrieve address information including balance and transaction counts. Supports all standard Bitcoin address types (P2PKH, P2SH, P2WPKH, P2WSH, P2TR).
10263
- *
10264
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-address)*
10488
+ * API version
10265
10489
  *
10266
- * Endpoint: `GET /api/address/{address}`
10490
+ * Returns the current version of the API server
10267
10491
  *
10268
- * @param {Addr} address
10269
- * @param {{ signal?: AbortSignal, onUpdate?: (value: AddrStats) => void }} [options]
10270
- * @returns {Promise<AddrStats>}
10492
+ * Endpoint: `GET /version`
10493
+ * @param {{ signal?: AbortSignal, onValue?: (value: string) => void }} [options]
10494
+ * @returns {Promise<string>}
10271
10495
  */
10272
- async getAddress(address, { signal, onUpdate } = {}) {
10273
- const path = `/api/address/${address}`;
10274
- return this.getJson(path, { signal, onUpdate });
10496
+ async getVersion({ signal, onValue } = {}) {
10497
+ const path = `/version`;
10498
+ return this.getJson(path, { signal, onValue });
10275
10499
  }
10276
10500
 
10277
10501
  /**
10278
- * Address transactions
10279
- *
10280
- * Get transaction history for an address, sorted with newest first. Returns up to 50 mempool transactions plus the first 25 confirmed transactions. Use ?after_txid=<txid> for pagination.
10281
- *
10282
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-address-transactions)*
10502
+ * Sync status
10283
10503
  *
10284
- * Endpoint: `GET /api/address/{address}/txs`
10504
+ * Returns the sync status of the indexer, including indexed height, tip height, blocks behind, and last indexed timestamp.
10285
10505
  *
10286
- * @param {Addr} address
10287
- * @param {Txid=} [after_txid] - Txid to paginate from (return transactions before this one)
10288
- * @param {{ signal?: AbortSignal, onUpdate?: (value: Transaction[]) => void }} [options]
10289
- * @returns {Promise<Transaction[]>}
10506
+ * Endpoint: `GET /api/server/sync`
10507
+ * @param {{ signal?: AbortSignal, onValue?: (value: SyncStatus) => void }} [options]
10508
+ * @returns {Promise<SyncStatus>}
10290
10509
  */
10291
- async getAddressTxs(address, after_txid, { signal, onUpdate } = {}) {
10292
- const params = new URLSearchParams();
10293
- if (after_txid !== undefined) params.set('after_txid', String(after_txid));
10294
- const query = params.toString();
10295
- const path = `/api/address/${address}/txs${query ? '?' + query : ''}`;
10296
- return this.getJson(path, { signal, onUpdate });
10510
+ async getSyncStatus({ signal, onValue } = {}) {
10511
+ const path = `/api/server/sync`;
10512
+ return this.getJson(path, { signal, onValue });
10297
10513
  }
10298
10514
 
10299
10515
  /**
10300
- * Address confirmed transactions
10301
- *
10302
- * Get confirmed transactions for an address, 25 per page. Use ?after_txid=<txid> for pagination.
10303
- *
10304
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-address-transactions-chain)*
10516
+ * Disk usage
10305
10517
  *
10306
- * Endpoint: `GET /api/address/{address}/txs/chain`
10518
+ * Returns the disk space used by BRK and Bitcoin data.
10307
10519
  *
10308
- * @param {Addr} address
10309
- * @param {Txid=} [after_txid] - Txid to paginate from (return transactions before this one)
10310
- * @param {{ signal?: AbortSignal, onUpdate?: (value: Transaction[]) => void }} [options]
10311
- * @returns {Promise<Transaction[]>}
10520
+ * Endpoint: `GET /api/server/disk`
10521
+ * @param {{ signal?: AbortSignal, onValue?: (value: DiskUsage) => void }} [options]
10522
+ * @returns {Promise<DiskUsage>}
10312
10523
  */
10313
- async getAddressConfirmedTxs(address, after_txid, { signal, onUpdate } = {}) {
10314
- const params = new URLSearchParams();
10315
- if (after_txid !== undefined) params.set('after_txid', String(after_txid));
10316
- const query = params.toString();
10317
- const path = `/api/address/${address}/txs/chain${query ? '?' + query : ''}`;
10318
- return this.getJson(path, { signal, onUpdate });
10524
+ async getDiskUsage({ signal, onValue } = {}) {
10525
+ const path = `/api/server/disk`;
10526
+ return this.getJson(path, { signal, onValue });
10319
10527
  }
10320
10528
 
10321
10529
  /**
10322
- * Address mempool transactions
10323
- *
10324
- * Get unconfirmed transaction IDs for an address from the mempool (up to 50).
10325
- *
10326
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-address-transactions-mempool)*
10530
+ * Series catalog
10327
10531
  *
10328
- * Endpoint: `GET /api/address/{address}/txs/mempool`
10532
+ * Returns the complete hierarchical catalog of available series organized as a tree structure. Series are grouped by categories and subcategories.
10329
10533
  *
10330
- * @param {Addr} address
10331
- * @param {{ signal?: AbortSignal, onUpdate?: (value: Txid[]) => void }} [options]
10332
- * @returns {Promise<Txid[]>}
10534
+ * Endpoint: `GET /api/series`
10535
+ * @param {{ signal?: AbortSignal, onValue?: (value: TreeNode) => void }} [options]
10536
+ * @returns {Promise<TreeNode>}
10333
10537
  */
10334
- async getAddressMempoolTxs(address, { signal, onUpdate } = {}) {
10335
- const path = `/api/address/${address}/txs/mempool`;
10336
- return this.getJson(path, { signal, onUpdate });
10538
+ async getSeriesTree({ signal, onValue } = {}) {
10539
+ const path = `/api/series`;
10540
+ return this.getJson(path, { signal, onValue });
10337
10541
  }
10338
10542
 
10339
10543
  /**
10340
- * Address UTXOs
10341
- *
10342
- * Get unspent transaction outputs (UTXOs) for an address. Returns txid, vout, value, and confirmation status for each UTXO.
10343
- *
10344
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-address-utxo)*
10544
+ * Series count
10345
10545
  *
10346
- * Endpoint: `GET /api/address/{address}/utxo`
10546
+ * Returns the number of series available per index type.
10347
10547
  *
10348
- * @param {Addr} address
10349
- * @param {{ signal?: AbortSignal, onUpdate?: (value: Utxo[]) => void }} [options]
10350
- * @returns {Promise<Utxo[]>}
10548
+ * Endpoint: `GET /api/series/count`
10549
+ * @param {{ signal?: AbortSignal, onValue?: (value: SeriesCount[]) => void }} [options]
10550
+ * @returns {Promise<SeriesCount[]>}
10351
10551
  */
10352
- async getAddressUtxos(address, { signal, onUpdate } = {}) {
10353
- const path = `/api/address/${address}/utxo`;
10354
- return this.getJson(path, { signal, onUpdate });
10552
+ async getSeriesCount({ signal, onValue } = {}) {
10553
+ const path = `/api/series/count`;
10554
+ return this.getJson(path, { signal, onValue });
10355
10555
  }
10356
10556
 
10357
10557
  /**
10358
- * Block hash by height
10359
- *
10360
- * Retrieve the block hash at a given height. Returns the hash as plain text.
10361
- *
10362
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-height)*
10558
+ * List available indexes
10363
10559
  *
10364
- * Endpoint: `GET /api/block-height/{height}`
10560
+ * Returns all available indexes with their accepted query aliases. Use any alias when querying series.
10365
10561
  *
10366
- * @param {Height} height
10367
- * @param {{ signal?: AbortSignal, onUpdate?: (value: *) => void }} [options]
10368
- * @returns {Promise<*>}
10562
+ * Endpoint: `GET /api/series/indexes`
10563
+ * @param {{ signal?: AbortSignal, onValue?: (value: IndexInfo[]) => void }} [options]
10564
+ * @returns {Promise<IndexInfo[]>}
10369
10565
  */
10370
- async getBlockByHeight(height, { signal, onUpdate } = {}) {
10371
- const path = `/api/block-height/${height}`;
10372
- return this.getText(path, { signal, onUpdate });
10566
+ async getIndexes({ signal, onValue } = {}) {
10567
+ const path = `/api/series/indexes`;
10568
+ return this.getJson(path, { signal, onValue });
10373
10569
  }
10374
10570
 
10375
10571
  /**
10376
- * Block information
10377
- *
10378
- * Retrieve block information by block hash. Returns block metadata including height, timestamp, difficulty, size, weight, and transaction count.
10572
+ * Series list
10379
10573
  *
10380
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block)*
10574
+ * Paginated flat list of all available series names. Use `page` query param for pagination.
10381
10575
  *
10382
- * Endpoint: `GET /api/block/{hash}`
10576
+ * Endpoint: `GET /api/series/list`
10383
10577
  *
10384
- * @param {BlockHash} hash
10385
- * @param {{ signal?: AbortSignal, onUpdate?: (value: BlockInfo) => void }} [options]
10386
- * @returns {Promise<BlockInfo>}
10578
+ * @param {number=} [page] - Pagination index
10579
+ * @param {number=} [per_page] - Results per page (default: 1000, max: 1000)
10580
+ * @param {{ signal?: AbortSignal, onValue?: (value: PaginatedSeries) => void }} [options]
10581
+ * @returns {Promise<PaginatedSeries>}
10387
10582
  */
10388
- async getBlock(hash, { signal, onUpdate } = {}) {
10389
- const path = `/api/block/${hash}`;
10390
- return this.getJson(path, { signal, onUpdate });
10583
+ async listSeries(page, per_page, { signal, onValue } = {}) {
10584
+ const params = new URLSearchParams();
10585
+ if (page !== undefined) params.set('page', String(page));
10586
+ if (per_page !== undefined) params.set('per_page', String(per_page));
10587
+ const query = params.toString();
10588
+ const path = `/api/series/list${query ? '?' + query : ''}`;
10589
+ return this.getJson(path, { signal, onValue });
10391
10590
  }
10392
10591
 
10393
10592
  /**
10394
- * Block header
10395
- *
10396
- * Returns the hex-encoded 80-byte block header.
10593
+ * Search series
10397
10594
  *
10398
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-header)*
10595
+ * Fuzzy search for series by name. Supports partial matches and typos.
10399
10596
  *
10400
- * Endpoint: `GET /api/block/{hash}/header`
10597
+ * Endpoint: `GET /api/series/search`
10401
10598
  *
10402
- * @param {BlockHash} hash
10403
- * @param {{ signal?: AbortSignal, onUpdate?: (value: *) => void }} [options]
10404
- * @returns {Promise<*>}
10599
+ * @param {SeriesName} q - Search query string
10600
+ * @param {Limit=} [limit] - Maximum number of results
10601
+ * @param {{ signal?: AbortSignal, onValue?: (value: string[]) => void }} [options]
10602
+ * @returns {Promise<string[]>}
10405
10603
  */
10406
- async getBlockHeader(hash, { signal, onUpdate } = {}) {
10407
- const path = `/api/block/${hash}/header`;
10408
- return this.getText(path, { signal, onUpdate });
10604
+ async searchSeries(q, limit, { signal, onValue } = {}) {
10605
+ const params = new URLSearchParams();
10606
+ params.set('q', String(q));
10607
+ if (limit !== undefined) params.set('limit', String(limit));
10608
+ const query = params.toString();
10609
+ const path = `/api/series/search${query ? '?' + query : ''}`;
10610
+ return this.getJson(path, { signal, onValue });
10409
10611
  }
10410
10612
 
10411
10613
  /**
10412
- * Raw block
10413
- *
10414
- * Returns the raw block data in binary format.
10614
+ * Get series info
10415
10615
  *
10416
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-raw)*
10616
+ * Returns the supported indexes and value type for the specified series.
10417
10617
  *
10418
- * Endpoint: `GET /api/block/{hash}/raw`
10618
+ * Endpoint: `GET /api/series/{series}`
10419
10619
  *
10420
- * @param {BlockHash} hash
10421
- * @param {{ signal?: AbortSignal, onUpdate?: (value: *) => void }} [options]
10422
- * @returns {Promise<*>}
10620
+ * @param {SeriesName} series
10621
+ * @param {{ signal?: AbortSignal, onValue?: (value: SeriesInfo) => void }} [options]
10622
+ * @returns {Promise<SeriesInfo>}
10423
10623
  */
10424
- async getBlockRaw(hash, { signal, onUpdate } = {}) {
10425
- const path = `/api/block/${hash}/raw`;
10426
- return this.getText(path, { signal, onUpdate });
10624
+ async getSeriesInfo(series, { signal, onValue } = {}) {
10625
+ const path = `/api/series/${series}`;
10626
+ return this.getJson(path, { signal, onValue });
10427
10627
  }
10428
10628
 
10429
10629
  /**
10430
- * Block status
10431
- *
10432
- * Retrieve the status of a block. Returns whether the block is in the best chain and, if so, its height and the hash of the next block.
10630
+ * Get series data
10433
10631
  *
10434
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-status)*
10632
+ * Fetch data for a specific series at the given index. Use query parameters to filter by date range and format (json/csv).
10435
10633
  *
10436
- * Endpoint: `GET /api/block/{hash}/status`
10634
+ * Endpoint: `GET /api/series/{series}/{index}`
10437
10635
  *
10438
- * @param {BlockHash} hash
10439
- * @param {{ signal?: AbortSignal, onUpdate?: (value: BlockStatus) => void }} [options]
10440
- * @returns {Promise<BlockStatus>}
10636
+ * @param {SeriesName} series - Series name
10637
+ * @param {Index} index - Aggregation index
10638
+ * @param {RangeIndex=} [start] - Inclusive start: integer index, date (YYYY-MM-DD), or timestamp (ISO 8601). Negative integers count from end. Aliases: `from`, `f`, `s`
10639
+ * @param {RangeIndex=} [end] - Exclusive end: integer index, date (YYYY-MM-DD), or timestamp (ISO 8601). Negative integers count from end. Aliases: `to`, `t`, `e`
10640
+ * @param {Limit=} [limit] - Maximum number of values to return (ignored if `end` is set). Aliases: `count`, `c`, `l`
10641
+ * @param {Format=} [format] - Format of the output
10642
+ * @param {{ signal?: AbortSignal, onValue?: (value: AnySeriesData | string) => void }} [options]
10643
+ * @returns {Promise<AnySeriesData | string>}
10441
10644
  */
10442
- async getBlockStatus(hash, { signal, onUpdate } = {}) {
10443
- const path = `/api/block/${hash}/status`;
10444
- return this.getJson(path, { signal, onUpdate });
10645
+ async getSeries(series, index, start, end, limit, format, { signal, onValue } = {}) {
10646
+ const params = new URLSearchParams();
10647
+ if (start !== undefined) params.set('start', String(start));
10648
+ if (end !== undefined) params.set('end', String(end));
10649
+ if (limit !== undefined) params.set('limit', String(limit));
10650
+ if (format !== undefined) params.set('format', String(format));
10651
+ const query = params.toString();
10652
+ const path = `/api/series/${series}/${index}${query ? '?' + query : ''}`;
10653
+ if (format === 'csv') return this.getText(path, { signal, onValue });
10654
+ return this.getJson(path, { signal, onValue });
10445
10655
  }
10446
10656
 
10447
10657
  /**
10448
- * Transaction ID at index
10658
+ * Get raw series data
10449
10659
  *
10450
- * Retrieve a single transaction ID at a specific index within a block. Returns plain text txid.
10660
+ * Returns just the data array without the SeriesData wrapper. Supports the same range and format parameters as the standard endpoint.
10451
10661
  *
10452
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-transaction-id)*
10662
+ * Endpoint: `GET /api/series/{series}/{index}/data`
10453
10663
  *
10454
- * Endpoint: `GET /api/block/{hash}/txid/{index}`
10664
+ * @param {SeriesName} series - Series name
10665
+ * @param {Index} index - Aggregation index
10666
+ * @param {RangeIndex=} [start] - Inclusive start: integer index, date (YYYY-MM-DD), or timestamp (ISO 8601). Negative integers count from end. Aliases: `from`, `f`, `s`
10667
+ * @param {RangeIndex=} [end] - Exclusive end: integer index, date (YYYY-MM-DD), or timestamp (ISO 8601). Negative integers count from end. Aliases: `to`, `t`, `e`
10668
+ * @param {Limit=} [limit] - Maximum number of values to return (ignored if `end` is set). Aliases: `count`, `c`, `l`
10669
+ * @param {Format=} [format] - Format of the output
10670
+ * @param {{ signal?: AbortSignal, onValue?: (value: boolean[] | string) => void }} [options]
10671
+ * @returns {Promise<boolean[] | string>}
10672
+ */
10673
+ async getSeriesData(series, index, start, end, limit, format, { signal, onValue } = {}) {
10674
+ const params = new URLSearchParams();
10675
+ if (start !== undefined) params.set('start', String(start));
10676
+ if (end !== undefined) params.set('end', String(end));
10677
+ if (limit !== undefined) params.set('limit', String(limit));
10678
+ if (format !== undefined) params.set('format', String(format));
10679
+ const query = params.toString();
10680
+ const path = `/api/series/${series}/${index}/data${query ? '?' + query : ''}`;
10681
+ if (format === 'csv') return this.getText(path, { signal, onValue });
10682
+ return this.getJson(path, { signal, onValue });
10683
+ }
10684
+
10685
+ /**
10686
+ * Get latest series value
10455
10687
  *
10456
- * @param {BlockHash} hash - Bitcoin block hash
10457
- * @param {TxIndex} index - Transaction index within the block (0-based)
10458
- * @param {{ signal?: AbortSignal, onUpdate?: (value: *) => void }} [options]
10688
+ * Returns the single most recent value for a series, unwrapped (not inside a SeriesData object).
10689
+ *
10690
+ * Endpoint: `GET /api/series/{series}/{index}/latest`
10691
+ *
10692
+ * @param {SeriesName} series - Series name
10693
+ * @param {Index} index - Aggregation index
10694
+ * @param {{ signal?: AbortSignal, onValue?: (value: *) => void }} [options]
10459
10695
  * @returns {Promise<*>}
10460
10696
  */
10461
- async getBlockTxid(hash, index, { signal, onUpdate } = {}) {
10462
- const path = `/api/block/${hash}/txid/${index}`;
10463
- return this.getText(path, { signal, onUpdate });
10697
+ async getSeriesLatest(series, index, { signal, onValue } = {}) {
10698
+ const path = `/api/series/${series}/${index}/latest`;
10699
+ return this.getJson(path, { signal, onValue });
10464
10700
  }
10465
10701
 
10466
10702
  /**
10467
- * Block transaction IDs
10468
- *
10469
- * Retrieve all transaction IDs in a block. Returns an array of txids in block order.
10703
+ * Get series data length
10470
10704
  *
10471
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-transaction-ids)*
10705
+ * Returns the total number of data points for a series at the given index.
10472
10706
  *
10473
- * Endpoint: `GET /api/block/{hash}/txids`
10707
+ * Endpoint: `GET /api/series/{series}/{index}/len`
10474
10708
  *
10475
- * @param {BlockHash} hash
10476
- * @param {{ signal?: AbortSignal, onUpdate?: (value: Txid[]) => void }} [options]
10477
- * @returns {Promise<Txid[]>}
10709
+ * @param {SeriesName} series - Series name
10710
+ * @param {Index} index - Aggregation index
10711
+ * @param {{ signal?: AbortSignal, onValue?: (value: number) => void }} [options]
10712
+ * @returns {Promise<number>}
10478
10713
  */
10479
- async getBlockTxids(hash, { signal, onUpdate } = {}) {
10480
- const path = `/api/block/${hash}/txids`;
10481
- return this.getJson(path, { signal, onUpdate });
10714
+ async getSeriesLen(series, index, { signal, onValue } = {}) {
10715
+ const path = `/api/series/${series}/${index}/len`;
10716
+ return this.getJson(path, { signal, onValue });
10482
10717
  }
10483
10718
 
10484
10719
  /**
10485
- * Block transactions
10486
- *
10487
- * Retrieve transactions in a block by block hash. Returns up to 25 transactions starting from index 0.
10720
+ * Get series version
10488
10721
  *
10489
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-transactions)*
10722
+ * Returns the current version of a series. Changes when the series data is updated.
10490
10723
  *
10491
- * Endpoint: `GET /api/block/{hash}/txs`
10724
+ * Endpoint: `GET /api/series/{series}/{index}/version`
10492
10725
  *
10493
- * @param {BlockHash} hash
10494
- * @param {{ signal?: AbortSignal, onUpdate?: (value: Transaction[]) => void }} [options]
10495
- * @returns {Promise<Transaction[]>}
10726
+ * @param {SeriesName} series - Series name
10727
+ * @param {Index} index - Aggregation index
10728
+ * @param {{ signal?: AbortSignal, onValue?: (value: Version) => void }} [options]
10729
+ * @returns {Promise<Version>}
10496
10730
  */
10497
- async getBlockTxs(hash, { signal, onUpdate } = {}) {
10498
- const path = `/api/block/${hash}/txs`;
10499
- return this.getJson(path, { signal, onUpdate });
10731
+ async getSeriesVersion(series, index, { signal, onValue } = {}) {
10732
+ const path = `/api/series/${series}/${index}/version`;
10733
+ return this.getJson(path, { signal, onValue });
10500
10734
  }
10501
10735
 
10502
10736
  /**
10503
- * Block transactions (paginated)
10737
+ * Bulk series data
10504
10738
  *
10505
- * Retrieve transactions in a block by block hash, starting from the specified index. Returns up to 25 transactions at a time.
10739
+ * Fetch multiple series in a single request. Supports filtering by index and date range. Returns an array of SeriesData objects. For a single series, use `get_series` instead.
10506
10740
  *
10507
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-transactions)*
10741
+ * Endpoint: `GET /api/series/bulk`
10508
10742
  *
10509
- * Endpoint: `GET /api/block/{hash}/txs/{start_index}`
10743
+ * @param {SeriesList} series - Requested series
10744
+ * @param {Index} index - Index to query
10745
+ * @param {RangeIndex=} [start] - Inclusive start: integer index, date (YYYY-MM-DD), or timestamp (ISO 8601). Negative integers count from end. Aliases: `from`, `f`, `s`
10746
+ * @param {RangeIndex=} [end] - Exclusive end: integer index, date (YYYY-MM-DD), or timestamp (ISO 8601). Negative integers count from end. Aliases: `to`, `t`, `e`
10747
+ * @param {Limit=} [limit] - Maximum number of values to return (ignored if `end` is set). Aliases: `count`, `c`, `l`
10748
+ * @param {Format=} [format] - Format of the output
10749
+ * @param {{ signal?: AbortSignal, onValue?: (value: AnySeriesData[] | string) => void }} [options]
10750
+ * @returns {Promise<AnySeriesData[] | string>}
10751
+ */
10752
+ async getSeriesBulk(series, index, start, end, limit, format, { signal, onValue } = {}) {
10753
+ const params = new URLSearchParams();
10754
+ params.set('series', String(series));
10755
+ params.set('index', String(index));
10756
+ if (start !== undefined) params.set('start', String(start));
10757
+ if (end !== undefined) params.set('end', String(end));
10758
+ if (limit !== undefined) params.set('limit', String(limit));
10759
+ if (format !== undefined) params.set('format', String(format));
10760
+ const query = params.toString();
10761
+ const path = `/api/series/bulk${query ? '?' + query : ''}`;
10762
+ if (format === 'csv') return this.getText(path, { signal, onValue });
10763
+ return this.getJson(path, { signal, onValue });
10764
+ }
10765
+
10766
+ /**
10767
+ * Available URPD cohorts
10510
10768
  *
10511
- * @param {BlockHash} hash - Bitcoin block hash
10512
- * @param {TxIndex} start_index - Starting transaction index within the block (0-based)
10513
- * @param {{ signal?: AbortSignal, onUpdate?: (value: Transaction[]) => void }} [options]
10514
- * @returns {Promise<Transaction[]>}
10769
+ * Cohorts for which URPD data is available. Returns names like `all`, `sth`, `lth`, `utxos_under_1h_old`.
10770
+ *
10771
+ * Endpoint: `GET /api/urpd`
10772
+ * @param {{ signal?: AbortSignal, onValue?: (value: Cohort[]) => void }} [options]
10773
+ * @returns {Promise<Cohort[]>}
10515
10774
  */
10516
- async getBlockTxsFromIndex(hash, start_index, { signal, onUpdate } = {}) {
10517
- const path = `/api/block/${hash}/txs/${start_index}`;
10518
- return this.getJson(path, { signal, onUpdate });
10775
+ async listUrpdCohorts({ signal, onValue } = {}) {
10776
+ const path = `/api/urpd`;
10777
+ return this.getJson(path, { signal, onValue });
10519
10778
  }
10520
10779
 
10521
10780
  /**
10522
- * Recent blocks
10781
+ * Available URPD dates
10523
10782
  *
10524
- * Retrieve the last 10 blocks. Returns block metadata for each block.
10783
+ * Dates for which a URPD snapshot is available for the cohort. One entry per UTC day, sorted ascending.
10525
10784
  *
10526
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-blocks)*
10785
+ * Endpoint: `GET /api/urpd/{cohort}/dates`
10527
10786
  *
10528
- * Endpoint: `GET /api/blocks`
10529
- * @param {{ signal?: AbortSignal, onUpdate?: (value: BlockInfo[]) => void }} [options]
10530
- * @returns {Promise<BlockInfo[]>}
10787
+ * @param {Cohort} cohort
10788
+ * @param {{ signal?: AbortSignal, onValue?: (value: Date[]) => void }} [options]
10789
+ * @returns {Promise<Date[]>}
10531
10790
  */
10532
- async getBlocks({ signal, onUpdate } = {}) {
10533
- const path = `/api/blocks`;
10534
- return this.getJson(path, { signal, onUpdate });
10791
+ async listUrpdDates(cohort, { signal, onValue } = {}) {
10792
+ const path = `/api/urpd/${cohort}/dates`;
10793
+ return this.getJson(path, { signal, onValue });
10535
10794
  }
10536
10795
 
10537
10796
  /**
10538
- * Block tip hash
10797
+ * Latest URPD
10539
10798
  *
10540
- * Returns the hash of the last block.
10799
+ * URPD for the most recent available date in the cohort. The response's `date` field echoes which date was served.
10541
10800
  *
10542
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-tip-hash)*
10801
+ * See the URPD tag description for the response shape and `agg` options.
10543
10802
  *
10544
- * Endpoint: `GET /api/blocks/tip/hash`
10545
- * @param {{ signal?: AbortSignal, onUpdate?: (value: *) => void }} [options]
10546
- * @returns {Promise<*>}
10803
+ * Endpoint: `GET /api/urpd/{cohort}`
10804
+ *
10805
+ * @param {Cohort} cohort
10806
+ * @param {UrpdAggregation=} [agg] - Aggregation strategy. Default: raw (no aggregation). Accepts `bucket` as alias.
10807
+ * @param {{ signal?: AbortSignal, onValue?: (value: Urpd) => void }} [options]
10808
+ * @returns {Promise<Urpd>}
10547
10809
  */
10548
- async getBlockTipHash({ signal, onUpdate } = {}) {
10549
- const path = `/api/blocks/tip/hash`;
10550
- return this.getText(path, { signal, onUpdate });
10810
+ async getUrpd(cohort, agg, { signal, onValue } = {}) {
10811
+ const params = new URLSearchParams();
10812
+ if (agg !== undefined) params.set('agg', String(agg));
10813
+ const query = params.toString();
10814
+ const path = `/api/urpd/${cohort}${query ? '?' + query : ''}`;
10815
+ return this.getJson(path, { signal, onValue });
10551
10816
  }
10552
10817
 
10553
10818
  /**
10554
- * Block tip height
10819
+ * URPD at date
10555
10820
  *
10556
- * Returns the height of the last block.
10821
+ * URPD for a (cohort, date) pair. Returns `{ cohort, date, aggregation, close, total_supply, buckets }` where each bucket is `{ price_floor, supply, realized_cap, unrealized_pnl }`.
10557
10822
  *
10558
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-tip-height)*
10823
+ * See the URPD tag description for unit conventions and `agg` options.
10559
10824
  *
10560
- * Endpoint: `GET /api/blocks/tip/height`
10561
- * @param {{ signal?: AbortSignal, onUpdate?: (value: *) => void }} [options]
10562
- * @returns {Promise<*>}
10825
+ * Endpoint: `GET /api/urpd/{cohort}/{date}`
10826
+ *
10827
+ * @param {Cohort} cohort
10828
+ * @param {string} date
10829
+ * @param {UrpdAggregation=} [agg] - Aggregation strategy. Default: raw (no aggregation). Accepts `bucket` as alias.
10830
+ * @param {{ signal?: AbortSignal, onValue?: (value: Urpd) => void }} [options]
10831
+ * @returns {Promise<Urpd>}
10563
10832
  */
10564
- async getBlockTipHeight({ signal, onUpdate } = {}) {
10565
- const path = `/api/blocks/tip/height`;
10566
- return this.getText(path, { signal, onUpdate });
10833
+ async getUrpdAt(cohort, date, agg, { signal, onValue } = {}) {
10834
+ const params = new URLSearchParams();
10835
+ if (agg !== undefined) params.set('agg', String(agg));
10836
+ const query = params.toString();
10837
+ const path = `/api/urpd/${cohort}/${date}${query ? '?' + query : ''}`;
10838
+ return this.getJson(path, { signal, onValue });
10567
10839
  }
10568
10840
 
10569
10841
  /**
10570
- * Blocks from height
10571
- *
10572
- * Retrieve up to 10 blocks going backwards from the given height. For example, height=100 returns blocks 100, 99, 98, ..., 91. Height=0 returns only block 0.
10842
+ * Difficulty adjustment
10573
10843
  *
10574
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-blocks)*
10844
+ * Get current difficulty adjustment progress and estimates.
10575
10845
  *
10576
- * Endpoint: `GET /api/blocks/{height}`
10846
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-difficulty-adjustment)*
10577
10847
  *
10578
- * @param {Height} height
10579
- * @param {{ signal?: AbortSignal, onUpdate?: (value: BlockInfo[]) => void }} [options]
10580
- * @returns {Promise<BlockInfo[]>}
10848
+ * Endpoint: `GET /api/v1/difficulty-adjustment`
10849
+ * @param {{ signal?: AbortSignal, onValue?: (value: DifficultyAdjustment) => void }} [options]
10850
+ * @returns {Promise<DifficultyAdjustment>}
10581
10851
  */
10582
- async getBlocksFromHeight(height, { signal, onUpdate } = {}) {
10583
- const path = `/api/blocks/${height}`;
10584
- return this.getJson(path, { signal, onUpdate });
10852
+ async getDifficultyAdjustment({ signal, onValue } = {}) {
10853
+ const path = `/api/v1/difficulty-adjustment`;
10854
+ return this.getJson(path, { signal, onValue });
10585
10855
  }
10586
10856
 
10587
10857
  /**
10588
- * Mempool statistics
10858
+ * Current BTC price
10589
10859
  *
10590
- * Get current mempool statistics including transaction count, total vsize, total fees, and fee histogram.
10860
+ * Returns bitcoin latest price (on-chain derived, USD only).
10591
10861
  *
10592
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-mempool)*
10862
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-price)*
10593
10863
  *
10594
- * Endpoint: `GET /api/mempool`
10595
- * @param {{ signal?: AbortSignal, onUpdate?: (value: MempoolInfo) => void }} [options]
10596
- * @returns {Promise<MempoolInfo>}
10864
+ * Endpoint: `GET /api/v1/prices`
10865
+ * @param {{ signal?: AbortSignal, onValue?: (value: Prices) => void }} [options]
10866
+ * @returns {Promise<Prices>}
10597
10867
  */
10598
- async getMempool({ signal, onUpdate } = {}) {
10599
- const path = `/api/mempool`;
10600
- return this.getJson(path, { signal, onUpdate });
10868
+ async getPrices({ signal, onValue } = {}) {
10869
+ const path = `/api/v1/prices`;
10870
+ return this.getJson(path, { signal, onValue });
10601
10871
  }
10602
10872
 
10603
10873
  /**
10604
- * Live BTC/USD price
10874
+ * Historical price
10605
10875
  *
10606
- * Returns the current BTC/USD price in dollars, derived from on-chain round-dollar output patterns in the last 12 blocks plus mempool.
10876
+ * Get historical BTC/USD price. Optionally specify a UNIX timestamp to get the price at that time.
10607
10877
  *
10608
- * Endpoint: `GET /api/mempool/price`
10609
- * @param {{ signal?: AbortSignal, onUpdate?: (value: Dollars) => void }} [options]
10610
- * @returns {Promise<Dollars>}
10878
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-historical-price)*
10879
+ *
10880
+ * Endpoint: `GET /api/v1/historical-price`
10881
+ *
10882
+ * @param {Timestamp=} [timestamp]
10883
+ * @param {{ signal?: AbortSignal, onValue?: (value: HistoricalPrice) => void }} [options]
10884
+ * @returns {Promise<HistoricalPrice>}
10611
10885
  */
10612
- async getLivePrice({ signal, onUpdate } = {}) {
10613
- const path = `/api/mempool/price`;
10614
- return this.getJson(path, { signal, onUpdate });
10886
+ async getHistoricalPrice(timestamp, { signal, onValue } = {}) {
10887
+ const params = new URLSearchParams();
10888
+ if (timestamp !== undefined) params.set('timestamp', String(timestamp));
10889
+ const query = params.toString();
10890
+ const path = `/api/v1/historical-price${query ? '?' + query : ''}`;
10891
+ return this.getJson(path, { signal, onValue });
10615
10892
  }
10616
10893
 
10617
10894
  /**
10618
- * Recent mempool transactions
10895
+ * Address information
10619
10896
  *
10620
- * Get the last 10 transactions to enter the mempool.
10897
+ * Retrieve address information including balance and transaction counts. Supports all standard Bitcoin address types (P2PKH, P2SH, P2WPKH, P2WSH, P2TR).
10621
10898
  *
10622
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-mempool-recent)*
10899
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-address)*
10623
10900
  *
10624
- * Endpoint: `GET /api/mempool/recent`
10625
- * @param {{ signal?: AbortSignal, onUpdate?: (value: MempoolRecentTx[]) => void }} [options]
10626
- * @returns {Promise<MempoolRecentTx[]>}
10901
+ * Endpoint: `GET /api/address/{address}`
10902
+ *
10903
+ * @param {Addr} address
10904
+ * @param {{ signal?: AbortSignal, onValue?: (value: AddrStats) => void }} [options]
10905
+ * @returns {Promise<AddrStats>}
10627
10906
  */
10628
- async getMempoolRecent({ signal, onUpdate } = {}) {
10629
- const path = `/api/mempool/recent`;
10630
- return this.getJson(path, { signal, onUpdate });
10907
+ async getAddress(address, { signal, onValue } = {}) {
10908
+ const path = `/api/address/${address}`;
10909
+ return this.getJson(path, { signal, onValue });
10631
10910
  }
10632
10911
 
10633
10912
  /**
10634
- * Mempool transaction IDs
10913
+ * Address transactions
10635
10914
  *
10636
- * Get all transaction IDs currently in the mempool.
10915
+ * Get transaction history for an address, sorted with newest first. Returns up to 50 entries: mempool transactions first, then confirmed transactions filling the remainder. To paginate further confirmed transactions, use `/address/{address}/txs/chain/{last_seen_txid}`.
10637
10916
  *
10638
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-mempool-transaction-ids)*
10917
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-address-transactions)*
10639
10918
  *
10640
- * Endpoint: `GET /api/mempool/txids`
10641
- * @param {{ signal?: AbortSignal, onUpdate?: (value: Txid[]) => void }} [options]
10642
- * @returns {Promise<Txid[]>}
10919
+ * Endpoint: `GET /api/address/{address}/txs`
10920
+ *
10921
+ * @param {Addr} address
10922
+ * @param {{ signal?: AbortSignal, onValue?: (value: Transaction[]) => void }} [options]
10923
+ * @returns {Promise<Transaction[]>}
10643
10924
  */
10644
- async getMempoolTxids({ signal, onUpdate } = {}) {
10645
- const path = `/api/mempool/txids`;
10646
- return this.getJson(path, { signal, onUpdate });
10925
+ async getAddressTxs(address, { signal, onValue } = {}) {
10926
+ const path = `/api/address/${address}/txs`;
10927
+ return this.getJson(path, { signal, onValue });
10647
10928
  }
10648
10929
 
10649
10930
  /**
10650
- * Series catalog
10931
+ * Address confirmed transactions
10651
10932
  *
10652
- * Returns the complete hierarchical catalog of available series organized as a tree structure. Series are grouped by categories and subcategories.
10933
+ * Get the first 25 confirmed transactions for an address. For pagination, use the path-style form `/txs/chain/{last_seen_txid}`.
10653
10934
  *
10654
- * Endpoint: `GET /api/series`
10655
- * @param {{ signal?: AbortSignal, onUpdate?: (value: TreeNode) => void }} [options]
10656
- * @returns {Promise<TreeNode>}
10935
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-address-transactions-chain)*
10936
+ *
10937
+ * Endpoint: `GET /api/address/{address}/txs/chain`
10938
+ *
10939
+ * @param {Addr} address
10940
+ * @param {{ signal?: AbortSignal, onValue?: (value: Transaction[]) => void }} [options]
10941
+ * @returns {Promise<Transaction[]>}
10657
10942
  */
10658
- async getSeriesTree({ signal, onUpdate } = {}) {
10659
- const path = `/api/series`;
10660
- return this.getJson(path, { signal, onUpdate });
10943
+ async getAddressConfirmedTxs(address, { signal, onValue } = {}) {
10944
+ const path = `/api/address/${address}/txs/chain`;
10945
+ return this.getJson(path, { signal, onValue });
10661
10946
  }
10662
10947
 
10663
10948
  /**
10664
- * Bulk series data
10949
+ * Address confirmed transactions (paginated)
10665
10950
  *
10666
- * Fetch multiple series in a single request. Supports filtering by index and date range. Returns an array of SeriesData objects. For a single series, use `get_series` instead.
10951
+ * Get the next 25 confirmed transactions strictly older than `after_txid` (Esplora-canonical pagination form, matches mempool.space).
10667
10952
  *
10668
- * Endpoint: `GET /api/series/bulk`
10953
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-address-transactions-chain)*
10669
10954
  *
10670
- * @param {SeriesList} [series] - Requested series
10671
- * @param {Index} [index] - Index to query
10672
- * @param {RangeIndex=} [start] - Inclusive start: integer index, date (YYYY-MM-DD), or timestamp (ISO 8601). Negative integers count from end. Aliases: `from`, `f`, `s`
10673
- * @param {RangeIndex=} [end] - Exclusive end: integer index, date (YYYY-MM-DD), or timestamp (ISO 8601). Negative integers count from end. Aliases: `to`, `t`, `e`
10674
- * @param {Limit=} [limit] - Maximum number of values to return (ignored if `end` is set). Aliases: `count`, `c`, `l`
10675
- * @param {Format=} [format] - Format of the output
10676
- * @param {{ signal?: AbortSignal, onUpdate?: (value: AnySeriesData[] | string) => void }} [options]
10677
- * @returns {Promise<AnySeriesData[] | string>}
10955
+ * Endpoint: `GET /api/address/{address}/txs/chain/{after_txid}`
10956
+ *
10957
+ * @param {Addr} address
10958
+ * @param {Txid} after_txid - Last txid from the previous page (return transactions strictly older than this)
10959
+ * @param {{ signal?: AbortSignal, onValue?: (value: Transaction[]) => void }} [options]
10960
+ * @returns {Promise<Transaction[]>}
10678
10961
  */
10679
- async getSeriesBulk(series, index, start, end, limit, format, { signal, onUpdate } = {}) {
10680
- const params = new URLSearchParams();
10681
- params.set('series', String(series));
10682
- params.set('index', String(index));
10683
- if (start !== undefined) params.set('start', String(start));
10684
- if (end !== undefined) params.set('end', String(end));
10685
- if (limit !== undefined) params.set('limit', String(limit));
10686
- if (format !== undefined) params.set('format', String(format));
10687
- const query = params.toString();
10688
- const path = `/api/series/bulk${query ? '?' + query : ''}`;
10689
- if (format === 'csv') return this.getText(path, { signal, onUpdate });
10690
- return this.getJson(path, { signal, onUpdate });
10962
+ async getAddressConfirmedTxsAfter(address, after_txid, { signal, onValue } = {}) {
10963
+ const path = `/api/address/${address}/txs/chain/${after_txid}`;
10964
+ return this.getJson(path, { signal, onValue });
10691
10965
  }
10692
10966
 
10693
10967
  /**
10694
- * Series count
10968
+ * Address mempool transactions
10695
10969
  *
10696
- * Returns the number of series available per index type.
10970
+ * Get unconfirmed transactions for an address from the mempool, newest first (up to 50).
10697
10971
  *
10698
- * Endpoint: `GET /api/series/count`
10699
- * @param {{ signal?: AbortSignal, onUpdate?: (value: SeriesCount[]) => void }} [options]
10700
- * @returns {Promise<SeriesCount[]>}
10972
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-address-transactions-mempool)*
10973
+ *
10974
+ * Endpoint: `GET /api/address/{address}/txs/mempool`
10975
+ *
10976
+ * @param {Addr} address
10977
+ * @param {{ signal?: AbortSignal, onValue?: (value: Transaction[]) => void }} [options]
10978
+ * @returns {Promise<Transaction[]>}
10701
10979
  */
10702
- async getSeriesCount({ signal, onUpdate } = {}) {
10703
- const path = `/api/series/count`;
10704
- return this.getJson(path, { signal, onUpdate });
10980
+ async getAddressMempoolTxs(address, { signal, onValue } = {}) {
10981
+ const path = `/api/address/${address}/txs/mempool`;
10982
+ return this.getJson(path, { signal, onValue });
10705
10983
  }
10706
10984
 
10707
10985
  /**
10708
- * List available indexes
10986
+ * Address UTXOs
10709
10987
  *
10710
- * Returns all available indexes with their accepted query aliases. Use any alias when querying series.
10988
+ * Get unspent transaction outputs (UTXOs) for an address. Returns txid, vout, value, and confirmation status for each UTXO.
10711
10989
  *
10712
- * Endpoint: `GET /api/series/indexes`
10713
- * @param {{ signal?: AbortSignal, onUpdate?: (value: IndexInfo[]) => void }} [options]
10714
- * @returns {Promise<IndexInfo[]>}
10990
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-address-utxo)*
10991
+ *
10992
+ * Endpoint: `GET /api/address/{address}/utxo`
10993
+ *
10994
+ * @param {Addr} address
10995
+ * @param {{ signal?: AbortSignal, onValue?: (value: Utxo[]) => void }} [options]
10996
+ * @returns {Promise<Utxo[]>}
10715
10997
  */
10716
- async getIndexes({ signal, onUpdate } = {}) {
10717
- const path = `/api/series/indexes`;
10718
- return this.getJson(path, { signal, onUpdate });
10998
+ async getAddressUtxos(address, { signal, onValue } = {}) {
10999
+ const path = `/api/address/${address}/utxo`;
11000
+ return this.getJson(path, { signal, onValue });
10719
11001
  }
10720
11002
 
10721
11003
  /**
10722
- * Series list
11004
+ * Validate address
10723
11005
  *
10724
- * Paginated flat list of all available series names. Use `page` query param for pagination.
11006
+ * Validate a Bitcoin address and get information about its type and scriptPubKey. Returns `isvalid: false` with an error message for invalid addresses.
10725
11007
  *
10726
- * Endpoint: `GET /api/series/list`
11008
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-address-validate)*
10727
11009
  *
10728
- * @param {number=} [page] - Pagination index
10729
- * @param {number=} [per_page] - Results per page (default: 1000, max: 1000)
10730
- * @param {{ signal?: AbortSignal, onUpdate?: (value: PaginatedSeries) => void }} [options]
10731
- * @returns {Promise<PaginatedSeries>}
11010
+ * Endpoint: `GET /api/v1/validate-address/{address}`
11011
+ *
11012
+ * @param {string} address - Bitcoin address to validate (can be any string)
11013
+ * @param {{ signal?: AbortSignal, onValue?: (value: AddrValidation) => void }} [options]
11014
+ * @returns {Promise<AddrValidation>}
10732
11015
  */
10733
- async listSeries(page, per_page, { signal, onUpdate } = {}) {
10734
- const params = new URLSearchParams();
10735
- if (page !== undefined) params.set('page', String(page));
10736
- if (per_page !== undefined) params.set('per_page', String(per_page));
10737
- const query = params.toString();
10738
- const path = `/api/series/list${query ? '?' + query : ''}`;
10739
- return this.getJson(path, { signal, onUpdate });
11016
+ async validateAddress(address, { signal, onValue } = {}) {
11017
+ const path = `/api/v1/validate-address/${address}`;
11018
+ return this.getJson(path, { signal, onValue });
11019
+ }
11020
+
11021
+ /**
11022
+ * Block information
11023
+ *
11024
+ * Retrieve block information by block hash. Returns block metadata including height, timestamp, difficulty, size, weight, and transaction count.
11025
+ *
11026
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block)*
11027
+ *
11028
+ * Endpoint: `GET /api/block/{hash}`
11029
+ *
11030
+ * @param {BlockHash} hash
11031
+ * @param {{ signal?: AbortSignal, onValue?: (value: BlockInfo) => void }} [options]
11032
+ * @returns {Promise<BlockInfo>}
11033
+ */
11034
+ async getBlock(hash, { signal, onValue } = {}) {
11035
+ const path = `/api/block/${hash}`;
11036
+ return this.getJson(path, { signal, onValue });
10740
11037
  }
10741
11038
 
10742
11039
  /**
10743
- * Search series
11040
+ * Block (v1)
10744
11041
  *
10745
- * Fuzzy search for series by name. Supports partial matches and typos.
11042
+ * Returns block details with extras by hash.
10746
11043
  *
10747
- * Endpoint: `GET /api/series/search`
11044
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-v1)*
10748
11045
  *
10749
- * @param {SeriesName} [q] - Search query string
10750
- * @param {Limit=} [limit] - Maximum number of results
10751
- * @param {{ signal?: AbortSignal, onUpdate?: (value: string[]) => void }} [options]
10752
- * @returns {Promise<string[]>}
11046
+ * Endpoint: `GET /api/v1/block/{hash}`
11047
+ *
11048
+ * @param {BlockHash} hash
11049
+ * @param {{ signal?: AbortSignal, onValue?: (value: BlockInfoV1) => void }} [options]
11050
+ * @returns {Promise<BlockInfoV1>}
10753
11051
  */
10754
- async searchSeries(q, limit, { signal, onUpdate } = {}) {
10755
- const params = new URLSearchParams();
10756
- params.set('q', String(q));
10757
- if (limit !== undefined) params.set('limit', String(limit));
10758
- const query = params.toString();
10759
- const path = `/api/series/search${query ? '?' + query : ''}`;
10760
- return this.getJson(path, { signal, onUpdate });
11052
+ async getBlockV1(hash, { signal, onValue } = {}) {
11053
+ const path = `/api/v1/block/${hash}`;
11054
+ return this.getJson(path, { signal, onValue });
10761
11055
  }
10762
11056
 
10763
11057
  /**
10764
- * Get series info
11058
+ * Block header
10765
11059
  *
10766
- * Returns the supported indexes and value type for the specified series.
11060
+ * Returns the hex-encoded 80-byte block header.
10767
11061
  *
10768
- * Endpoint: `GET /api/series/{series}`
11062
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-header)*
10769
11063
  *
10770
- * @param {SeriesName} series
10771
- * @param {{ signal?: AbortSignal, onUpdate?: (value: SeriesInfo) => void }} [options]
10772
- * @returns {Promise<SeriesInfo>}
11064
+ * Endpoint: `GET /api/block/{hash}/header`
11065
+ *
11066
+ * @param {BlockHash} hash
11067
+ * @param {{ signal?: AbortSignal, onValue?: (value: Hex) => void }} [options]
11068
+ * @returns {Promise<Hex>}
10773
11069
  */
10774
- async getSeriesInfo(series, { signal, onUpdate } = {}) {
10775
- const path = `/api/series/${series}`;
10776
- return this.getJson(path, { signal, onUpdate });
11070
+ async getBlockHeader(hash, { signal, onValue } = {}) {
11071
+ const path = `/api/block/${hash}/header`;
11072
+ return this.getText(path, { signal, onValue });
10777
11073
  }
10778
11074
 
10779
11075
  /**
10780
- * Get series data
11076
+ * Block hash by height
10781
11077
  *
10782
- * Fetch data for a specific series at the given index. Use query parameters to filter by date range and format (json/csv).
11078
+ * Retrieve the block hash at a given height. Returns the hash as plain text.
10783
11079
  *
10784
- * Endpoint: `GET /api/series/{series}/{index}`
11080
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-height)*
10785
11081
  *
10786
- * @param {SeriesName} series - Series name
10787
- * @param {Index} index - Aggregation index
10788
- * @param {RangeIndex=} [start] - Inclusive start: integer index, date (YYYY-MM-DD), or timestamp (ISO 8601). Negative integers count from end. Aliases: `from`, `f`, `s`
10789
- * @param {RangeIndex=} [end] - Exclusive end: integer index, date (YYYY-MM-DD), or timestamp (ISO 8601). Negative integers count from end. Aliases: `to`, `t`, `e`
10790
- * @param {Limit=} [limit] - Maximum number of values to return (ignored if `end` is set). Aliases: `count`, `c`, `l`
10791
- * @param {Format=} [format] - Format of the output
10792
- * @param {{ signal?: AbortSignal, onUpdate?: (value: AnySeriesData | string) => void }} [options]
10793
- * @returns {Promise<AnySeriesData | string>}
11082
+ * Endpoint: `GET /api/block-height/{height}`
11083
+ *
11084
+ * @param {Height} height
11085
+ * @param {{ signal?: AbortSignal, onValue?: (value: BlockHash) => void }} [options]
11086
+ * @returns {Promise<BlockHash>}
10794
11087
  */
10795
- async getSeries(series, index, start, end, limit, format, { signal, onUpdate } = {}) {
10796
- const params = new URLSearchParams();
10797
- if (start !== undefined) params.set('start', String(start));
10798
- if (end !== undefined) params.set('end', String(end));
10799
- if (limit !== undefined) params.set('limit', String(limit));
10800
- if (format !== undefined) params.set('format', String(format));
10801
- const query = params.toString();
10802
- const path = `/api/series/${series}/${index}${query ? '?' + query : ''}`;
10803
- if (format === 'csv') return this.getText(path, { signal, onUpdate });
10804
- return this.getJson(path, { signal, onUpdate });
11088
+ async getBlockByHeight(height, { signal, onValue } = {}) {
11089
+ const path = `/api/block-height/${height}`;
11090
+ return this.getText(path, { signal, onValue });
10805
11091
  }
10806
11092
 
10807
11093
  /**
10808
- * Get raw series data
11094
+ * Block by timestamp
10809
11095
  *
10810
- * Returns just the data array without the SeriesData wrapper. Supports the same range and format parameters as the standard endpoint.
11096
+ * Find the block closest to a given UNIX timestamp.
10811
11097
  *
10812
- * Endpoint: `GET /api/series/{series}/{index}/data`
11098
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-timestamp)*
10813
11099
  *
10814
- * @param {SeriesName} series - Series name
10815
- * @param {Index} index - Aggregation index
10816
- * @param {RangeIndex=} [start] - Inclusive start: integer index, date (YYYY-MM-DD), or timestamp (ISO 8601). Negative integers count from end. Aliases: `from`, `f`, `s`
10817
- * @param {RangeIndex=} [end] - Exclusive end: integer index, date (YYYY-MM-DD), or timestamp (ISO 8601). Negative integers count from end. Aliases: `to`, `t`, `e`
10818
- * @param {Limit=} [limit] - Maximum number of values to return (ignored if `end` is set). Aliases: `count`, `c`, `l`
10819
- * @param {Format=} [format] - Format of the output
10820
- * @param {{ signal?: AbortSignal, onUpdate?: (value: boolean[] | string) => void }} [options]
10821
- * @returns {Promise<boolean[] | string>}
11100
+ * Endpoint: `GET /api/v1/mining/blocks/timestamp/{timestamp}`
11101
+ *
11102
+ * @param {Timestamp} timestamp
11103
+ * @param {{ signal?: AbortSignal, onValue?: (value: BlockTimestamp) => void }} [options]
11104
+ * @returns {Promise<BlockTimestamp>}
10822
11105
  */
10823
- async getSeriesData(series, index, start, end, limit, format, { signal, onUpdate } = {}) {
10824
- const params = new URLSearchParams();
10825
- if (start !== undefined) params.set('start', String(start));
10826
- if (end !== undefined) params.set('end', String(end));
10827
- if (limit !== undefined) params.set('limit', String(limit));
10828
- if (format !== undefined) params.set('format', String(format));
10829
- const query = params.toString();
10830
- const path = `/api/series/${series}/${index}/data${query ? '?' + query : ''}`;
10831
- if (format === 'csv') return this.getText(path, { signal, onUpdate });
10832
- return this.getJson(path, { signal, onUpdate });
11106
+ async getBlockByTimestamp(timestamp, { signal, onValue } = {}) {
11107
+ const path = `/api/v1/mining/blocks/timestamp/${timestamp}`;
11108
+ return this.getJson(path, { signal, onValue });
10833
11109
  }
10834
11110
 
10835
11111
  /**
10836
- * Get latest series value
11112
+ * Raw block
10837
11113
  *
10838
- * Returns the single most recent value for a series, unwrapped (not inside a SeriesData object).
11114
+ * Returns the raw block data in binary format.
10839
11115
  *
10840
- * Endpoint: `GET /api/series/{series}/{index}/latest`
11116
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-raw)*
10841
11117
  *
10842
- * @param {SeriesName} series - Series name
10843
- * @param {Index} index - Aggregation index
10844
- * @param {{ signal?: AbortSignal, onUpdate?: (value: *) => void }} [options]
10845
- * @returns {Promise<*>}
11118
+ * Endpoint: `GET /api/block/{hash}/raw`
11119
+ *
11120
+ * @param {BlockHash} hash
11121
+ * @param {{ signal?: AbortSignal, onValue?: (value: Uint8Array) => void }} [options]
11122
+ * @returns {Promise<Uint8Array>}
10846
11123
  */
10847
- async getSeriesLatest(series, index, { signal, onUpdate } = {}) {
10848
- const path = `/api/series/${series}/${index}/latest`;
10849
- return this.getText(path, { signal, onUpdate });
11124
+ async getBlockRaw(hash, { signal, onValue } = {}) {
11125
+ const path = `/api/block/${hash}/raw`;
11126
+ return this.getBytes(path, { signal, onValue });
10850
11127
  }
10851
11128
 
10852
11129
  /**
10853
- * Get series data length
11130
+ * Block status
10854
11131
  *
10855
- * Returns the total number of data points for a series at the given index.
11132
+ * Retrieve the status of a block. Returns whether the block is in the best chain and, if so, its height and the hash of the next block.
10856
11133
  *
10857
- * Endpoint: `GET /api/series/{series}/{index}/len`
11134
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-status)*
10858
11135
  *
10859
- * @param {SeriesName} series - Series name
10860
- * @param {Index} index - Aggregation index
10861
- * @param {{ signal?: AbortSignal, onUpdate?: (value: number) => void }} [options]
10862
- * @returns {Promise<number>}
11136
+ * Endpoint: `GET /api/block/{hash}/status`
11137
+ *
11138
+ * @param {BlockHash} hash
11139
+ * @param {{ signal?: AbortSignal, onValue?: (value: BlockStatus) => void }} [options]
11140
+ * @returns {Promise<BlockStatus>}
10863
11141
  */
10864
- async getSeriesLen(series, index, { signal, onUpdate } = {}) {
10865
- const path = `/api/series/${series}/${index}/len`;
10866
- return this.getJson(path, { signal, onUpdate });
11142
+ async getBlockStatus(hash, { signal, onValue } = {}) {
11143
+ const path = `/api/block/${hash}/status`;
11144
+ return this.getJson(path, { signal, onValue });
10867
11145
  }
10868
11146
 
10869
11147
  /**
10870
- * Get series version
11148
+ * Block tip height
10871
11149
  *
10872
- * Returns the current version of a series. Changes when the series data is updated.
11150
+ * Returns the height of the last block.
10873
11151
  *
10874
- * Endpoint: `GET /api/series/{series}/{index}/version`
11152
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-tip-height)*
10875
11153
  *
10876
- * @param {SeriesName} series - Series name
10877
- * @param {Index} index - Aggregation index
10878
- * @param {{ signal?: AbortSignal, onUpdate?: (value: Version) => void }} [options]
10879
- * @returns {Promise<Version>}
11154
+ * Endpoint: `GET /api/blocks/tip/height`
11155
+ * @param {{ signal?: AbortSignal, onValue?: (value: Height) => void }} [options]
11156
+ * @returns {Promise<Height>}
10880
11157
  */
10881
- async getSeriesVersion(series, index, { signal, onUpdate } = {}) {
10882
- const path = `/api/series/${series}/${index}/version`;
10883
- return this.getJson(path, { signal, onUpdate });
11158
+ async getBlockTipHeight({ signal, onValue } = {}) {
11159
+ const path = `/api/blocks/tip/height`;
11160
+ return Number(await this.getText(path, { signal, onValue: onValue ? (v) => onValue(Number(v)) : undefined }));
10884
11161
  }
10885
11162
 
10886
11163
  /**
10887
- * Disk usage
11164
+ * Block tip hash
10888
11165
  *
10889
- * Returns the disk space used by BRK and Bitcoin data.
11166
+ * Returns the hash of the last block.
10890
11167
  *
10891
- * Endpoint: `GET /api/server/disk`
10892
- * @param {{ signal?: AbortSignal, onUpdate?: (value: DiskUsage) => void }} [options]
10893
- * @returns {Promise<DiskUsage>}
11168
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-tip-hash)*
11169
+ *
11170
+ * Endpoint: `GET /api/blocks/tip/hash`
11171
+ * @param {{ signal?: AbortSignal, onValue?: (value: BlockHash) => void }} [options]
11172
+ * @returns {Promise<BlockHash>}
10894
11173
  */
10895
- async getDiskUsage({ signal, onUpdate } = {}) {
10896
- const path = `/api/server/disk`;
10897
- return this.getJson(path, { signal, onUpdate });
11174
+ async getBlockTipHash({ signal, onValue } = {}) {
11175
+ const path = `/api/blocks/tip/hash`;
11176
+ return this.getText(path, { signal, onValue });
10898
11177
  }
10899
11178
 
10900
11179
  /**
10901
- * Sync status
11180
+ * Transaction ID at index
10902
11181
  *
10903
- * Returns the sync status of the indexer, including indexed height, tip height, blocks behind, and last indexed timestamp.
11182
+ * Retrieve a single transaction ID at a specific index within a block. Returns plain text txid.
10904
11183
  *
10905
- * Endpoint: `GET /api/server/sync`
10906
- * @param {{ signal?: AbortSignal, onUpdate?: (value: SyncStatus) => void }} [options]
10907
- * @returns {Promise<SyncStatus>}
11184
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-transaction-id)*
11185
+ *
11186
+ * Endpoint: `GET /api/block/{hash}/txid/{index}`
11187
+ *
11188
+ * @param {BlockHash} hash - Bitcoin block hash
11189
+ * @param {BlockTxIndex} index - Transaction index within the block (0-based)
11190
+ * @param {{ signal?: AbortSignal, onValue?: (value: Txid) => void }} [options]
11191
+ * @returns {Promise<Txid>}
10908
11192
  */
10909
- async getSyncStatus({ signal, onUpdate } = {}) {
10910
- const path = `/api/server/sync`;
10911
- return this.getJson(path, { signal, onUpdate });
11193
+ async getBlockTxid(hash, index, { signal, onValue } = {}) {
11194
+ const path = `/api/block/${hash}/txid/${index}`;
11195
+ return this.getText(path, { signal, onValue });
10912
11196
  }
10913
11197
 
10914
11198
  /**
10915
- * Txid by index
11199
+ * Block transaction IDs
10916
11200
  *
10917
- * Retrieve the transaction ID (txid) at a given global transaction index. Returns the txid as plain text.
11201
+ * Retrieve all transaction IDs in a block. Returns an array of txids in block order.
10918
11202
  *
10919
- * Endpoint: `GET /api/tx-index/{index}`
11203
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-transaction-ids)*
10920
11204
  *
10921
- * @param {TxIndex} index
10922
- * @param {{ signal?: AbortSignal, onUpdate?: (value: *) => void }} [options]
10923
- * @returns {Promise<*>}
11205
+ * Endpoint: `GET /api/block/{hash}/txids`
11206
+ *
11207
+ * @param {BlockHash} hash
11208
+ * @param {{ signal?: AbortSignal, onValue?: (value: Txid[]) => void }} [options]
11209
+ * @returns {Promise<Txid[]>}
10924
11210
  */
10925
- async getTxByIndex(index, { signal, onUpdate } = {}) {
10926
- const path = `/api/tx-index/${index}`;
10927
- return this.getText(path, { signal, onUpdate });
11211
+ async getBlockTxids(hash, { signal, onValue } = {}) {
11212
+ const path = `/api/block/${hash}/txids`;
11213
+ return this.getJson(path, { signal, onValue });
10928
11214
  }
10929
11215
 
10930
11216
  /**
10931
- * Transaction information
11217
+ * Block transactions
10932
11218
  *
10933
- * Retrieve complete transaction data by transaction ID (txid). Returns inputs, outputs, fee, size, and confirmation status.
11219
+ * Retrieve transactions in a block by block hash. Returns up to 25 transactions starting from index 0.
10934
11220
  *
10935
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-transaction)*
11221
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-transactions)*
10936
11222
  *
10937
- * Endpoint: `GET /api/tx/{txid}`
11223
+ * Endpoint: `GET /api/block/{hash}/txs`
10938
11224
  *
10939
- * @param {Txid} txid
10940
- * @param {{ signal?: AbortSignal, onUpdate?: (value: Transaction) => void }} [options]
10941
- * @returns {Promise<Transaction>}
11225
+ * @param {BlockHash} hash
11226
+ * @param {{ signal?: AbortSignal, onValue?: (value: Transaction[]) => void }} [options]
11227
+ * @returns {Promise<Transaction[]>}
10942
11228
  */
10943
- async getTx(txid, { signal, onUpdate } = {}) {
10944
- const path = `/api/tx/${txid}`;
10945
- return this.getJson(path, { signal, onUpdate });
11229
+ async getBlockTxs(hash, { signal, onValue } = {}) {
11230
+ const path = `/api/block/${hash}/txs`;
11231
+ return this.getJson(path, { signal, onValue });
10946
11232
  }
10947
11233
 
10948
11234
  /**
10949
- * Transaction hex
11235
+ * Block transactions (paginated)
10950
11236
  *
10951
- * Retrieve the raw transaction as a hex-encoded string. Returns the serialized transaction in hexadecimal format.
11237
+ * Retrieve transactions in a block by block hash, starting from the specified index. Returns up to 25 transactions at a time.
10952
11238
  *
10953
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-transaction-hex)*
11239
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-transactions)*
10954
11240
  *
10955
- * Endpoint: `GET /api/tx/{txid}/hex`
11241
+ * Endpoint: `GET /api/block/{hash}/txs/{start_index}`
10956
11242
  *
10957
- * @param {Txid} txid
10958
- * @param {{ signal?: AbortSignal, onUpdate?: (value: *) => void }} [options]
10959
- * @returns {Promise<*>}
11243
+ * @param {BlockHash} hash - Bitcoin block hash
11244
+ * @param {BlockTxIndex} start_index - Starting transaction index within the block (0-based)
11245
+ * @param {{ signal?: AbortSignal, onValue?: (value: Transaction[]) => void }} [options]
11246
+ * @returns {Promise<Transaction[]>}
10960
11247
  */
10961
- async getTxHex(txid, { signal, onUpdate } = {}) {
10962
- const path = `/api/tx/${txid}/hex`;
10963
- return this.getText(path, { signal, onUpdate });
11248
+ async getBlockTxsFromIndex(hash, start_index, { signal, onValue } = {}) {
11249
+ const path = `/api/block/${hash}/txs/${start_index}`;
11250
+ return this.getJson(path, { signal, onValue });
10964
11251
  }
10965
11252
 
10966
11253
  /**
10967
- * Transaction merkle proof
10968
- *
10969
- * Get the merkle inclusion proof for a transaction.
11254
+ * Recent blocks
10970
11255
  *
10971
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-transaction-merkle-proof)*
11256
+ * Retrieve the last 10 blocks. Returns block metadata for each block.
10972
11257
  *
10973
- * Endpoint: `GET /api/tx/{txid}/merkle-proof`
11258
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-blocks)*
10974
11259
  *
10975
- * @param {Txid} txid
10976
- * @param {{ signal?: AbortSignal, onUpdate?: (value: MerkleProof) => void }} [options]
10977
- * @returns {Promise<MerkleProof>}
11260
+ * Endpoint: `GET /api/blocks`
11261
+ * @param {{ signal?: AbortSignal, onValue?: (value: BlockInfo[]) => void }} [options]
11262
+ * @returns {Promise<BlockInfo[]>}
10978
11263
  */
10979
- async getTxMerkleProof(txid, { signal, onUpdate } = {}) {
10980
- const path = `/api/tx/${txid}/merkle-proof`;
10981
- return this.getJson(path, { signal, onUpdate });
11264
+ async getBlocks({ signal, onValue } = {}) {
11265
+ const path = `/api/blocks`;
11266
+ return this.getJson(path, { signal, onValue });
10982
11267
  }
10983
11268
 
10984
11269
  /**
10985
- * Transaction merkleblock proof
11270
+ * Blocks from height
10986
11271
  *
10987
- * Get the merkleblock proof for a transaction (BIP37 format, hex encoded).
11272
+ * Retrieve up to 10 blocks going backwards from the given height. For example, height=100 returns blocks 100, 99, 98, ..., 91. Height=0 returns only block 0.
10988
11273
  *
10989
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-transaction-merkleblock-proof)*
11274
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-blocks)*
10990
11275
  *
10991
- * Endpoint: `GET /api/tx/{txid}/merkleblock-proof`
11276
+ * Endpoint: `GET /api/blocks/{height}`
10992
11277
  *
10993
- * @param {Txid} txid
10994
- * @param {{ signal?: AbortSignal, onUpdate?: (value: *) => void }} [options]
10995
- * @returns {Promise<*>}
11278
+ * @param {Height} height
11279
+ * @param {{ signal?: AbortSignal, onValue?: (value: BlockInfo[]) => void }} [options]
11280
+ * @returns {Promise<BlockInfo[]>}
10996
11281
  */
10997
- async getTxMerkleblockProof(txid, { signal, onUpdate } = {}) {
10998
- const path = `/api/tx/${txid}/merkleblock-proof`;
10999
- return this.getText(path, { signal, onUpdate });
11282
+ async getBlocksFromHeight(height, { signal, onValue } = {}) {
11283
+ const path = `/api/blocks/${height}`;
11284
+ return this.getJson(path, { signal, onValue });
11000
11285
  }
11001
11286
 
11002
11287
  /**
11003
- * Output spend status
11004
- *
11005
- * Get the spending status of a transaction output. Returns whether the output has been spent and, if so, the spending transaction details.
11288
+ * Recent blocks with extras
11006
11289
  *
11007
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-transaction-outspend)*
11290
+ * Retrieve the last 15 blocks with extended data including pool identification and fee statistics.
11008
11291
  *
11009
- * Endpoint: `GET /api/tx/{txid}/outspend/{vout}`
11292
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-blocks-v1)*
11010
11293
  *
11011
- * @param {Txid} txid - Transaction ID
11012
- * @param {Vout} vout - Output index
11013
- * @param {{ signal?: AbortSignal, onUpdate?: (value: TxOutspend) => void }} [options]
11014
- * @returns {Promise<TxOutspend>}
11294
+ * Endpoint: `GET /api/v1/blocks`
11295
+ * @param {{ signal?: AbortSignal, onValue?: (value: BlockInfoV1[]) => void }} [options]
11296
+ * @returns {Promise<BlockInfoV1[]>}
11015
11297
  */
11016
- async getTxOutspend(txid, vout, { signal, onUpdate } = {}) {
11017
- const path = `/api/tx/${txid}/outspend/${vout}`;
11018
- return this.getJson(path, { signal, onUpdate });
11298
+ async getBlocksV1({ signal, onValue } = {}) {
11299
+ const path = `/api/v1/blocks`;
11300
+ return this.getJson(path, { signal, onValue });
11019
11301
  }
11020
11302
 
11021
11303
  /**
11022
- * All output spend statuses
11304
+ * Blocks from height with extras
11023
11305
  *
11024
- * Get the spending status of all outputs in a transaction. Returns an array with the spend status for each output.
11306
+ * Retrieve up to 15 blocks with extended data going backwards from the given height.
11025
11307
  *
11026
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-transaction-outspends)*
11308
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-blocks-v1)*
11027
11309
  *
11028
- * Endpoint: `GET /api/tx/{txid}/outspends`
11310
+ * Endpoint: `GET /api/v1/blocks/{height}`
11029
11311
  *
11030
- * @param {Txid} txid
11031
- * @param {{ signal?: AbortSignal, onUpdate?: (value: TxOutspend[]) => void }} [options]
11032
- * @returns {Promise<TxOutspend[]>}
11312
+ * @param {Height} height
11313
+ * @param {{ signal?: AbortSignal, onValue?: (value: BlockInfoV1[]) => void }} [options]
11314
+ * @returns {Promise<BlockInfoV1[]>}
11033
11315
  */
11034
- async getTxOutspends(txid, { signal, onUpdate } = {}) {
11035
- const path = `/api/tx/${txid}/outspends`;
11036
- return this.getJson(path, { signal, onUpdate });
11316
+ async getBlocksV1FromHeight(height, { signal, onValue } = {}) {
11317
+ const path = `/api/v1/blocks/${height}`;
11318
+ return this.getJson(path, { signal, onValue });
11037
11319
  }
11038
11320
 
11039
11321
  /**
11040
- * Transaction raw
11041
- *
11042
- * Returns a transaction as binary data.
11322
+ * List all mining pools
11043
11323
  *
11044
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-transaction-raw)*
11324
+ * Get list of all known mining pools with their identifiers.
11045
11325
  *
11046
- * Endpoint: `GET /api/tx/{txid}/raw`
11326
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-mining-pools)*
11047
11327
  *
11048
- * @param {Txid} txid
11049
- * @param {{ signal?: AbortSignal, onUpdate?: (value: *) => void }} [options]
11050
- * @returns {Promise<*>}
11328
+ * Endpoint: `GET /api/v1/mining/pools`
11329
+ * @param {{ signal?: AbortSignal, onValue?: (value: PoolInfo[]) => void }} [options]
11330
+ * @returns {Promise<PoolInfo[]>}
11051
11331
  */
11052
- async getTxRaw(txid, { signal, onUpdate } = {}) {
11053
- const path = `/api/tx/${txid}/raw`;
11054
- return this.getText(path, { signal, onUpdate });
11332
+ async getPools({ signal, onValue } = {}) {
11333
+ const path = `/api/v1/mining/pools`;
11334
+ return this.getJson(path, { signal, onValue });
11055
11335
  }
11056
11336
 
11057
11337
  /**
11058
- * Transaction status
11338
+ * Mining pool statistics
11059
11339
  *
11060
- * Retrieve the confirmation status of a transaction. Returns whether the transaction is confirmed and, if so, the block height, hash, and timestamp.
11340
+ * Get mining pool statistics for a time period. Valid periods: `24h`, `3d`, `1w`, `1m`, `3m`, `6m`, `1y`, `2y`, `3y`.
11061
11341
  *
11062
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-transaction-status)*
11342
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-mining-pools)*
11063
11343
  *
11064
- * Endpoint: `GET /api/tx/{txid}/status`
11344
+ * Endpoint: `GET /api/v1/mining/pools/{time_period}`
11065
11345
  *
11066
- * @param {Txid} txid
11067
- * @param {{ signal?: AbortSignal, onUpdate?: (value: TxStatus) => void }} [options]
11068
- * @returns {Promise<TxStatus>}
11346
+ * @param {TimePeriod} time_period
11347
+ * @param {{ signal?: AbortSignal, onValue?: (value: PoolsSummary) => void }} [options]
11348
+ * @returns {Promise<PoolsSummary>}
11069
11349
  */
11070
- async getTxStatus(txid, { signal, onUpdate } = {}) {
11071
- const path = `/api/tx/${txid}/status`;
11072
- return this.getJson(path, { signal, onUpdate });
11350
+ async getPoolStats(time_period, { signal, onValue } = {}) {
11351
+ const path = `/api/v1/mining/pools/${time_period}`;
11352
+ return this.getJson(path, { signal, onValue });
11073
11353
  }
11074
11354
 
11075
11355
  /**
11076
- * Available URPD cohorts
11356
+ * Mining pool details
11077
11357
  *
11078
- * Cohorts for which URPD data is available. Returns names like `all`, `sth`, `lth`, `utxos_under_1h_old`.
11358
+ * Get detailed information about a specific mining pool including block counts and shares for different time periods.
11079
11359
  *
11080
- * Endpoint: `GET /api/urpd`
11081
- * @param {{ signal?: AbortSignal, onUpdate?: (value: Cohort[]) => void }} [options]
11082
- * @returns {Promise<Cohort[]>}
11360
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-mining-pool)*
11361
+ *
11362
+ * Endpoint: `GET /api/v1/mining/pool/{slug}`
11363
+ *
11364
+ * @param {PoolSlug} slug
11365
+ * @param {{ signal?: AbortSignal, onValue?: (value: PoolDetail) => void }} [options]
11366
+ * @returns {Promise<PoolDetail>}
11083
11367
  */
11084
- async listUrpdCohorts({ signal, onUpdate } = {}) {
11085
- const path = `/api/urpd`;
11086
- return this.getJson(path, { signal, onUpdate });
11368
+ async getPool(slug, { signal, onValue } = {}) {
11369
+ const path = `/api/v1/mining/pool/${slug}`;
11370
+ return this.getJson(path, { signal, onValue });
11087
11371
  }
11088
11372
 
11089
11373
  /**
11090
- * Latest URPD
11091
- *
11092
- * URPD for the most recent available date in the cohort. The response's `date` field echoes which date was served.
11374
+ * All pools hashrate (all time)
11093
11375
  *
11094
- * See the URPD tag description for the response shape and `agg` options.
11376
+ * Get hashrate data for all mining pools.
11095
11377
  *
11096
- * Endpoint: `GET /api/urpd/{cohort}`
11378
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-mining-pool-hashrates)*
11097
11379
  *
11098
- * @param {Cohort} cohort
11099
- * @param {UrpdAggregation=} [agg] - Aggregation strategy. Default: raw (no aggregation). Accepts `bucket` as alias.
11100
- * @param {{ signal?: AbortSignal, onUpdate?: (value: Urpd) => void }} [options]
11101
- * @returns {Promise<Urpd>}
11380
+ * Endpoint: `GET /api/v1/mining/hashrate/pools`
11381
+ * @param {{ signal?: AbortSignal, onValue?: (value: PoolHashrateEntry[]) => void }} [options]
11382
+ * @returns {Promise<PoolHashrateEntry[]>}
11102
11383
  */
11103
- async getUrpd(cohort, agg, { signal, onUpdate } = {}) {
11104
- const params = new URLSearchParams();
11105
- if (agg !== undefined) params.set('agg', String(agg));
11106
- const query = params.toString();
11107
- const path = `/api/urpd/${cohort}${query ? '?' + query : ''}`;
11108
- return this.getJson(path, { signal, onUpdate });
11384
+ async getPoolsHashrate({ signal, onValue } = {}) {
11385
+ const path = `/api/v1/mining/hashrate/pools`;
11386
+ return this.getJson(path, { signal, onValue });
11109
11387
  }
11110
11388
 
11111
11389
  /**
11112
- * Available URPD dates
11390
+ * All pools hashrate
11113
11391
  *
11114
- * Dates for which a URPD snapshot is available for the cohort. One entry per UTC day, sorted ascending.
11392
+ * Get hashrate data for all mining pools for a time period. Valid periods: `1m`, `3m`, `6m`, `1y`, `2y`, `3y`.
11115
11393
  *
11116
- * Endpoint: `GET /api/urpd/{cohort}/dates`
11394
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-mining-pool-hashrates)*
11117
11395
  *
11118
- * @param {Cohort} cohort
11119
- * @param {{ signal?: AbortSignal, onUpdate?: (value: Date[]) => void }} [options]
11120
- * @returns {Promise<Date[]>}
11396
+ * Endpoint: `GET /api/v1/mining/hashrate/pools/{time_period}`
11397
+ *
11398
+ * @param {TimePeriod} time_period
11399
+ * @param {{ signal?: AbortSignal, onValue?: (value: PoolHashrateEntry[]) => void }} [options]
11400
+ * @returns {Promise<PoolHashrateEntry[]>}
11121
11401
  */
11122
- async listUrpdDates(cohort, { signal, onUpdate } = {}) {
11123
- const path = `/api/urpd/${cohort}/dates`;
11124
- return this.getJson(path, { signal, onUpdate });
11402
+ async getPoolsHashrateByPeriod(time_period, { signal, onValue } = {}) {
11403
+ const path = `/api/v1/mining/hashrate/pools/${time_period}`;
11404
+ return this.getJson(path, { signal, onValue });
11125
11405
  }
11126
11406
 
11127
11407
  /**
11128
- * URPD at date
11408
+ * Mining pool hashrate
11129
11409
  *
11130
- * URPD for a (cohort, date) pair. Returns `{ cohort, date, aggregation, close, total_supply, buckets }` where each bucket is `{ price_floor, supply, realized_cap, unrealized_pnl }`.
11410
+ * Get hashrate history for a specific mining pool.
11131
11411
  *
11132
- * See the URPD tag description for unit conventions and `agg` options.
11412
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-mining-pool-hashrate)*
11133
11413
  *
11134
- * Endpoint: `GET /api/urpd/{cohort}/{date}`
11414
+ * Endpoint: `GET /api/v1/mining/pool/{slug}/hashrate`
11135
11415
  *
11136
- * @param {Cohort} cohort
11137
- * @param {string} date
11138
- * @param {UrpdAggregation=} [agg] - Aggregation strategy. Default: raw (no aggregation). Accepts `bucket` as alias.
11139
- * @param {{ signal?: AbortSignal, onUpdate?: (value: Urpd) => void }} [options]
11140
- * @returns {Promise<Urpd>}
11416
+ * @param {PoolSlug} slug
11417
+ * @param {{ signal?: AbortSignal, onValue?: (value: PoolHashrateEntry[]) => void }} [options]
11418
+ * @returns {Promise<PoolHashrateEntry[]>}
11141
11419
  */
11142
- async getUrpdAt(cohort, date, agg, { signal, onUpdate } = {}) {
11143
- const params = new URLSearchParams();
11144
- if (agg !== undefined) params.set('agg', String(agg));
11145
- const query = params.toString();
11146
- const path = `/api/urpd/${cohort}/${date}${query ? '?' + query : ''}`;
11147
- return this.getJson(path, { signal, onUpdate });
11420
+ async getPoolHashrate(slug, { signal, onValue } = {}) {
11421
+ const path = `/api/v1/mining/pool/${slug}/hashrate`;
11422
+ return this.getJson(path, { signal, onValue });
11148
11423
  }
11149
11424
 
11150
11425
  /**
11151
- * Block (v1)
11426
+ * Mining pool blocks
11152
11427
  *
11153
- * Returns block details with extras by hash.
11428
+ * Get the 10 most recent blocks mined by a specific pool.
11154
11429
  *
11155
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-v1)*
11430
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-mining-pool-blocks)*
11156
11431
  *
11157
- * Endpoint: `GET /api/v1/block/{hash}`
11432
+ * Endpoint: `GET /api/v1/mining/pool/{slug}/blocks`
11158
11433
  *
11159
- * @param {BlockHash} hash
11160
- * @param {{ signal?: AbortSignal, onUpdate?: (value: BlockInfoV1) => void }} [options]
11161
- * @returns {Promise<BlockInfoV1>}
11434
+ * @param {PoolSlug} slug
11435
+ * @param {{ signal?: AbortSignal, onValue?: (value: BlockInfoV1[]) => void }} [options]
11436
+ * @returns {Promise<BlockInfoV1[]>}
11162
11437
  */
11163
- async getBlockV1(hash, { signal, onUpdate } = {}) {
11164
- const path = `/api/v1/block/${hash}`;
11165
- return this.getJson(path, { signal, onUpdate });
11438
+ async getPoolBlocks(slug, { signal, onValue } = {}) {
11439
+ const path = `/api/v1/mining/pool/${slug}/blocks`;
11440
+ return this.getJson(path, { signal, onValue });
11166
11441
  }
11167
11442
 
11168
11443
  /**
11169
- * Recent blocks with extras
11444
+ * Mining pool blocks from height
11170
11445
  *
11171
- * Retrieve the last 10 blocks with extended data including pool identification and fee statistics.
11446
+ * Get 10 blocks mined by a specific pool before (and including) the given height.
11172
11447
  *
11173
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-blocks-v1)*
11448
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-mining-pool-blocks)*
11174
11449
  *
11175
- * Endpoint: `GET /api/v1/blocks`
11176
- * @param {{ signal?: AbortSignal, onUpdate?: (value: BlockInfoV1[]) => void }} [options]
11450
+ * Endpoint: `GET /api/v1/mining/pool/{slug}/blocks/{height}`
11451
+ *
11452
+ * @param {PoolSlug} slug
11453
+ * @param {Height} height
11454
+ * @param {{ signal?: AbortSignal, onValue?: (value: BlockInfoV1[]) => void }} [options]
11177
11455
  * @returns {Promise<BlockInfoV1[]>}
11178
11456
  */
11179
- async getBlocksV1({ signal, onUpdate } = {}) {
11180
- const path = `/api/v1/blocks`;
11181
- return this.getJson(path, { signal, onUpdate });
11457
+ async getPoolBlocksFrom(slug, height, { signal, onValue } = {}) {
11458
+ const path = `/api/v1/mining/pool/${slug}/blocks/${height}`;
11459
+ return this.getJson(path, { signal, onValue });
11182
11460
  }
11183
11461
 
11184
11462
  /**
11185
- * Blocks from height with extras
11186
- *
11187
- * Retrieve up to 10 blocks with extended data going backwards from the given height.
11463
+ * Network hashrate (all time)
11188
11464
  *
11189
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-blocks-v1)*
11465
+ * Get network hashrate and difficulty data for all time.
11190
11466
  *
11191
- * Endpoint: `GET /api/v1/blocks/{height}`
11467
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-hashrate)*
11192
11468
  *
11193
- * @param {Height} height
11194
- * @param {{ signal?: AbortSignal, onUpdate?: (value: BlockInfoV1[]) => void }} [options]
11195
- * @returns {Promise<BlockInfoV1[]>}
11469
+ * Endpoint: `GET /api/v1/mining/hashrate`
11470
+ * @param {{ signal?: AbortSignal, onValue?: (value: HashrateSummary) => void }} [options]
11471
+ * @returns {Promise<HashrateSummary>}
11196
11472
  */
11197
- async getBlocksV1FromHeight(height, { signal, onUpdate } = {}) {
11198
- const path = `/api/v1/blocks/${height}`;
11199
- return this.getJson(path, { signal, onUpdate });
11473
+ async getHashrate({ signal, onValue } = {}) {
11474
+ const path = `/api/v1/mining/hashrate`;
11475
+ return this.getJson(path, { signal, onValue });
11200
11476
  }
11201
11477
 
11202
11478
  /**
11203
- * CPFP info
11479
+ * Network hashrate
11204
11480
  *
11205
- * Returns ancestors and descendants for a CPFP (Child Pays For Parent) transaction, including the effective fee rate of the package.
11481
+ * Get network hashrate and difficulty data for a time period. Valid periods: `24h`, `3d`, `1w`, `1m`, `3m`, `6m`, `1y`, `2y`, `3y`.
11206
11482
  *
11207
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-children-pay-for-parent)*
11483
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-hashrate)*
11208
11484
  *
11209
- * Endpoint: `GET /api/v1/cpfp/{txid}`
11485
+ * Endpoint: `GET /api/v1/mining/hashrate/{time_period}`
11210
11486
  *
11211
- * @param {Txid} txid
11212
- * @param {{ signal?: AbortSignal, onUpdate?: (value: CpfpInfo) => void }} [options]
11213
- * @returns {Promise<CpfpInfo>}
11487
+ * @param {TimePeriod} time_period
11488
+ * @param {{ signal?: AbortSignal, onValue?: (value: HashrateSummary) => void }} [options]
11489
+ * @returns {Promise<HashrateSummary>}
11214
11490
  */
11215
- async getCpfp(txid, { signal, onUpdate } = {}) {
11216
- const path = `/api/v1/cpfp/${txid}`;
11217
- return this.getJson(path, { signal, onUpdate });
11491
+ async getHashrateByPeriod(time_period, { signal, onValue } = {}) {
11492
+ const path = `/api/v1/mining/hashrate/${time_period}`;
11493
+ return this.getJson(path, { signal, onValue });
11218
11494
  }
11219
11495
 
11220
11496
  /**
11221
- * Difficulty adjustment
11497
+ * Difficulty adjustments (all time)
11222
11498
  *
11223
- * Get current difficulty adjustment progress and estimates.
11499
+ * Get historical difficulty adjustments including timestamp, block height, difficulty value, and percentage change.
11224
11500
  *
11225
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-difficulty-adjustment)*
11501
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-difficulty-adjustments)*
11226
11502
  *
11227
- * Endpoint: `GET /api/v1/difficulty-adjustment`
11228
- * @param {{ signal?: AbortSignal, onUpdate?: (value: DifficultyAdjustment) => void }} [options]
11229
- * @returns {Promise<DifficultyAdjustment>}
11503
+ * Endpoint: `GET /api/v1/mining/difficulty-adjustments`
11504
+ * @param {{ signal?: AbortSignal, onValue?: (value: DifficultyAdjustmentEntry[]) => void }} [options]
11505
+ * @returns {Promise<DifficultyAdjustmentEntry[]>}
11230
11506
  */
11231
- async getDifficultyAdjustment({ signal, onUpdate } = {}) {
11232
- const path = `/api/v1/difficulty-adjustment`;
11233
- return this.getJson(path, { signal, onUpdate });
11507
+ async getDifficultyAdjustments({ signal, onValue } = {}) {
11508
+ const path = `/api/v1/mining/difficulty-adjustments`;
11509
+ return this.getJson(path, { signal, onValue });
11234
11510
  }
11235
11511
 
11236
11512
  /**
11237
- * Projected mempool blocks
11513
+ * Difficulty adjustments
11238
11514
  *
11239
- * Get projected blocks from the mempool for fee estimation.
11515
+ * Get historical difficulty adjustments for a time period. Valid periods: `24h`, `3d`, `1w`, `1m`, `3m`, `6m`, `1y`, `2y`, `3y`.
11240
11516
  *
11241
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-mempool-blocks-fees)*
11517
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-difficulty-adjustments)*
11242
11518
  *
11243
- * Endpoint: `GET /api/v1/fees/mempool-blocks`
11244
- * @param {{ signal?: AbortSignal, onUpdate?: (value: MempoolBlock[]) => void }} [options]
11245
- * @returns {Promise<MempoolBlock[]>}
11519
+ * Endpoint: `GET /api/v1/mining/difficulty-adjustments/{time_period}`
11520
+ *
11521
+ * @param {TimePeriod} time_period
11522
+ * @param {{ signal?: AbortSignal, onValue?: (value: DifficultyAdjustmentEntry[]) => void }} [options]
11523
+ * @returns {Promise<DifficultyAdjustmentEntry[]>}
11246
11524
  */
11247
- async getMempoolBlocks({ signal, onUpdate } = {}) {
11248
- const path = `/api/v1/fees/mempool-blocks`;
11249
- return this.getJson(path, { signal, onUpdate });
11525
+ async getDifficultyAdjustmentsByPeriod(time_period, { signal, onValue } = {}) {
11526
+ const path = `/api/v1/mining/difficulty-adjustments/${time_period}`;
11527
+ return this.getJson(path, { signal, onValue });
11250
11528
  }
11251
11529
 
11252
11530
  /**
11253
- * Precise recommended fees
11531
+ * Mining reward statistics
11254
11532
  *
11255
- * Get recommended fee rates with up to 3 decimal places.
11533
+ * Get mining reward statistics for the last N blocks including total rewards, fees, and transaction count.
11256
11534
  *
11257
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-recommended-fees-precise)*
11535
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-reward-stats)*
11258
11536
  *
11259
- * Endpoint: `GET /api/v1/fees/precise`
11260
- * @param {{ signal?: AbortSignal, onUpdate?: (value: RecommendedFees) => void }} [options]
11261
- * @returns {Promise<RecommendedFees>}
11537
+ * Endpoint: `GET /api/v1/mining/reward-stats/{block_count}`
11538
+ *
11539
+ * @param {number} block_count - Number of recent blocks to include
11540
+ * @param {{ signal?: AbortSignal, onValue?: (value: RewardStats) => void }} [options]
11541
+ * @returns {Promise<RewardStats>}
11262
11542
  */
11263
- async getPreciseFees({ signal, onUpdate } = {}) {
11264
- const path = `/api/v1/fees/precise`;
11265
- return this.getJson(path, { signal, onUpdate });
11543
+ async getRewardStats(block_count, { signal, onValue } = {}) {
11544
+ const path = `/api/v1/mining/reward-stats/${block_count}`;
11545
+ return this.getJson(path, { signal, onValue });
11266
11546
  }
11267
11547
 
11268
11548
  /**
11269
- * Recommended fees
11549
+ * Block fees
11270
11550
  *
11271
- * Get recommended fee rates for different confirmation targets.
11551
+ * Get average total fees per block for a time period. Valid periods: `24h`, `3d`, `1w`, `1m`, `3m`, `6m`, `1y`, `2y`, `3y`.
11272
11552
  *
11273
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-recommended-fees)*
11553
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-fees)*
11274
11554
  *
11275
- * Endpoint: `GET /api/v1/fees/recommended`
11276
- * @param {{ signal?: AbortSignal, onUpdate?: (value: RecommendedFees) => void }} [options]
11277
- * @returns {Promise<RecommendedFees>}
11555
+ * Endpoint: `GET /api/v1/mining/blocks/fees/{time_period}`
11556
+ *
11557
+ * @param {TimePeriod} time_period
11558
+ * @param {{ signal?: AbortSignal, onValue?: (value: BlockFeesEntry[]) => void }} [options]
11559
+ * @returns {Promise<BlockFeesEntry[]>}
11278
11560
  */
11279
- async getRecommendedFees({ signal, onUpdate } = {}) {
11280
- const path = `/api/v1/fees/recommended`;
11281
- return this.getJson(path, { signal, onUpdate });
11561
+ async getBlockFees(time_period, { signal, onValue } = {}) {
11562
+ const path = `/api/v1/mining/blocks/fees/${time_period}`;
11563
+ return this.getJson(path, { signal, onValue });
11282
11564
  }
11283
11565
 
11284
11566
  /**
11285
- * Historical price
11567
+ * Block rewards
11286
11568
  *
11287
- * Get historical BTC/USD price. Optionally specify a UNIX timestamp to get the price at that time.
11569
+ * Get average coinbase reward (subsidy + fees) per block for a time period. Valid periods: `24h`, `3d`, `1w`, `1m`, `3m`, `6m`, `1y`, `2y`, `3y`.
11288
11570
  *
11289
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-historical-price)*
11571
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-rewards)*
11290
11572
  *
11291
- * Endpoint: `GET /api/v1/historical-price`
11573
+ * Endpoint: `GET /api/v1/mining/blocks/rewards/{time_period}`
11292
11574
  *
11293
- * @param {Timestamp=} [timestamp]
11294
- * @param {{ signal?: AbortSignal, onUpdate?: (value: HistoricalPrice) => void }} [options]
11295
- * @returns {Promise<HistoricalPrice>}
11575
+ * @param {TimePeriod} time_period
11576
+ * @param {{ signal?: AbortSignal, onValue?: (value: BlockRewardsEntry[]) => void }} [options]
11577
+ * @returns {Promise<BlockRewardsEntry[]>}
11296
11578
  */
11297
- async getHistoricalPrice(timestamp, { signal, onUpdate } = {}) {
11298
- const params = new URLSearchParams();
11299
- if (timestamp !== undefined) params.set('timestamp', String(timestamp));
11300
- const query = params.toString();
11301
- const path = `/api/v1/historical-price${query ? '?' + query : ''}`;
11302
- return this.getJson(path, { signal, onUpdate });
11579
+ async getBlockRewards(time_period, { signal, onValue } = {}) {
11580
+ const path = `/api/v1/mining/blocks/rewards/${time_period}`;
11581
+ return this.getJson(path, { signal, onValue });
11303
11582
  }
11304
11583
 
11305
11584
  /**
@@ -11312,393 +11591,422 @@ class BrkClient extends BrkClientBase {
11312
11591
  * Endpoint: `GET /api/v1/mining/blocks/fee-rates/{time_period}`
11313
11592
  *
11314
11593
  * @param {TimePeriod} time_period
11315
- * @param {{ signal?: AbortSignal, onUpdate?: (value: BlockFeeRatesEntry[]) => void }} [options]
11594
+ * @param {{ signal?: AbortSignal, onValue?: (value: BlockFeeRatesEntry[]) => void }} [options]
11316
11595
  * @returns {Promise<BlockFeeRatesEntry[]>}
11317
11596
  */
11318
- async getBlockFeeRates(time_period, { signal, onUpdate } = {}) {
11597
+ async getBlockFeeRates(time_period, { signal, onValue } = {}) {
11319
11598
  const path = `/api/v1/mining/blocks/fee-rates/${time_period}`;
11320
- return this.getJson(path, { signal, onUpdate });
11599
+ return this.getJson(path, { signal, onValue });
11321
11600
  }
11322
11601
 
11323
11602
  /**
11324
- * Block fees
11603
+ * Block sizes and weights
11325
11604
  *
11326
- * Get average total fees per block for a time period. Valid periods: `24h`, `3d`, `1w`, `1m`, `3m`, `6m`, `1y`, `2y`, `3y`.
11605
+ * Get average block sizes and weights for a time period. Valid periods: `24h`, `3d`, `1w`, `1m`, `3m`, `6m`, `1y`, `2y`, `3y`.
11327
11606
  *
11328
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-fees)*
11607
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-sizes-weights)*
11329
11608
  *
11330
- * Endpoint: `GET /api/v1/mining/blocks/fees/{time_period}`
11609
+ * Endpoint: `GET /api/v1/mining/blocks/sizes-weights/{time_period}`
11331
11610
  *
11332
11611
  * @param {TimePeriod} time_period
11333
- * @param {{ signal?: AbortSignal, onUpdate?: (value: BlockFeesEntry[]) => void }} [options]
11334
- * @returns {Promise<BlockFeesEntry[]>}
11612
+ * @param {{ signal?: AbortSignal, onValue?: (value: BlockSizesWeights) => void }} [options]
11613
+ * @returns {Promise<BlockSizesWeights>}
11335
11614
  */
11336
- async getBlockFees(time_period, { signal, onUpdate } = {}) {
11337
- const path = `/api/v1/mining/blocks/fees/${time_period}`;
11338
- return this.getJson(path, { signal, onUpdate });
11615
+ async getBlockSizesWeights(time_period, { signal, onValue } = {}) {
11616
+ const path = `/api/v1/mining/blocks/sizes-weights/${time_period}`;
11617
+ return this.getJson(path, { signal, onValue });
11339
11618
  }
11340
11619
 
11341
11620
  /**
11342
- * Block rewards
11621
+ * Projected mempool blocks
11343
11622
  *
11344
- * Get average coinbase reward (subsidy + fees) per block for a time period. Valid periods: `24h`, `3d`, `1w`, `1m`, `3m`, `6m`, `1y`, `2y`, `3y`.
11623
+ * Get projected blocks from the mempool for fee estimation.
11345
11624
  *
11346
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-rewards)*
11625
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-mempool-blocks-fees)*
11347
11626
  *
11348
- * Endpoint: `GET /api/v1/mining/blocks/rewards/{time_period}`
11627
+ * Endpoint: `GET /api/v1/fees/mempool-blocks`
11628
+ * @param {{ signal?: AbortSignal, onValue?: (value: MempoolBlock[]) => void }} [options]
11629
+ * @returns {Promise<MempoolBlock[]>}
11630
+ */
11631
+ async getMempoolBlocks({ signal, onValue } = {}) {
11632
+ const path = `/api/v1/fees/mempool-blocks`;
11633
+ return this.getJson(path, { signal, onValue });
11634
+ }
11635
+
11636
+ /**
11637
+ * Recommended fees
11349
11638
  *
11350
- * @param {TimePeriod} time_period
11351
- * @param {{ signal?: AbortSignal, onUpdate?: (value: BlockRewardsEntry[]) => void }} [options]
11352
- * @returns {Promise<BlockRewardsEntry[]>}
11639
+ * Get recommended fee rates for different confirmation targets.
11640
+ *
11641
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-recommended-fees)*
11642
+ *
11643
+ * Endpoint: `GET /api/v1/fees/recommended`
11644
+ * @param {{ signal?: AbortSignal, onValue?: (value: RecommendedFees) => void }} [options]
11645
+ * @returns {Promise<RecommendedFees>}
11353
11646
  */
11354
- async getBlockRewards(time_period, { signal, onUpdate } = {}) {
11355
- const path = `/api/v1/mining/blocks/rewards/${time_period}`;
11356
- return this.getJson(path, { signal, onUpdate });
11647
+ async getRecommendedFees({ signal, onValue } = {}) {
11648
+ const path = `/api/v1/fees/recommended`;
11649
+ return this.getJson(path, { signal, onValue });
11357
11650
  }
11358
11651
 
11359
11652
  /**
11360
- * Block sizes and weights
11653
+ * Precise recommended fees
11361
11654
  *
11362
- * Get average block sizes and weights for a time period. Valid periods: `24h`, `3d`, `1w`, `1m`, `3m`, `6m`, `1y`, `2y`, `3y`.
11655
+ * Get recommended fee rates with up to 3 decimal places.
11656
+ *
11657
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-recommended-fees-precise)*
11658
+ *
11659
+ * Endpoint: `GET /api/v1/fees/precise`
11660
+ * @param {{ signal?: AbortSignal, onValue?: (value: RecommendedFees) => void }} [options]
11661
+ * @returns {Promise<RecommendedFees>}
11662
+ */
11663
+ async getPreciseFees({ signal, onValue } = {}) {
11664
+ const path = `/api/v1/fees/precise`;
11665
+ return this.getJson(path, { signal, onValue });
11666
+ }
11667
+
11668
+ /**
11669
+ * Mempool statistics
11363
11670
  *
11364
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-sizes-weights)*
11671
+ * Get current mempool statistics including transaction count, total vsize, total fees, and fee histogram.
11365
11672
  *
11366
- * Endpoint: `GET /api/v1/mining/blocks/sizes-weights/{time_period}`
11673
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-mempool)*
11367
11674
  *
11368
- * @param {TimePeriod} time_period
11369
- * @param {{ signal?: AbortSignal, onUpdate?: (value: BlockSizesWeights) => void }} [options]
11370
- * @returns {Promise<BlockSizesWeights>}
11675
+ * Endpoint: `GET /api/mempool`
11676
+ * @param {{ signal?: AbortSignal, onValue?: (value: MempoolInfo) => void }} [options]
11677
+ * @returns {Promise<MempoolInfo>}
11371
11678
  */
11372
- async getBlockSizesWeights(time_period, { signal, onUpdate } = {}) {
11373
- const path = `/api/v1/mining/blocks/sizes-weights/${time_period}`;
11374
- return this.getJson(path, { signal, onUpdate });
11679
+ async getMempool({ signal, onValue } = {}) {
11680
+ const path = `/api/mempool`;
11681
+ return this.getJson(path, { signal, onValue });
11375
11682
  }
11376
11683
 
11377
11684
  /**
11378
- * Block by timestamp
11379
- *
11380
- * Find the block closest to a given UNIX timestamp.
11685
+ * Mempool content hash
11381
11686
  *
11382
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-timestamp)*
11383
- *
11384
- * Endpoint: `GET /api/v1/mining/blocks/timestamp/{timestamp}`
11687
+ * Returns an opaque `u64` that changes whenever the projected next block changes. Same value as the mempool ETag. Useful as a freshness/liveness signal: if it stays constant for tens of seconds on a live network, the mempool sync loop has stalled.
11385
11688
  *
11386
- * @param {Timestamp} timestamp
11387
- * @param {{ signal?: AbortSignal, onUpdate?: (value: BlockTimestamp) => void }} [options]
11388
- * @returns {Promise<BlockTimestamp>}
11689
+ * Endpoint: `GET /api/mempool/hash`
11690
+ * @param {{ signal?: AbortSignal, onValue?: (value: number) => void }} [options]
11691
+ * @returns {Promise<number>}
11389
11692
  */
11390
- async getBlockByTimestamp(timestamp, { signal, onUpdate } = {}) {
11391
- const path = `/api/v1/mining/blocks/timestamp/${timestamp}`;
11392
- return this.getJson(path, { signal, onUpdate });
11693
+ async getMempoolHash({ signal, onValue } = {}) {
11694
+ const path = `/api/mempool/hash`;
11695
+ return this.getJson(path, { signal, onValue });
11393
11696
  }
11394
11697
 
11395
11698
  /**
11396
- * Difficulty adjustments (all time)
11699
+ * Mempool transaction IDs
11397
11700
  *
11398
- * Get historical difficulty adjustments including timestamp, block height, difficulty value, and percentage change.
11701
+ * Get all transaction IDs currently in the mempool.
11399
11702
  *
11400
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-difficulty-adjustments)*
11703
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-mempool-transaction-ids)*
11401
11704
  *
11402
- * Endpoint: `GET /api/v1/mining/difficulty-adjustments`
11403
- * @param {{ signal?: AbortSignal, onUpdate?: (value: DifficultyAdjustmentEntry[]) => void }} [options]
11404
- * @returns {Promise<DifficultyAdjustmentEntry[]>}
11705
+ * Endpoint: `GET /api/mempool/txids`
11706
+ * @param {{ signal?: AbortSignal, onValue?: (value: Txid[]) => void }} [options]
11707
+ * @returns {Promise<Txid[]>}
11405
11708
  */
11406
- async getDifficultyAdjustments({ signal, onUpdate } = {}) {
11407
- const path = `/api/v1/mining/difficulty-adjustments`;
11408
- return this.getJson(path, { signal, onUpdate });
11709
+ async getMempoolTxids({ signal, onValue } = {}) {
11710
+ const path = `/api/mempool/txids`;
11711
+ return this.getJson(path, { signal, onValue });
11409
11712
  }
11410
11713
 
11411
11714
  /**
11412
- * Difficulty adjustments
11413
- *
11414
- * Get historical difficulty adjustments for a time period. Valid periods: `24h`, `3d`, `1w`, `1m`, `3m`, `6m`, `1y`, `2y`, `3y`.
11715
+ * Recent mempool transactions
11415
11716
  *
11416
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-difficulty-adjustments)*
11717
+ * Get the last 10 transactions to enter the mempool.
11417
11718
  *
11418
- * Endpoint: `GET /api/v1/mining/difficulty-adjustments/{time_period}`
11719
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-mempool-recent)*
11419
11720
  *
11420
- * @param {TimePeriod} time_period
11421
- * @param {{ signal?: AbortSignal, onUpdate?: (value: DifficultyAdjustmentEntry[]) => void }} [options]
11422
- * @returns {Promise<DifficultyAdjustmentEntry[]>}
11721
+ * Endpoint: `GET /api/mempool/recent`
11722
+ * @param {{ signal?: AbortSignal, onValue?: (value: MempoolRecentTx[]) => void }} [options]
11723
+ * @returns {Promise<MempoolRecentTx[]>}
11423
11724
  */
11424
- async getDifficultyAdjustmentsByPeriod(time_period, { signal, onUpdate } = {}) {
11425
- const path = `/api/v1/mining/difficulty-adjustments/${time_period}`;
11426
- return this.getJson(path, { signal, onUpdate });
11725
+ async getMempoolRecent({ signal, onValue } = {}) {
11726
+ const path = `/api/mempool/recent`;
11727
+ return this.getJson(path, { signal, onValue });
11427
11728
  }
11428
11729
 
11429
11730
  /**
11430
- * Network hashrate (all time)
11731
+ * Recent RBF replacements
11431
11732
  *
11432
- * Get network hashrate and difficulty data for all time.
11733
+ * Returns up to 25 most-recent RBF replacement trees across the whole mempool. Each entry has the same shape as `tx_rbf().replacements`.
11433
11734
  *
11434
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-hashrate)*
11735
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-replacements)*
11435
11736
  *
11436
- * Endpoint: `GET /api/v1/mining/hashrate`
11437
- * @param {{ signal?: AbortSignal, onUpdate?: (value: HashrateSummary) => void }} [options]
11438
- * @returns {Promise<HashrateSummary>}
11737
+ * Endpoint: `GET /api/v1/replacements`
11738
+ * @param {{ signal?: AbortSignal, onValue?: (value: ReplacementNode[]) => void }} [options]
11739
+ * @returns {Promise<ReplacementNode[]>}
11439
11740
  */
11440
- async getHashrate({ signal, onUpdate } = {}) {
11441
- const path = `/api/v1/mining/hashrate`;
11442
- return this.getJson(path, { signal, onUpdate });
11741
+ async getReplacements({ signal, onValue } = {}) {
11742
+ const path = `/api/v1/replacements`;
11743
+ return this.getJson(path, { signal, onValue });
11443
11744
  }
11444
11745
 
11445
11746
  /**
11446
- * All pools hashrate (all time)
11747
+ * Recent full-RBF replacements
11447
11748
  *
11448
- * Get hashrate data for all mining pools.
11749
+ * Like `/api/v1/replacements`, but limited to trees where at least one predecessor was non-signaling (full-RBF).
11449
11750
  *
11450
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-mining-pool-hashrates)*
11751
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-fullrbf-replacements)*
11451
11752
  *
11452
- * Endpoint: `GET /api/v1/mining/hashrate/pools`
11453
- * @param {{ signal?: AbortSignal, onUpdate?: (value: PoolHashrateEntry[]) => void }} [options]
11454
- * @returns {Promise<PoolHashrateEntry[]>}
11753
+ * Endpoint: `GET /api/v1/fullrbf/replacements`
11754
+ * @param {{ signal?: AbortSignal, onValue?: (value: ReplacementNode[]) => void }} [options]
11755
+ * @returns {Promise<ReplacementNode[]>}
11455
11756
  */
11456
- async getPoolsHashrate({ signal, onUpdate } = {}) {
11457
- const path = `/api/v1/mining/hashrate/pools`;
11458
- return this.getJson(path, { signal, onUpdate });
11757
+ async getFullrbfReplacements({ signal, onValue } = {}) {
11758
+ const path = `/api/v1/fullrbf/replacements`;
11759
+ return this.getJson(path, { signal, onValue });
11459
11760
  }
11460
11761
 
11461
11762
  /**
11462
- * All pools hashrate
11463
- *
11464
- * Get hashrate data for all mining pools for a time period. Valid periods: `1m`, `3m`, `6m`, `1y`, `2y`, `3y`.
11465
- *
11466
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-mining-pool-hashrates)*
11763
+ * Live BTC/USD price
11467
11764
  *
11468
- * Endpoint: `GET /api/v1/mining/hashrate/pools/{time_period}`
11765
+ * Returns the current BTC/USD price in dollars, derived from on-chain round-dollar output patterns in the last 12 blocks plus mempool.
11469
11766
  *
11470
- * @param {TimePeriod} time_period
11471
- * @param {{ signal?: AbortSignal, onUpdate?: (value: PoolHashrateEntry[]) => void }} [options]
11472
- * @returns {Promise<PoolHashrateEntry[]>}
11767
+ * Endpoint: `GET /api/mempool/price`
11768
+ * @param {{ signal?: AbortSignal, onValue?: (value: Dollars) => void }} [options]
11769
+ * @returns {Promise<Dollars>}
11473
11770
  */
11474
- async getPoolsHashrateByPeriod(time_period, { signal, onUpdate } = {}) {
11475
- const path = `/api/v1/mining/hashrate/pools/${time_period}`;
11476
- return this.getJson(path, { signal, onUpdate });
11771
+ async getLivePrice({ signal, onValue } = {}) {
11772
+ const path = `/api/mempool/price`;
11773
+ return this.getJson(path, { signal, onValue });
11477
11774
  }
11478
11775
 
11479
11776
  /**
11480
- * Network hashrate
11481
- *
11482
- * Get network hashrate and difficulty data for a time period. Valid periods: `24h`, `3d`, `1w`, `1m`, `3m`, `6m`, `1y`, `2y`, `3y`.
11777
+ * Txid by index
11483
11778
  *
11484
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-hashrate)*
11779
+ * Retrieve the transaction ID (txid) at a given global transaction index. Returns the txid as plain text.
11485
11780
  *
11486
- * Endpoint: `GET /api/v1/mining/hashrate/{time_period}`
11781
+ * Endpoint: `GET /api/tx-index/{index}`
11487
11782
  *
11488
- * @param {TimePeriod} time_period
11489
- * @param {{ signal?: AbortSignal, onUpdate?: (value: HashrateSummary) => void }} [options]
11490
- * @returns {Promise<HashrateSummary>}
11783
+ * @param {TxIndex} index
11784
+ * @param {{ signal?: AbortSignal, onValue?: (value: Txid) => void }} [options]
11785
+ * @returns {Promise<Txid>}
11491
11786
  */
11492
- async getHashrateByPeriod(time_period, { signal, onUpdate } = {}) {
11493
- const path = `/api/v1/mining/hashrate/${time_period}`;
11494
- return this.getJson(path, { signal, onUpdate });
11787
+ async getTxByIndex(index, { signal, onValue } = {}) {
11788
+ const path = `/api/tx-index/${index}`;
11789
+ return this.getText(path, { signal, onValue });
11495
11790
  }
11496
11791
 
11497
11792
  /**
11498
- * Mining pool details
11793
+ * CPFP info
11499
11794
  *
11500
- * Get detailed information about a specific mining pool including block counts and shares for different time periods.
11795
+ * Returns ancestors and descendants for a CPFP (Child Pays For Parent) transaction, including the effective fee rate of the package.
11501
11796
  *
11502
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-mining-pool)*
11797
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-children-pay-for-parent)*
11503
11798
  *
11504
- * Endpoint: `GET /api/v1/mining/pool/{slug}`
11799
+ * Endpoint: `GET /api/v1/cpfp/{txid}`
11505
11800
  *
11506
- * @param {PoolSlug} slug
11507
- * @param {{ signal?: AbortSignal, onUpdate?: (value: PoolDetail) => void }} [options]
11508
- * @returns {Promise<PoolDetail>}
11801
+ * @param {Txid} txid
11802
+ * @param {{ signal?: AbortSignal, onValue?: (value: CpfpInfo) => void }} [options]
11803
+ * @returns {Promise<CpfpInfo>}
11509
11804
  */
11510
- async getPool(slug, { signal, onUpdate } = {}) {
11511
- const path = `/api/v1/mining/pool/${slug}`;
11512
- return this.getJson(path, { signal, onUpdate });
11805
+ async getCpfp(txid, { signal, onValue } = {}) {
11806
+ const path = `/api/v1/cpfp/${txid}`;
11807
+ return this.getJson(path, { signal, onValue });
11513
11808
  }
11514
11809
 
11515
11810
  /**
11516
- * Mining pool blocks
11811
+ * RBF replacement history
11517
11812
  *
11518
- * Get the 10 most recent blocks mined by a specific pool.
11813
+ * Returns the RBF replacement tree for a transaction, if any. Both `replacements` and `replaces` are null when the tx has no known RBF history within the mempool monitor's retention window.
11519
11814
  *
11520
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-mining-pool-blocks)*
11815
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-transaction-rbf-history)*
11521
11816
  *
11522
- * Endpoint: `GET /api/v1/mining/pool/{slug}/blocks`
11817
+ * Endpoint: `GET /api/v1/tx/{txid}/rbf`
11523
11818
  *
11524
- * @param {PoolSlug} slug
11525
- * @param {{ signal?: AbortSignal, onUpdate?: (value: BlockInfoV1[]) => void }} [options]
11526
- * @returns {Promise<BlockInfoV1[]>}
11819
+ * @param {Txid} txid
11820
+ * @param {{ signal?: AbortSignal, onValue?: (value: RbfResponse) => void }} [options]
11821
+ * @returns {Promise<RbfResponse>}
11527
11822
  */
11528
- async getPoolBlocks(slug, { signal, onUpdate } = {}) {
11529
- const path = `/api/v1/mining/pool/${slug}/blocks`;
11530
- return this.getJson(path, { signal, onUpdate });
11823
+ async getTxRbf(txid, { signal, onValue } = {}) {
11824
+ const path = `/api/v1/tx/${txid}/rbf`;
11825
+ return this.getJson(path, { signal, onValue });
11531
11826
  }
11532
11827
 
11533
11828
  /**
11534
- * Mining pool blocks from height
11829
+ * Transaction information
11535
11830
  *
11536
- * Get 10 blocks mined by a specific pool before (and including) the given height.
11831
+ * Retrieve complete transaction data by transaction ID (txid). Returns inputs, outputs, fee, size, and confirmation status.
11537
11832
  *
11538
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-mining-pool-blocks)*
11833
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-transaction)*
11539
11834
  *
11540
- * Endpoint: `GET /api/v1/mining/pool/{slug}/blocks/{height}`
11835
+ * Endpoint: `GET /api/tx/{txid}`
11541
11836
  *
11542
- * @param {PoolSlug} slug
11543
- * @param {Height} height
11544
- * @param {{ signal?: AbortSignal, onUpdate?: (value: BlockInfoV1[]) => void }} [options]
11545
- * @returns {Promise<BlockInfoV1[]>}
11837
+ * @param {Txid} txid
11838
+ * @param {{ signal?: AbortSignal, onValue?: (value: Transaction) => void }} [options]
11839
+ * @returns {Promise<Transaction>}
11546
11840
  */
11547
- async getPoolBlocksFrom(slug, height, { signal, onUpdate } = {}) {
11548
- const path = `/api/v1/mining/pool/${slug}/blocks/${height}`;
11549
- return this.getJson(path, { signal, onUpdate });
11841
+ async getTx(txid, { signal, onValue } = {}) {
11842
+ const path = `/api/tx/${txid}`;
11843
+ return this.getJson(path, { signal, onValue });
11550
11844
  }
11551
11845
 
11552
11846
  /**
11553
- * Mining pool hashrate
11847
+ * Transaction hex
11554
11848
  *
11555
- * Get hashrate history for a specific mining pool.
11849
+ * Retrieve the raw transaction as a hex-encoded string. Returns the serialized transaction in hexadecimal format.
11556
11850
  *
11557
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-mining-pool-hashrate)*
11851
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-transaction-hex)*
11558
11852
  *
11559
- * Endpoint: `GET /api/v1/mining/pool/{slug}/hashrate`
11853
+ * Endpoint: `GET /api/tx/{txid}/hex`
11560
11854
  *
11561
- * @param {PoolSlug} slug
11562
- * @param {{ signal?: AbortSignal, onUpdate?: (value: PoolHashrateEntry[]) => void }} [options]
11563
- * @returns {Promise<PoolHashrateEntry[]>}
11855
+ * @param {Txid} txid
11856
+ * @param {{ signal?: AbortSignal, onValue?: (value: Hex) => void }} [options]
11857
+ * @returns {Promise<Hex>}
11564
11858
  */
11565
- async getPoolHashrate(slug, { signal, onUpdate } = {}) {
11566
- const path = `/api/v1/mining/pool/${slug}/hashrate`;
11567
- return this.getJson(path, { signal, onUpdate });
11859
+ async getTxHex(txid, { signal, onValue } = {}) {
11860
+ const path = `/api/tx/${txid}/hex`;
11861
+ return this.getText(path, { signal, onValue });
11568
11862
  }
11569
11863
 
11570
11864
  /**
11571
- * List all mining pools
11865
+ * Transaction merkleblock proof
11572
11866
  *
11573
- * Get list of all known mining pools with their identifiers.
11867
+ * Get the merkleblock proof for a transaction (BIP37 format, hex encoded).
11574
11868
  *
11575
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-mining-pools)*
11869
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-transaction-merkleblock-proof)*
11576
11870
  *
11577
- * Endpoint: `GET /api/v1/mining/pools`
11578
- * @param {{ signal?: AbortSignal, onUpdate?: (value: PoolInfo[]) => void }} [options]
11579
- * @returns {Promise<PoolInfo[]>}
11871
+ * Endpoint: `GET /api/tx/{txid}/merkleblock-proof`
11872
+ *
11873
+ * @param {Txid} txid
11874
+ * @param {{ signal?: AbortSignal, onValue?: (value: Hex) => void }} [options]
11875
+ * @returns {Promise<Hex>}
11580
11876
  */
11581
- async getPools({ signal, onUpdate } = {}) {
11582
- const path = `/api/v1/mining/pools`;
11583
- return this.getJson(path, { signal, onUpdate });
11877
+ async getTxMerkleblockProof(txid, { signal, onValue } = {}) {
11878
+ const path = `/api/tx/${txid}/merkleblock-proof`;
11879
+ return this.getText(path, { signal, onValue });
11584
11880
  }
11585
11881
 
11586
11882
  /**
11587
- * Mining pool statistics
11883
+ * Transaction merkle proof
11588
11884
  *
11589
- * Get mining pool statistics for a time period. Valid periods: `24h`, `3d`, `1w`, `1m`, `3m`, `6m`, `1y`, `2y`, `3y`.
11885
+ * Get the merkle inclusion proof for a transaction.
11590
11886
  *
11591
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-mining-pools)*
11887
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-transaction-merkle-proof)*
11592
11888
  *
11593
- * Endpoint: `GET /api/v1/mining/pools/{time_period}`
11889
+ * Endpoint: `GET /api/tx/{txid}/merkle-proof`
11594
11890
  *
11595
- * @param {TimePeriod} time_period
11596
- * @param {{ signal?: AbortSignal, onUpdate?: (value: PoolsSummary) => void }} [options]
11597
- * @returns {Promise<PoolsSummary>}
11891
+ * @param {Txid} txid
11892
+ * @param {{ signal?: AbortSignal, onValue?: (value: MerkleProof) => void }} [options]
11893
+ * @returns {Promise<MerkleProof>}
11598
11894
  */
11599
- async getPoolStats(time_period, { signal, onUpdate } = {}) {
11600
- const path = `/api/v1/mining/pools/${time_period}`;
11601
- return this.getJson(path, { signal, onUpdate });
11895
+ async getTxMerkleProof(txid, { signal, onValue } = {}) {
11896
+ const path = `/api/tx/${txid}/merkle-proof`;
11897
+ return this.getJson(path, { signal, onValue });
11602
11898
  }
11603
11899
 
11604
11900
  /**
11605
- * Mining reward statistics
11901
+ * Output spend status
11606
11902
  *
11607
- * Get mining reward statistics for the last N blocks including total rewards, fees, and transaction count.
11903
+ * Get the spending status of a transaction output. Returns whether the output has been spent and, if so, the spending transaction details.
11608
11904
  *
11609
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-reward-stats)*
11905
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-transaction-outspend)*
11610
11906
  *
11611
- * Endpoint: `GET /api/v1/mining/reward-stats/{block_count}`
11907
+ * Endpoint: `GET /api/tx/{txid}/outspend/{vout}`
11612
11908
  *
11613
- * @param {number} block_count - Number of recent blocks to include
11614
- * @param {{ signal?: AbortSignal, onUpdate?: (value: RewardStats) => void }} [options]
11615
- * @returns {Promise<RewardStats>}
11909
+ * @param {Txid} txid - Transaction ID
11910
+ * @param {Vout} vout - Output index
11911
+ * @param {{ signal?: AbortSignal, onValue?: (value: TxOutspend) => void }} [options]
11912
+ * @returns {Promise<TxOutspend>}
11616
11913
  */
11617
- async getRewardStats(block_count, { signal, onUpdate } = {}) {
11618
- const path = `/api/v1/mining/reward-stats/${block_count}`;
11619
- return this.getJson(path, { signal, onUpdate });
11914
+ async getTxOutspend(txid, vout, { signal, onValue } = {}) {
11915
+ const path = `/api/tx/${txid}/outspend/${vout}`;
11916
+ return this.getJson(path, { signal, onValue });
11620
11917
  }
11621
11918
 
11622
11919
  /**
11623
- * Current BTC price
11920
+ * All output spend statuses
11624
11921
  *
11625
- * Returns bitcoin latest price (on-chain derived, USD only).
11922
+ * Get the spending status of all outputs in a transaction. Returns an array with the spend status for each output.
11626
11923
  *
11627
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-price)*
11924
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-transaction-outspends)*
11628
11925
  *
11629
- * Endpoint: `GET /api/v1/prices`
11630
- * @param {{ signal?: AbortSignal, onUpdate?: (value: Prices) => void }} [options]
11631
- * @returns {Promise<Prices>}
11926
+ * Endpoint: `GET /api/tx/{txid}/outspends`
11927
+ *
11928
+ * @param {Txid} txid
11929
+ * @param {{ signal?: AbortSignal, onValue?: (value: TxOutspend[]) => void }} [options]
11930
+ * @returns {Promise<TxOutspend[]>}
11632
11931
  */
11633
- async getPrices({ signal, onUpdate } = {}) {
11634
- const path = `/api/v1/prices`;
11635
- return this.getJson(path, { signal, onUpdate });
11932
+ async getTxOutspends(txid, { signal, onValue } = {}) {
11933
+ const path = `/api/tx/${txid}/outspends`;
11934
+ return this.getJson(path, { signal, onValue });
11636
11935
  }
11637
11936
 
11638
11937
  /**
11639
- * Transaction first-seen times
11938
+ * Transaction raw
11640
11939
  *
11641
- * Returns timestamps when transactions were first seen in the mempool. Returns 0 for mined or unknown transactions.
11940
+ * Returns a transaction as binary data.
11642
11941
  *
11643
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-transaction-times)*
11942
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-transaction-raw)*
11644
11943
  *
11645
- * Endpoint: `GET /api/v1/transaction-times`
11646
- * @param {{ signal?: AbortSignal, onUpdate?: (value: number[]) => void }} [options]
11647
- * @returns {Promise<number[]>}
11944
+ * Endpoint: `GET /api/tx/{txid}/raw`
11945
+ *
11946
+ * @param {Txid} txid
11947
+ * @param {{ signal?: AbortSignal, onValue?: (value: Uint8Array) => void }} [options]
11948
+ * @returns {Promise<Uint8Array>}
11648
11949
  */
11649
- async getTransactionTimes({ signal, onUpdate } = {}) {
11650
- const path = `/api/v1/transaction-times`;
11651
- return this.getJson(path, { signal, onUpdate });
11950
+ async getTxRaw(txid, { signal, onValue } = {}) {
11951
+ const path = `/api/tx/${txid}/raw`;
11952
+ return this.getBytes(path, { signal, onValue });
11652
11953
  }
11653
11954
 
11654
11955
  /**
11655
- * RBF replacement history
11956
+ * Transaction status
11656
11957
  *
11657
- * Returns the RBF replacement tree for a transaction, if any. Both `replacements` and `replaces` are null when the tx has no known RBF history within the mempool monitor's retention window.
11958
+ * Retrieve the confirmation status of a transaction. Returns whether the transaction is confirmed and, if so, the block height, hash, and timestamp.
11658
11959
  *
11659
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-transaction-rbf-history)*
11960
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-transaction-status)*
11660
11961
  *
11661
- * Endpoint: `GET /api/v1/tx/{txid}/rbf`
11962
+ * Endpoint: `GET /api/tx/{txid}/status`
11662
11963
  *
11663
11964
  * @param {Txid} txid
11664
- * @param {{ signal?: AbortSignal, onUpdate?: (value: RbfResponse) => void }} [options]
11665
- * @returns {Promise<RbfResponse>}
11965
+ * @param {{ signal?: AbortSignal, onValue?: (value: TxStatus) => void }} [options]
11966
+ * @returns {Promise<TxStatus>}
11666
11967
  */
11667
- async getTxRbf(txid, { signal, onUpdate } = {}) {
11668
- const path = `/api/v1/tx/${txid}/rbf`;
11669
- return this.getJson(path, { signal, onUpdate });
11968
+ async getTxStatus(txid, { signal, onValue } = {}) {
11969
+ const path = `/api/tx/${txid}/status`;
11970
+ return this.getJson(path, { signal, onValue });
11670
11971
  }
11671
11972
 
11672
11973
  /**
11673
- * Validate address
11974
+ * Transaction first-seen times
11674
11975
  *
11675
- * Validate a Bitcoin address and get information about its type and scriptPubKey. Returns `isvalid: false` with an error message for invalid addresses.
11976
+ * Returns timestamps when transactions were first seen in the mempool. Returns 0 for mined or unknown transactions.
11676
11977
  *
11677
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-address-validate)*
11978
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-transaction-times)*
11678
11979
  *
11679
- * Endpoint: `GET /api/v1/validate-address/{address}`
11980
+ * Endpoint: `GET /api/v1/transaction-times`
11680
11981
  *
11681
- * @param {string} address - Bitcoin address to validate (can be any string)
11682
- * @param {{ signal?: AbortSignal, onUpdate?: (value: AddrValidation) => void }} [options]
11683
- * @returns {Promise<AddrValidation>}
11982
+ * @param {Txid[]} txId - Transaction IDs to look up (max 250 per request).
11983
+ * @param {{ signal?: AbortSignal, onValue?: (value: number[]) => void }} [options]
11984
+ * @returns {Promise<number[]>}
11684
11985
  */
11685
- async validateAddress(address, { signal, onUpdate } = {}) {
11686
- const path = `/api/v1/validate-address/${address}`;
11687
- return this.getJson(path, { signal, onUpdate });
11986
+ async getTransactionTimes(txId, { signal, onValue } = {}) {
11987
+ const params = new URLSearchParams();
11988
+ for (const _v of txId) params.append('txId[]', String(_v));
11989
+ const query = params.toString();
11990
+ const path = `/api/v1/transaction-times${query ? '?' + query : ''}`;
11991
+ return this.getJson(path, { signal, onValue });
11688
11992
  }
11689
11993
 
11690
11994
  /**
11691
- * Health check
11995
+ * Broadcast transaction
11692
11996
  *
11693
- * Returns the health status of the API server, including uptime information.
11997
+ * Broadcast a raw transaction to the network. The transaction should be provided as hex in the request body. The txid will be returned on success.
11694
11998
  *
11695
- * Endpoint: `GET /health`
11696
- * @param {{ signal?: AbortSignal, onUpdate?: (value: Health) => void }} [options]
11697
- * @returns {Promise<Health>}
11999
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#post-transaction)*
12000
+ *
12001
+ * Endpoint: `POST /api/tx`
12002
+ *
12003
+ * @param {string} body - Request body
12004
+ * @param {{ signal?: AbortSignal }} [options]
12005
+ * @returns {Promise<Txid>}
11698
12006
  */
11699
- async getHealth({ signal, onUpdate } = {}) {
11700
- const path = `/health`;
11701
- return this.getJson(path, { signal, onUpdate });
12007
+ async postTx(body, { signal } = {}) {
12008
+ const path = `/api/tx`;
12009
+ return this.postJson(path, body, { signal });
11702
12010
  }
11703
12011
 
11704
12012
  /**
@@ -11707,26 +12015,26 @@ class BrkClient extends BrkClientBase {
11707
12015
  * Full OpenAPI 3.1 specification for this API.
11708
12016
  *
11709
12017
  * Endpoint: `GET /openapi.json`
11710
- * @param {{ signal?: AbortSignal, onUpdate?: (value: *) => void }} [options]
12018
+ * @param {{ signal?: AbortSignal, onValue?: (value: *) => void }} [options]
11711
12019
  * @returns {Promise<*>}
11712
12020
  */
11713
- async getOpenapi({ signal, onUpdate } = {}) {
12021
+ async getOpenapi({ signal, onValue } = {}) {
11714
12022
  const path = `/openapi.json`;
11715
- return this.getText(path, { signal, onUpdate });
12023
+ return this.getText(path, { signal, onValue });
11716
12024
  }
11717
12025
 
11718
12026
  /**
11719
- * API version
12027
+ * Compact OpenAPI specification
11720
12028
  *
11721
- * Returns the current version of the API server
12029
+ * Compact OpenAPI specification optimized for LLM consumption. Removes redundant fields while preserving essential API information. Full spec available at `/openapi.json`.
11722
12030
  *
11723
- * Endpoint: `GET /version`
11724
- * @param {{ signal?: AbortSignal, onUpdate?: (value: string) => void }} [options]
11725
- * @returns {Promise<string>}
12031
+ * Endpoint: `GET /api.json`
12032
+ * @param {{ signal?: AbortSignal, onValue?: (value: *) => void }} [options]
12033
+ * @returns {Promise<*>}
11726
12034
  */
11727
- async getVersion({ signal, onUpdate } = {}) {
11728
- const path = `/version`;
11729
- return this.getJson(path, { signal, onUpdate });
12035
+ async getApi({ signal, onValue } = {}) {
12036
+ const path = `/api.json`;
12037
+ return this.getJson(path, { signal, onValue });
11730
12038
  }
11731
12039
 
11732
12040
  }