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

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