brk-client 0.3.0-beta.6 → 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 +1585 -1271
  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,26 +373,67 @@ 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.
364
378
  *
365
- * @typedef {Object} CpfpEntry
366
- * @property {Txid} txid - Transaction ID
367
- * @property {Weight} weight - Transaction weight
368
- * @property {Sats} fee - Transaction fee (sats)
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.
369
383
  */
370
384
  /**
371
- * CPFP (Child Pays For Parent) information for a transaction
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.
372
388
  *
373
- * @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)
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.
410
+ *
411
+ * @typedef {Object} CpfpEntry
412
+ * @property {Txid} txid
413
+ * @property {Weight} weight
414
+ * @property {Sats} fee
380
415
  */
381
416
  /**
382
- * Data range with output format for API query parameters
417
+ * CPFP (Child Pays For Parent) information for a transaction.
418
+ *
419
+ * @typedef {Object} CpfpInfo
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).
434
+ */
435
+ /**
436
+ * Range parameters with output format for API query parameters.
383
437
  *
384
438
  * @typedef {Object} DataRangeFormat
385
439
  * @property {(RangeIndex|null)=} start - Inclusive start: integer index, date (YYYY-MM-DD), or timestamp (ISO 8601). Negative integers count from end. Aliases: `from`, `f`, `s`
@@ -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")} 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
@@ -6414,6 +6644,7 @@ function createTransferPattern(client, acc) {
6414
6644
  * @property {BlocksDominancePattern} est3lar
6415
6645
  * @property {BlocksDominancePattern} braiinssolo
6416
6646
  * @property {BlocksDominancePattern} solopool
6647
+ * @property {BlocksDominancePattern} noderunners
6417
6648
  */
6418
6649
 
6419
6650
  /**
@@ -7271,7 +7502,7 @@ function createTransferPattern(client, acc) {
7271
7502
  * @extends BrkClientBase
7272
7503
  */
7273
7504
  class BrkClient extends BrkClientBase {
7274
- VERSION = "v0.3.0-beta.6";
7505
+ VERSION = "v0.3.0-beta.8";
7275
7506
 
7276
7507
  INDEXES = /** @type {const} */ ([
7277
7508
  "minute10",
@@ -7310,170 +7541,171 @@ class BrkClient extends BrkClientBase {
7310
7541
  ]);
7311
7542
 
7312
7543
  POOL_ID_TO_POOL_NAME = /** @type {const} */ ({
7313
- "unknown": "Unknown",
7314
- "blockfills": "BlockFills",
7315
- "ultimuspool": "ULTIMUSPOOL",
7316
- "terrapool": "Terra Pool",
7317
- "luxor": "Luxor",
7318
- "onethash": "1THash",
7319
- "btccom": "BTC.com",
7320
- "bitfarms": "Bitfarms",
7321
- "huobipool": "Huobi.pool",
7322
- "wayicn": "WAYI.CN",
7323
- "canoepool": "CanoePool",
7324
- "btctop": "BTC.TOP",
7325
- "bitcoincom": "Bitcoin.com",
7326
- "pool175btc": "175btc",
7327
- "gbminers": "GBMiners",
7328
- "axbt": "A-XBT",
7329
- "asicminer": "ASICMiner",
7330
- "bitminter": "BitMinter",
7331
- "bitcoinrussia": "BitcoinRussia",
7332
- "btcserv": "BTCServ",
7333
- "simplecoinus": "simplecoin.us",
7334
- "btcguild": "BTC Guild",
7335
- "eligius": "Eligius",
7336
- "ozcoin": "OzCoin",
7337
- "eclipsemc": "EclipseMC",
7338
- "maxbtc": "MaxBTC",
7339
- "triplemining": "TripleMining",
7340
- "coinlab": "CoinLab",
7341
- "pool50btc": "50BTC",
7342
- "ghashio": "GHash.IO",
7343
- "stminingcorp": "ST Mining Corp",
7344
- "bitparking": "Bitparking",
7345
- "mmpool": "mmpool",
7346
- "polmine": "Polmine",
7347
- "kncminer": "KnCMiner",
7348
- "bitalo": "Bitalo",
7349
- "f2pool": "F2Pool",
7350
- "hhtt": "HHTT",
7351
- "megabigpower": "MegaBigPower",
7352
- "mtred": "Mt Red",
7353
- "nmcbit": "NMCbit",
7354
- "yourbtcnet": "Yourbtc.net",
7355
- "givemecoins": "Give Me Coins",
7356
- "braiinspool": "Braiins Pool",
7544
+ "aaopool": "AAO Pool",
7357
7545
  "antpool": "AntPool",
7358
- "multicoinco": "MultiCoin.co",
7546
+ "arkpool": "ArkPool",
7547
+ "asicminer": "ASICMiner",
7548
+ "axbt": "A-XBT",
7549
+ "batpool": "BATPOOL",
7550
+ "bcmonster": "BCMonster",
7359
7551
  "bcpoolio": "bcpool.io",
7360
- "cointerra": "Cointerra",
7361
- "kanopool": "KanoPool",
7362
- "solock": "Solo CK",
7363
- "ckpool": "CKPool",
7364
- "nicehash": "NiceHash",
7552
+ "binancepool": "Binance Pool",
7553
+ "bitalo": "Bitalo",
7365
7554
  "bitclub": "BitClub",
7366
7555
  "bitcoinaffiliatenetwork": "Bitcoin Affiliate Network",
7367
- "btcc": "BTCC",
7368
- "bwpool": "BWPool",
7369
- "exxbw": "EXX&BW",
7370
- "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",
7371
7563
  "bitfury": "BitFury",
7372
- "twentyoneinc": "21 Inc.",
7373
- "digitalbtc": "digitalBTC",
7374
- "eightbaochi": "8baochi",
7375
- "mybtccoinpool": "myBTCcoin Pool",
7376
- "tbdice": "TBDice",
7377
- "hashpool": "HASHPOOL",
7378
- "nexious": "Nexious",
7379
- "bravomining": "Bravo Mining",
7380
- "hotpool": "HotPool",
7381
- "okexpool": "OKExPool",
7382
- "bcmonster": "BCMonster",
7383
- "onehash": "1Hash",
7564
+ "bitminter": "BitMinter",
7565
+ "bitparking": "Bitparking",
7566
+ "bitsolo": "Bitsolo",
7384
7567
  "bixin": "Bixin",
7385
- "tatmaspool": "TATMAS Pool",
7386
- "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",
7387
7592
  "connectbtc": "ConnectBTC",
7388
- "batpool": "BATPOOL",
7389
- "waterhole": "Waterhole",
7390
- "dcexploration": "DCExploration",
7391
7593
  "dcex": "DCEX",
7392
- "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",
7393
7608
  "fiftyeightcoin": "58COIN",
7394
- "bitcoinindia": "Bitcoin India",
7395
- "shawnp0wers": "shawnp0wers",
7396
- "phashio": "PHash.IO",
7397
- "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",
7398
7617
  "haozhuzhu": "HAOZHUZHU",
7399
- "sevenpool": "7pool",
7400
- "miningkings": "MiningKings",
7401
7618
  "hashbx": "HashBX",
7402
- "dpool": "DPOOL",
7403
- "rawpool": "Rawpool",
7404
- "haominer": "haominer",
7619
+ "hashpool": "HASHPOOL",
7405
7620
  "helix": "Helix",
7406
- "bitcoinukraine": "Bitcoin-Ukraine",
7407
- "poolin": "Poolin",
7408
- "secretsuperstar": "SecretSuperstar",
7409
- "tigerpoolnet": "tigerpool.net",
7410
- "sigmapoolcom": "Sigmapool.com",
7411
- "okpooltop": "okpool.top",
7621
+ "hhtt": "HHTT",
7622
+ "hotpool": "HotPool",
7412
7623
  "hummerpool": "Hummerpool",
7413
- "tangpool": "Tangpool",
7414
- "bytepool": "BytePool",
7415
- "spiderpool": "SpiderPool",
7416
- "novablock": "NovaBlock",
7417
- "miningcity": "MiningCity",
7418
- "binancepool": "Binance Pool",
7419
- "minerium": "Minerium",
7624
+ "huobipool": "Huobi.pool",
7625
+ "innopolistech": "Innopolis Tech",
7626
+ "kanopool": "KanoPool",
7627
+ "kncminer": "KnCMiner",
7628
+ "kucoinpool": "KuCoinPool",
7420
7629
  "lubiancom": "Lubian.com",
7421
- "okkong": "OKKONG",
7422
- "aaopool": "AAO Pool",
7423
- "emcdpool": "EMCDPool",
7424
- "foundryusa": "Foundry USA",
7425
- "sbicrypto": "SBI Crypto",
7426
- "arkpool": "ArkPool",
7427
- "purebtccom": "PureBTC.COM",
7630
+ "luxor": "Luxor",
7428
7631
  "marapool": "MARA Pool",
7429
- "kucoinpool": "KuCoinPool",
7430
- "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",
7431
7654
  "okminer": "OKMINER",
7432
- "titan": "Titan",
7655
+ "okpooltop": "okpool.top",
7656
+ "onehash": "1Hash",
7657
+ "onem1x": "1M1X",
7658
+ "onethash": "1THash",
7659
+ "ozcoin": "OzCoin",
7660
+ "parasite": "Parasite",
7661
+ "patels": "Patels",
7433
7662
  "pegapool": "PEGA Pool",
7434
- "btcnuggets": "BTC Nuggets",
7435
- "cloudhashing": "CloudHashing",
7436
- "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",
7437
7689
  "telco214": "Telco 214",
7438
- "btcpoolparty": "BTC Pool Party",
7439
- "multipool": "Multipool",
7690
+ "terrapool": "Terra Pool",
7691
+ "tiger": "tiger",
7692
+ "tigerpoolnet": "tigerpool.net",
7693
+ "titan": "Titan",
7440
7694
  "transactioncoinmining": "transactioncoinmining",
7441
- "btcdig": "BTCDig",
7442
7695
  "trickysbtcpool": "Tricky's BTC Pool",
7443
- "btcmp": "BTCMP",
7444
- "eobot": "Eobot",
7696
+ "triplemining": "TripleMining",
7697
+ "twentyoneinc": "21 Inc.",
7698
+ "ultimuspool": "ULTIMUSPOOL",
7699
+ "unknown": "Unknown",
7445
7700
  "unomp": "UNOMP",
7446
- "patels": "Patels",
7447
- "gogreenlight": "GoGreenLight",
7448
- "bitcoinindiapool": "BitcoinIndia",
7449
- "ekanembtc": "EkanemBTC",
7450
- "canoe": "CANOE",
7451
- "tiger": "tiger",
7452
- "onem1x": "1M1X",
7453
- "zulupool": "Zulupool",
7454
- "secpool": "SECPOOL",
7455
- "ocean": "OCEAN",
7701
+ "viabtc": "ViaBTC",
7702
+ "waterhole": "Waterhole",
7703
+ "wayicn": "WAYI.CN",
7456
7704
  "whitepool": "WhitePool",
7457
7705
  "wiz": "wiz",
7458
7706
  "wk057": "wk057",
7459
- "futurebitapollosolo": "FutureBit Apollo Solo",
7460
- "carbonnegative": "Carbon Negative",
7461
- "portlandhodl": "Portland.HODL",
7462
- "phoenix": "Phoenix",
7463
- "neopool": "Neopool",
7464
- "maxipool": "MaxiPool",
7465
- "bitfufupool": "BitFuFuPool",
7466
- "gdpool": "GDPool",
7467
- "miningdutch": "Mining-Dutch",
7468
- "publicpool": "Public Pool",
7469
- "miningsquared": "Mining Squared",
7470
- "innopolistech": "Innopolis Tech",
7471
- "btclab": "BTCLab",
7472
- "parasite": "Parasite",
7473
- "redrockpool": "RedRock Pool",
7474
- "est3lar": "Est3lar",
7475
- "braiinssolo": "Braiins Solo",
7476
- "solopool": "SoloPool.com"
7707
+ "yourbtcnet": "Yourbtc.net",
7708
+ "zulupool": "Zulupool"
7477
7709
  });
7478
7710
 
7479
7711
  TERM_NAMES = /** @type {const} */ ({
@@ -8568,6 +8800,7 @@ class BrkClient extends BrkClientBase {
8568
8800
  rawLocktime: createSeriesPattern19(this, 'raw_locktime'),
8569
8801
  baseSize: createSeriesPattern19(this, 'base_size'),
8570
8802
  totalSize: createSeriesPattern19(this, 'total_size'),
8803
+ totalSigopCost: createSeriesPattern19(this, 'total_sigop_cost'),
8571
8804
  isExplicitlyRbf: createSeriesPattern19(this, 'is_explicitly_rbf'),
8572
8805
  firstTxinIndex: createSeriesPattern19(this, 'first_txin_index'),
8573
8806
  firstTxoutIndex: createSeriesPattern19(this, 'first_txout_index'),
@@ -9550,6 +9783,7 @@ class BrkClient extends BrkClientBase {
9550
9783
  est3lar: createBlocksDominancePattern(this, 'est3lar'),
9551
9784
  braiinssolo: createBlocksDominancePattern(this, 'braiinssolo'),
9552
9785
  solopool: createBlocksDominancePattern(this, 'solopool'),
9786
+ noderunners: createBlocksDominancePattern(this, 'noderunners'),
9553
9787
  },
9554
9788
  },
9555
9789
  prices: {
@@ -10240,1063 +10474,1114 @@ class BrkClient extends BrkClientBase {
10240
10474
  }
10241
10475
 
10242
10476
  /**
10243
- * Compact OpenAPI specification
10477
+ * Health check
10244
10478
  *
10245
- * 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.
10246
10480
  *
10247
- * Endpoint: `GET /api.json`
10248
- * @param {{ signal?: AbortSignal, onUpdate?: (value: *) => void }} [options]
10249
- * @returns {Promise<*>}
10481
+ * Endpoint: `GET /health`
10482
+ * @param {{ signal?: AbortSignal, onValue?: (value: Health) => void }} [options]
10483
+ * @returns {Promise<Health>}
10250
10484
  */
10251
- async getApi({ signal, onUpdate } = {}) {
10252
- const path = `/api.json`;
10253
- return this.getText(path, { signal, onUpdate });
10485
+ async getHealth({ signal, onValue } = {}) {
10486
+ const path = `/health`;
10487
+ return this.getJson(path, { signal, onValue });
10254
10488
  }
10255
10489
 
10256
10490
  /**
10257
- * Address information
10258
- *
10259
- * Retrieve address information including balance and transaction counts. Supports all standard Bitcoin address types (P2PKH, P2SH, P2WPKH, P2WSH, P2TR).
10260
- *
10261
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-address)*
10491
+ * API version
10262
10492
  *
10263
- * Endpoint: `GET /api/address/{address}`
10493
+ * Returns the current version of the API server
10264
10494
  *
10265
- * @param {Addr} address
10266
- * @param {{ signal?: AbortSignal, onUpdate?: (value: AddrStats) => void }} [options]
10267
- * @returns {Promise<AddrStats>}
10495
+ * Endpoint: `GET /version`
10496
+ * @param {{ signal?: AbortSignal, onValue?: (value: string) => void }} [options]
10497
+ * @returns {Promise<string>}
10268
10498
  */
10269
- async getAddress(address, { signal, onUpdate } = {}) {
10270
- const path = `/api/address/${address}`;
10271
- return this.getJson(path, { signal, onUpdate });
10499
+ async getVersion({ signal, onValue } = {}) {
10500
+ const path = `/version`;
10501
+ return this.getJson(path, { signal, onValue });
10272
10502
  }
10273
10503
 
10274
10504
  /**
10275
- * Address transactions
10276
- *
10277
- * 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.
10278
- *
10279
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-address-transactions)*
10505
+ * Sync status
10280
10506
  *
10281
- * 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.
10282
10508
  *
10283
- * @param {Addr} address
10284
- * @param {Txid=} [after_txid] - Txid to paginate from (return transactions before this one)
10285
- * @param {{ signal?: AbortSignal, onUpdate?: (value: Transaction[]) => void }} [options]
10286
- * @returns {Promise<Transaction[]>}
10509
+ * Endpoint: `GET /api/server/sync`
10510
+ * @param {{ signal?: AbortSignal, onValue?: (value: SyncStatus) => void }} [options]
10511
+ * @returns {Promise<SyncStatus>}
10287
10512
  */
10288
- async getAddressTxs(address, after_txid, { signal, onUpdate } = {}) {
10289
- const params = new URLSearchParams();
10290
- if (after_txid !== undefined) params.set('after_txid', String(after_txid));
10291
- const query = params.toString();
10292
- const path = `/api/address/${address}/txs${query ? '?' + query : ''}`;
10293
- return this.getJson(path, { signal, onUpdate });
10513
+ async getSyncStatus({ signal, onValue } = {}) {
10514
+ const path = `/api/server/sync`;
10515
+ return this.getJson(path, { signal, onValue });
10294
10516
  }
10295
10517
 
10296
10518
  /**
10297
- * Address confirmed transactions
10298
- *
10299
- * Get confirmed transactions for an address, 25 per page. Use ?after_txid=<txid> for pagination.
10300
- *
10301
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-address-transactions-chain)*
10519
+ * Disk usage
10302
10520
  *
10303
- * Endpoint: `GET /api/address/{address}/txs/chain`
10521
+ * Returns the disk space used by BRK and Bitcoin data.
10304
10522
  *
10305
- * @param {Addr} address
10306
- * @param {Txid=} [after_txid] - Txid to paginate from (return transactions before this one)
10307
- * @param {{ signal?: AbortSignal, onUpdate?: (value: Transaction[]) => void }} [options]
10308
- * @returns {Promise<Transaction[]>}
10523
+ * Endpoint: `GET /api/server/disk`
10524
+ * @param {{ signal?: AbortSignal, onValue?: (value: DiskUsage) => void }} [options]
10525
+ * @returns {Promise<DiskUsage>}
10309
10526
  */
10310
- async getAddressConfirmedTxs(address, after_txid, { signal, onUpdate } = {}) {
10311
- const params = new URLSearchParams();
10312
- if (after_txid !== undefined) params.set('after_txid', String(after_txid));
10313
- const query = params.toString();
10314
- const path = `/api/address/${address}/txs/chain${query ? '?' + query : ''}`;
10315
- return this.getJson(path, { signal, onUpdate });
10527
+ async getDiskUsage({ signal, onValue } = {}) {
10528
+ const path = `/api/server/disk`;
10529
+ return this.getJson(path, { signal, onValue });
10316
10530
  }
10317
10531
 
10318
10532
  /**
10319
- * Address mempool transactions
10320
- *
10321
- * Get unconfirmed transaction IDs for an address from the mempool (up to 50).
10322
- *
10323
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-address-transactions-mempool)*
10533
+ * Series catalog
10324
10534
  *
10325
- * 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.
10326
10536
  *
10327
- * @param {Addr} address
10328
- * @param {{ signal?: AbortSignal, onUpdate?: (value: Txid[]) => void }} [options]
10329
- * @returns {Promise<Txid[]>}
10537
+ * Endpoint: `GET /api/series`
10538
+ * @param {{ signal?: AbortSignal, onValue?: (value: TreeNode) => void }} [options]
10539
+ * @returns {Promise<TreeNode>}
10330
10540
  */
10331
- async getAddressMempoolTxs(address, { signal, onUpdate } = {}) {
10332
- const path = `/api/address/${address}/txs/mempool`;
10333
- return this.getJson(path, { signal, onUpdate });
10541
+ async getSeriesTree({ signal, onValue } = {}) {
10542
+ const path = `/api/series`;
10543
+ return this.getJson(path, { signal, onValue });
10334
10544
  }
10335
10545
 
10336
10546
  /**
10337
- * Address UTXOs
10338
- *
10339
- * Get unspent transaction outputs (UTXOs) for an address. Returns txid, vout, value, and confirmation status for each UTXO.
10340
- *
10341
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-address-utxo)*
10547
+ * Series count
10342
10548
  *
10343
- * Endpoint: `GET /api/address/{address}/utxo`
10549
+ * Returns the number of series available per index type.
10344
10550
  *
10345
- * @param {Addr} address
10346
- * @param {{ signal?: AbortSignal, onUpdate?: (value: Utxo[]) => void }} [options]
10347
- * @returns {Promise<Utxo[]>}
10551
+ * Endpoint: `GET /api/series/count`
10552
+ * @param {{ signal?: AbortSignal, onValue?: (value: SeriesCount[]) => void }} [options]
10553
+ * @returns {Promise<SeriesCount[]>}
10348
10554
  */
10349
- async getAddressUtxos(address, { signal, onUpdate } = {}) {
10350
- const path = `/api/address/${address}/utxo`;
10351
- return this.getJson(path, { signal, onUpdate });
10555
+ async getSeriesCount({ signal, onValue } = {}) {
10556
+ const path = `/api/series/count`;
10557
+ return this.getJson(path, { signal, onValue });
10352
10558
  }
10353
10559
 
10354
10560
  /**
10355
- * Block hash by height
10356
- *
10357
- * Retrieve the block hash at a given height. Returns the hash as plain text.
10358
- *
10359
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-height)*
10561
+ * List available indexes
10360
10562
  *
10361
- * Endpoint: `GET /api/block-height/{height}`
10563
+ * Returns all available indexes with their accepted query aliases. Use any alias when querying series.
10362
10564
  *
10363
- * @param {Height} height
10364
- * @param {{ signal?: AbortSignal, onUpdate?: (value: *) => void }} [options]
10365
- * @returns {Promise<*>}
10565
+ * Endpoint: `GET /api/series/indexes`
10566
+ * @param {{ signal?: AbortSignal, onValue?: (value: IndexInfo[]) => void }} [options]
10567
+ * @returns {Promise<IndexInfo[]>}
10366
10568
  */
10367
- async getBlockByHeight(height, { signal, onUpdate } = {}) {
10368
- const path = `/api/block-height/${height}`;
10369
- return this.getText(path, { signal, onUpdate });
10569
+ async getIndexes({ signal, onValue } = {}) {
10570
+ const path = `/api/series/indexes`;
10571
+ return this.getJson(path, { signal, onValue });
10370
10572
  }
10371
10573
 
10372
10574
  /**
10373
- * Block information
10374
- *
10375
- * Retrieve block information by block hash. Returns block metadata including height, timestamp, difficulty, size, weight, and transaction count.
10575
+ * Series list
10376
10576
  *
10377
- * *[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.
10378
10578
  *
10379
- * Endpoint: `GET /api/block/{hash}`
10579
+ * Endpoint: `GET /api/series/list`
10380
10580
  *
10381
- * @param {BlockHash} hash
10382
- * @param {{ signal?: AbortSignal, onUpdate?: (value: BlockInfo) => void }} [options]
10383
- * @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>}
10384
10585
  */
10385
- async getBlock(hash, { signal, onUpdate } = {}) {
10386
- const path = `/api/block/${hash}`;
10387
- 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 });
10388
10593
  }
10389
10594
 
10390
10595
  /**
10391
- * Block header
10392
- *
10393
- * Returns the hex-encoded 80-byte block header.
10596
+ * Search series
10394
10597
  *
10395
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-header)*
10598
+ * Fuzzy search for series by name. Supports partial matches and typos.
10396
10599
  *
10397
- * Endpoint: `GET /api/block/{hash}/header`
10600
+ * Endpoint: `GET /api/series/search`
10398
10601
  *
10399
- * @param {BlockHash} hash
10400
- * @param {{ signal?: AbortSignal, onUpdate?: (value: *) => void }} [options]
10401
- * @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[]>}
10402
10606
  */
10403
- async getBlockHeader(hash, { signal, onUpdate } = {}) {
10404
- const path = `/api/block/${hash}/header`;
10405
- 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 });
10406
10614
  }
10407
10615
 
10408
10616
  /**
10409
- * Raw block
10410
- *
10411
- * Returns the raw block data in binary format.
10617
+ * Get series info
10412
10618
  *
10413
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-raw)*
10619
+ * Returns the supported indexes and value type for the specified series.
10414
10620
  *
10415
- * Endpoint: `GET /api/block/{hash}/raw`
10621
+ * Endpoint: `GET /api/series/{series}`
10416
10622
  *
10417
- * @param {BlockHash} hash
10418
- * @param {{ signal?: AbortSignal, onUpdate?: (value: *) => void }} [options]
10419
- * @returns {Promise<*>}
10623
+ * @param {SeriesName} series
10624
+ * @param {{ signal?: AbortSignal, onValue?: (value: SeriesInfo) => void }} [options]
10625
+ * @returns {Promise<SeriesInfo>}
10420
10626
  */
10421
- async getBlockRaw(hash, { signal, onUpdate } = {}) {
10422
- const path = `/api/block/${hash}/raw`;
10423
- 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 });
10424
10630
  }
10425
10631
 
10426
10632
  /**
10427
- * Block status
10428
- *
10429
- * 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
10430
10634
  *
10431
- * *[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).
10432
10636
  *
10433
- * Endpoint: `GET /api/block/{hash}/status`
10637
+ * Endpoint: `GET /api/series/{series}/{index}`
10434
10638
  *
10435
- * @param {BlockHash} hash
10436
- * @param {{ signal?: AbortSignal, onUpdate?: (value: BlockStatus) => void }} [options]
10437
- * @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>}
10438
10647
  */
10439
- async getBlockStatus(hash, { signal, onUpdate } = {}) {
10440
- const path = `/api/block/${hash}/status`;
10441
- 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 });
10442
10658
  }
10443
10659
 
10444
10660
  /**
10445
- * Transaction ID at index
10661
+ * Get raw series data
10446
10662
  *
10447
- * 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.
10448
10664
  *
10449
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-transaction-id)*
10665
+ * Endpoint: `GET /api/series/{series}/{index}/data`
10450
10666
  *
10451
- * 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
10452
10690
  *
10453
- * @param {BlockHash} hash - Bitcoin block hash
10454
- * @param {TxIndex} index - Transaction index within the block (0-based)
10455
- * @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]
10456
10698
  * @returns {Promise<*>}
10457
10699
  */
10458
- async getBlockTxid(hash, index, { signal, onUpdate } = {}) {
10459
- const path = `/api/block/${hash}/txid/${index}`;
10460
- 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 });
10461
10703
  }
10462
10704
 
10463
10705
  /**
10464
- * Block transaction IDs
10465
- *
10466
- * Retrieve all transaction IDs in a block. Returns an array of txids in block order.
10706
+ * Get series data length
10467
10707
  *
10468
- * *[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.
10469
10709
  *
10470
- * Endpoint: `GET /api/block/{hash}/txids`
10710
+ * Endpoint: `GET /api/series/{series}/{index}/len`
10471
10711
  *
10472
- * @param {BlockHash} hash
10473
- * @param {{ signal?: AbortSignal, onUpdate?: (value: Txid[]) => void }} [options]
10474
- * @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>}
10475
10716
  */
10476
- async getBlockTxids(hash, { signal, onUpdate } = {}) {
10477
- const path = `/api/block/${hash}/txids`;
10478
- 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 });
10479
10720
  }
10480
10721
 
10481
10722
  /**
10482
- * Block transactions
10483
- *
10484
- * Retrieve transactions in a block by block hash. Returns up to 25 transactions starting from index 0.
10723
+ * Get series version
10485
10724
  *
10486
- * *[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.
10487
10726
  *
10488
- * Endpoint: `GET /api/block/{hash}/txs`
10727
+ * Endpoint: `GET /api/series/{series}/{index}/version`
10489
10728
  *
10490
- * @param {BlockHash} hash
10491
- * @param {{ signal?: AbortSignal, onUpdate?: (value: Transaction[]) => void }} [options]
10492
- * @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>}
10493
10733
  */
10494
- async getBlockTxs(hash, { signal, onUpdate } = {}) {
10495
- const path = `/api/block/${hash}/txs`;
10496
- 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 });
10497
10737
  }
10498
10738
 
10499
10739
  /**
10500
- * Block transactions (paginated)
10740
+ * Bulk series data
10501
10741
  *
10502
- * 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.
10503
10743
  *
10504
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-transactions)*
10744
+ * Endpoint: `GET /api/series/bulk`
10505
10745
  *
10506
- * 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
10507
10771
  *
10508
- * @param {BlockHash} hash - Bitcoin block hash
10509
- * @param {TxIndex} start_index - Starting transaction index within the block (0-based)
10510
- * @param {{ signal?: AbortSignal, onUpdate?: (value: Transaction[]) => void }} [options]
10511
- * @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[]>}
10512
10777
  */
10513
- async getBlockTxsFromIndex(hash, start_index, { signal, onUpdate } = {}) {
10514
- const path = `/api/block/${hash}/txs/${start_index}`;
10515
- return this.getJson(path, { signal, onUpdate });
10778
+ async listUrpdCohorts({ signal, onValue } = {}) {
10779
+ const path = `/api/urpd`;
10780
+ return this.getJson(path, { signal, onValue });
10516
10781
  }
10517
10782
 
10518
10783
  /**
10519
- * Recent blocks
10784
+ * Available URPD dates
10520
10785
  *
10521
- * 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.
10522
10787
  *
10523
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-blocks)*
10788
+ * Endpoint: `GET /api/urpd/{cohort}/dates`
10524
10789
  *
10525
- * Endpoint: `GET /api/blocks`
10526
- * @param {{ signal?: AbortSignal, onUpdate?: (value: BlockInfo[]) => void }} [options]
10527
- * @returns {Promise<BlockInfo[]>}
10790
+ * @param {Cohort} cohort
10791
+ * @param {{ signal?: AbortSignal, onValue?: (value: Date[]) => void }} [options]
10792
+ * @returns {Promise<Date[]>}
10528
10793
  */
10529
- async getBlocks({ signal, onUpdate } = {}) {
10530
- const path = `/api/blocks`;
10531
- 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 });
10532
10797
  }
10533
10798
 
10534
10799
  /**
10535
- * Block tip hash
10800
+ * Latest URPD
10536
10801
  *
10537
- * 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.
10538
10803
  *
10539
- * *[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.
10540
10805
  *
10541
- * Endpoint: `GET /api/blocks/tip/hash`
10542
- * @param {{ signal?: AbortSignal, onUpdate?: (value: *) => void }} [options]
10543
- * @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>}
10544
10812
  */
10545
- async getBlockTipHash({ signal, onUpdate } = {}) {
10546
- const path = `/api/blocks/tip/hash`;
10547
- 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 });
10548
10819
  }
10549
10820
 
10550
10821
  /**
10551
- * Block tip height
10822
+ * URPD at date
10552
10823
  *
10553
- * 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 }`.
10554
10825
  *
10555
- * *[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.
10556
10827
  *
10557
- * Endpoint: `GET /api/blocks/tip/height`
10558
- * @param {{ signal?: AbortSignal, onUpdate?: (value: *) => void }} [options]
10559
- * @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>}
10560
10835
  */
10561
- async getBlockTipHeight({ signal, onUpdate } = {}) {
10562
- const path = `/api/blocks/tip/height`;
10563
- 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 });
10564
10842
  }
10565
10843
 
10566
10844
  /**
10567
- * Blocks from height
10568
- *
10569
- * 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
10570
10846
  *
10571
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-blocks)*
10847
+ * Get current difficulty adjustment progress and estimates.
10572
10848
  *
10573
- * Endpoint: `GET /api/blocks/{height}`
10849
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-difficulty-adjustment)*
10574
10850
  *
10575
- * @param {Height} height
10576
- * @param {{ signal?: AbortSignal, onUpdate?: (value: BlockInfo[]) => void }} [options]
10577
- * @returns {Promise<BlockInfo[]>}
10851
+ * Endpoint: `GET /api/v1/difficulty-adjustment`
10852
+ * @param {{ signal?: AbortSignal, onValue?: (value: DifficultyAdjustment) => void }} [options]
10853
+ * @returns {Promise<DifficultyAdjustment>}
10578
10854
  */
10579
- async getBlocksFromHeight(height, { signal, onUpdate } = {}) {
10580
- const path = `/api/blocks/${height}`;
10581
- 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 });
10582
10858
  }
10583
10859
 
10584
10860
  /**
10585
- * Mempool statistics
10861
+ * Current BTC price
10586
10862
  *
10587
- * Get current mempool statistics including transaction count, total vsize, total fees, and fee histogram.
10863
+ * Returns bitcoin latest price (on-chain derived, USD only).
10588
10864
  *
10589
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-mempool)*
10865
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-price)*
10590
10866
  *
10591
- * Endpoint: `GET /api/mempool`
10592
- * @param {{ signal?: AbortSignal, onUpdate?: (value: MempoolInfo) => void }} [options]
10593
- * @returns {Promise<MempoolInfo>}
10867
+ * Endpoint: `GET /api/v1/prices`
10868
+ * @param {{ signal?: AbortSignal, onValue?: (value: Prices) => void }} [options]
10869
+ * @returns {Promise<Prices>}
10594
10870
  */
10595
- async getMempool({ signal, onUpdate } = {}) {
10596
- const path = `/api/mempool`;
10597
- return this.getJson(path, { signal, onUpdate });
10871
+ async getPrices({ signal, onValue } = {}) {
10872
+ const path = `/api/v1/prices`;
10873
+ return this.getJson(path, { signal, onValue });
10598
10874
  }
10599
10875
 
10600
10876
  /**
10601
- * Live BTC/USD price
10877
+ * Historical price
10602
10878
  *
10603
- * 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.
10604
10880
  *
10605
- * Endpoint: `GET /api/mempool/price`
10606
- * @param {{ signal?: AbortSignal, onUpdate?: (value: Dollars) => void }} [options]
10607
- * @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>}
10608
10888
  */
10609
- async getLivePrice({ signal, onUpdate } = {}) {
10610
- const path = `/api/mempool/price`;
10611
- 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 });
10612
10895
  }
10613
10896
 
10614
10897
  /**
10615
- * Recent mempool transactions
10898
+ * Address information
10616
10899
  *
10617
- * 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).
10618
10901
  *
10619
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-mempool-recent)*
10902
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-address)*
10620
10903
  *
10621
- * Endpoint: `GET /api/mempool/recent`
10622
- * @param {{ signal?: AbortSignal, onUpdate?: (value: MempoolRecentTx[]) => void }} [options]
10623
- * @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>}
10624
10909
  */
10625
- async getMempoolRecent({ signal, onUpdate } = {}) {
10626
- const path = `/api/mempool/recent`;
10627
- 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 });
10628
10913
  }
10629
10914
 
10630
10915
  /**
10631
- * Mempool transaction IDs
10916
+ * Address transactions
10632
10917
  *
10633
- * 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}`.
10634
10919
  *
10635
- * *[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)*
10636
10921
  *
10637
- * Endpoint: `GET /api/mempool/txids`
10638
- * @param {{ signal?: AbortSignal, onUpdate?: (value: Txid[]) => void }} [options]
10639
- * @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[]>}
10640
10927
  */
10641
- async getMempoolTxids({ signal, onUpdate } = {}) {
10642
- const path = `/api/mempool/txids`;
10643
- 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 });
10644
10931
  }
10645
10932
 
10646
10933
  /**
10647
- * Series catalog
10934
+ * Address confirmed transactions
10648
10935
  *
10649
- * 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}`.
10650
10937
  *
10651
- * Endpoint: `GET /api/series`
10652
- * @param {{ signal?: AbortSignal, onUpdate?: (value: TreeNode) => void }} [options]
10653
- * @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[]>}
10654
10945
  */
10655
- async getSeriesTree({ signal, onUpdate } = {}) {
10656
- const path = `/api/series`;
10657
- 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 });
10658
10949
  }
10659
10950
 
10660
10951
  /**
10661
- * Bulk series data
10952
+ * Address confirmed transactions (paginated)
10662
10953
  *
10663
- * 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).
10664
10955
  *
10665
- * Endpoint: `GET /api/series/bulk`
10956
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-address-transactions-chain)*
10666
10957
  *
10667
- * @param {SeriesList} [series] - Requested series
10668
- * @param {Index} [index] - Index to query
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, onUpdate?: (value: AnySeriesData[] | string) => void }} [options]
10674
- * @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[]>}
10675
10964
  */
10676
- async getSeriesBulk(series, index, start, end, limit, format, { signal, onUpdate } = {}) {
10677
- const params = new URLSearchParams();
10678
- params.set('series', String(series));
10679
- params.set('index', String(index));
10680
- if (start !== undefined) params.set('start', String(start));
10681
- if (end !== undefined) params.set('end', String(end));
10682
- if (limit !== undefined) params.set('limit', String(limit));
10683
- if (format !== undefined) params.set('format', String(format));
10684
- const query = params.toString();
10685
- const path = `/api/series/bulk${query ? '?' + query : ''}`;
10686
- if (format === 'csv') return this.getText(path, { signal, onUpdate });
10687
- 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 });
10688
10968
  }
10689
10969
 
10690
10970
  /**
10691
- * Series count
10971
+ * Address mempool transactions
10692
10972
  *
10693
- * Returns the number of series available per index type.
10973
+ * Get unconfirmed transactions for an address from the mempool, newest first (up to 50).
10694
10974
  *
10695
- * Endpoint: `GET /api/series/count`
10696
- * @param {{ signal?: AbortSignal, onUpdate?: (value: SeriesCount[]) => void }} [options]
10697
- * @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[]>}
10698
10982
  */
10699
- async getSeriesCount({ signal, onUpdate } = {}) {
10700
- const path = `/api/series/count`;
10701
- 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 });
10702
10986
  }
10703
10987
 
10704
10988
  /**
10705
- * List available indexes
10989
+ * Address UTXOs
10706
10990
  *
10707
- * 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.
10708
10992
  *
10709
- * Endpoint: `GET /api/series/indexes`
10710
- * @param {{ signal?: AbortSignal, onUpdate?: (value: IndexInfo[]) => void }} [options]
10711
- * @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[]>}
10712
11000
  */
10713
- async getIndexes({ signal, onUpdate } = {}) {
10714
- const path = `/api/series/indexes`;
10715
- 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 });
10716
11004
  }
10717
11005
 
10718
11006
  /**
10719
- * Series list
11007
+ * Validate address
10720
11008
  *
10721
- * 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.
10722
11010
  *
10723
- * Endpoint: `GET /api/series/list`
11011
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-address-validate)*
10724
11012
  *
10725
- * @param {number=} [page] - Pagination index
10726
- * @param {number=} [per_page] - Results per page (default: 1000, max: 1000)
10727
- * @param {{ signal?: AbortSignal, onUpdate?: (value: PaginatedSeries) => void }} [options]
10728
- * @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>}
10729
11018
  */
10730
- async listSeries(page, per_page, { signal, onUpdate } = {}) {
10731
- const params = new URLSearchParams();
10732
- if (page !== undefined) params.set('page', String(page));
10733
- if (per_page !== undefined) params.set('per_page', String(per_page));
10734
- const query = params.toString();
10735
- const path = `/api/series/list${query ? '?' + query : ''}`;
10736
- 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 });
10737
11040
  }
10738
11041
 
10739
11042
  /**
10740
- * Search series
11043
+ * Block (v1)
10741
11044
  *
10742
- * Fuzzy search for series by name. Supports partial matches and typos.
11045
+ * Returns block details with extras by hash.
10743
11046
  *
10744
- * Endpoint: `GET /api/series/search`
11047
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-v1)*
10745
11048
  *
10746
- * @param {SeriesName} [q] - Search query string
10747
- * @param {Limit=} [limit] - Maximum number of results
10748
- * @param {{ signal?: AbortSignal, onUpdate?: (value: string[]) => void }} [options]
10749
- * @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>}
10750
11054
  */
10751
- async searchSeries(q, limit, { signal, onUpdate } = {}) {
10752
- const params = new URLSearchParams();
10753
- params.set('q', String(q));
10754
- if (limit !== undefined) params.set('limit', String(limit));
10755
- const query = params.toString();
10756
- const path = `/api/series/search${query ? '?' + query : ''}`;
10757
- 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 });
10758
11058
  }
10759
11059
 
10760
11060
  /**
10761
- * Get series info
11061
+ * Block header
10762
11062
  *
10763
- * Returns the supported indexes and value type for the specified series.
11063
+ * Returns the hex-encoded 80-byte block header.
10764
11064
  *
10765
- * Endpoint: `GET /api/series/{series}`
11065
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-header)*
10766
11066
  *
10767
- * @param {SeriesName} series
10768
- * @param {{ signal?: AbortSignal, onUpdate?: (value: SeriesInfo) => void }} [options]
10769
- * @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>}
10770
11072
  */
10771
- async getSeriesInfo(series, { signal, onUpdate } = {}) {
10772
- const path = `/api/series/${series}`;
10773
- 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 });
10774
11076
  }
10775
11077
 
10776
11078
  /**
10777
- * Get series data
11079
+ * Block hash by height
10778
11080
  *
10779
- * 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.
10780
11082
  *
10781
- * Endpoint: `GET /api/series/{series}/{index}`
11083
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-height)*
10782
11084
  *
10783
- * @param {SeriesName} series - Series name
10784
- * @param {Index} index - Aggregation index
10785
- * @param {RangeIndex=} [start] - Inclusive start: integer index, date (YYYY-MM-DD), or timestamp (ISO 8601). Negative integers count from end. Aliases: `from`, `f`, `s`
10786
- * @param {RangeIndex=} [end] - Exclusive end: integer index, date (YYYY-MM-DD), or timestamp (ISO 8601). Negative integers count from end. Aliases: `to`, `t`, `e`
10787
- * @param {Limit=} [limit] - Maximum number of values to return (ignored if `end` is set). Aliases: `count`, `c`, `l`
10788
- * @param {Format=} [format] - Format of the output
10789
- * @param {{ signal?: AbortSignal, onUpdate?: (value: AnySeriesData | string) => void }} [options]
10790
- * @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>}
10791
11090
  */
10792
- async getSeries(series, index, start, end, limit, format, { signal, onUpdate } = {}) {
10793
- const params = new URLSearchParams();
10794
- if (start !== undefined) params.set('start', String(start));
10795
- if (end !== undefined) params.set('end', String(end));
10796
- if (limit !== undefined) params.set('limit', String(limit));
10797
- if (format !== undefined) params.set('format', String(format));
10798
- const query = params.toString();
10799
- const path = `/api/series/${series}/${index}${query ? '?' + query : ''}`;
10800
- if (format === 'csv') return this.getText(path, { signal, onUpdate });
10801
- 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 });
10802
11094
  }
10803
11095
 
10804
11096
  /**
10805
- * Get raw series data
11097
+ * Block by timestamp
10806
11098
  *
10807
- * 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.
10808
11100
  *
10809
- * Endpoint: `GET /api/series/{series}/{index}/data`
11101
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-timestamp)*
10810
11102
  *
10811
- * @param {SeriesName} series - Series name
10812
- * @param {Index} index - Aggregation index
10813
- * @param {RangeIndex=} [start] - Inclusive start: integer index, date (YYYY-MM-DD), or timestamp (ISO 8601). Negative integers count from end. Aliases: `from`, `f`, `s`
10814
- * @param {RangeIndex=} [end] - Exclusive end: integer index, date (YYYY-MM-DD), or timestamp (ISO 8601). Negative integers count from end. Aliases: `to`, `t`, `e`
10815
- * @param {Limit=} [limit] - Maximum number of values to return (ignored if `end` is set). Aliases: `count`, `c`, `l`
10816
- * @param {Format=} [format] - Format of the output
10817
- * @param {{ signal?: AbortSignal, onUpdate?: (value: boolean[] | string) => void }} [options]
10818
- * @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>}
10819
11108
  */
10820
- async getSeriesData(series, index, start, end, limit, format, { signal, onUpdate } = {}) {
10821
- const params = new URLSearchParams();
10822
- if (start !== undefined) params.set('start', String(start));
10823
- if (end !== undefined) params.set('end', String(end));
10824
- if (limit !== undefined) params.set('limit', String(limit));
10825
- if (format !== undefined) params.set('format', String(format));
10826
- const query = params.toString();
10827
- const path = `/api/series/${series}/${index}/data${query ? '?' + query : ''}`;
10828
- if (format === 'csv') return this.getText(path, { signal, onUpdate });
10829
- 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 });
10830
11112
  }
10831
11113
 
10832
11114
  /**
10833
- * Get latest series value
11115
+ * Raw block
10834
11116
  *
10835
- * Returns the single most recent value for a series, unwrapped (not inside a SeriesData object).
11117
+ * Returns the raw block data in binary format.
10836
11118
  *
10837
- * Endpoint: `GET /api/series/{series}/{index}/latest`
11119
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-raw)*
10838
11120
  *
10839
- * @param {SeriesName} series - Series name
10840
- * @param {Index} index - Aggregation index
10841
- * @param {{ signal?: AbortSignal, onUpdate?: (value: *) => void }} [options]
10842
- * @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>}
10843
11126
  */
10844
- async getSeriesLatest(series, index, { signal, onUpdate } = {}) {
10845
- const path = `/api/series/${series}/${index}/latest`;
10846
- 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 });
10847
11130
  }
10848
11131
 
10849
11132
  /**
10850
- * Get series data length
11133
+ * Block status
10851
11134
  *
10852
- * 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.
10853
11136
  *
10854
- * Endpoint: `GET /api/series/{series}/{index}/len`
11137
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-status)*
10855
11138
  *
10856
- * @param {SeriesName} series - Series name
10857
- * @param {Index} index - Aggregation index
10858
- * @param {{ signal?: AbortSignal, onUpdate?: (value: number) => void }} [options]
10859
- * @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>}
10860
11144
  */
10861
- async getSeriesLen(series, index, { signal, onUpdate } = {}) {
10862
- const path = `/api/series/${series}/${index}/len`;
10863
- 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 });
10864
11148
  }
10865
11149
 
10866
11150
  /**
10867
- * Get series version
11151
+ * Block tip height
10868
11152
  *
10869
- * Returns the current version of a series. Changes when the series data is updated.
11153
+ * Returns the height of the last block.
10870
11154
  *
10871
- * Endpoint: `GET /api/series/{series}/{index}/version`
11155
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-tip-height)*
10872
11156
  *
10873
- * @param {SeriesName} series - Series name
10874
- * @param {Index} index - Aggregation index
10875
- * @param {{ signal?: AbortSignal, onUpdate?: (value: Version) => void }} [options]
10876
- * @returns {Promise<Version>}
11157
+ * Endpoint: `GET /api/blocks/tip/height`
11158
+ * @param {{ signal?: AbortSignal, onValue?: (value: Height) => void }} [options]
11159
+ * @returns {Promise<Height>}
10877
11160
  */
10878
- async getSeriesVersion(series, index, { signal, onUpdate } = {}) {
10879
- const path = `/api/series/${series}/${index}/version`;
10880
- 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 }));
10881
11164
  }
10882
11165
 
10883
11166
  /**
10884
- * Disk usage
11167
+ * Block tip hash
10885
11168
  *
10886
- * Returns the disk space used by BRK and Bitcoin data.
11169
+ * Returns the hash of the last block.
10887
11170
  *
10888
- * Endpoint: `GET /api/server/disk`
10889
- * @param {{ signal?: AbortSignal, onUpdate?: (value: DiskUsage) => void }} [options]
10890
- * @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>}
10891
11176
  */
10892
- async getDiskUsage({ signal, onUpdate } = {}) {
10893
- const path = `/api/server/disk`;
10894
- 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 });
10895
11180
  }
10896
11181
 
10897
11182
  /**
10898
- * Sync status
11183
+ * Transaction ID at index
10899
11184
  *
10900
- * 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.
10901
11186
  *
10902
- * Endpoint: `GET /api/server/sync`
10903
- * @param {{ signal?: AbortSignal, onUpdate?: (value: SyncStatus) => void }} [options]
10904
- * @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>}
10905
11195
  */
10906
- async getSyncStatus({ signal, onUpdate } = {}) {
10907
- const path = `/api/server/sync`;
10908
- 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 });
10909
11199
  }
10910
11200
 
10911
11201
  /**
10912
- * Txid by index
11202
+ * Block transaction IDs
10913
11203
  *
10914
- * 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.
10915
11205
  *
10916
- * Endpoint: `GET /api/tx-index/{index}`
11206
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-transaction-ids)*
10917
11207
  *
10918
- * @param {TxIndex} index
10919
- * @param {{ signal?: AbortSignal, onUpdate?: (value: *) => void }} [options]
10920
- * @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[]>}
10921
11213
  */
10922
- async getTxByIndex(index, { signal, onUpdate } = {}) {
10923
- const path = `/api/tx-index/${index}`;
10924
- 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 });
10925
11217
  }
10926
11218
 
10927
11219
  /**
10928
- * Transaction information
11220
+ * Block transactions
10929
11221
  *
10930
- * 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.
10931
11223
  *
10932
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-transaction)*
11224
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-transactions)*
10933
11225
  *
10934
- * Endpoint: `GET /api/tx/{txid}`
11226
+ * Endpoint: `GET /api/block/{hash}/txs`
10935
11227
  *
10936
- * @param {Txid} txid
10937
- * @param {{ signal?: AbortSignal, onUpdate?: (value: Transaction) => void }} [options]
10938
- * @returns {Promise<Transaction>}
11228
+ * @param {BlockHash} hash
11229
+ * @param {{ signal?: AbortSignal, onValue?: (value: Transaction[]) => void }} [options]
11230
+ * @returns {Promise<Transaction[]>}
10939
11231
  */
10940
- async getTx(txid, { signal, onUpdate } = {}) {
10941
- const path = `/api/tx/${txid}`;
10942
- 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 });
10943
11235
  }
10944
11236
 
10945
11237
  /**
10946
- * Transaction hex
11238
+ * Block transactions (paginated)
10947
11239
  *
10948
- * 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.
10949
11241
  *
10950
- * *[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)*
10951
11243
  *
10952
- * Endpoint: `GET /api/tx/{txid}/hex`
11244
+ * Endpoint: `GET /api/block/{hash}/txs/{start_index}`
10953
11245
  *
10954
- * @param {Txid} txid
10955
- * @param {{ signal?: AbortSignal, onUpdate?: (value: *) => void }} [options]
10956
- * @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[]>}
10957
11250
  */
10958
- async getTxHex(txid, { signal, onUpdate } = {}) {
10959
- const path = `/api/tx/${txid}/hex`;
10960
- 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 });
10961
11254
  }
10962
11255
 
10963
11256
  /**
10964
- * Transaction merkle proof
10965
- *
10966
- * Get the merkle inclusion proof for a transaction.
11257
+ * Recent blocks
10967
11258
  *
10968
- * *[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.
10969
11260
  *
10970
- * Endpoint: `GET /api/tx/{txid}/merkle-proof`
11261
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-blocks)*
10971
11262
  *
10972
- * @param {Txid} txid
10973
- * @param {{ signal?: AbortSignal, onUpdate?: (value: MerkleProof) => void }} [options]
10974
- * @returns {Promise<MerkleProof>}
11263
+ * Endpoint: `GET /api/blocks`
11264
+ * @param {{ signal?: AbortSignal, onValue?: (value: BlockInfo[]) => void }} [options]
11265
+ * @returns {Promise<BlockInfo[]>}
10975
11266
  */
10976
- async getTxMerkleProof(txid, { signal, onUpdate } = {}) {
10977
- const path = `/api/tx/${txid}/merkle-proof`;
10978
- return this.getJson(path, { signal, onUpdate });
11267
+ async getBlocks({ signal, onValue } = {}) {
11268
+ const path = `/api/blocks`;
11269
+ return this.getJson(path, { signal, onValue });
10979
11270
  }
10980
11271
 
10981
11272
  /**
10982
- * Transaction merkleblock proof
11273
+ * Blocks from height
10983
11274
  *
10984
- * 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.
10985
11276
  *
10986
- * *[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)*
10987
11278
  *
10988
- * Endpoint: `GET /api/tx/{txid}/merkleblock-proof`
11279
+ * Endpoint: `GET /api/blocks/{height}`
10989
11280
  *
10990
- * @param {Txid} txid
10991
- * @param {{ signal?: AbortSignal, onUpdate?: (value: *) => void }} [options]
10992
- * @returns {Promise<*>}
11281
+ * @param {Height} height
11282
+ * @param {{ signal?: AbortSignal, onValue?: (value: BlockInfo[]) => void }} [options]
11283
+ * @returns {Promise<BlockInfo[]>}
10993
11284
  */
10994
- async getTxMerkleblockProof(txid, { signal, onUpdate } = {}) {
10995
- const path = `/api/tx/${txid}/merkleblock-proof`;
10996
- 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 });
10997
11288
  }
10998
11289
 
10999
11290
  /**
11000
- * Output spend status
11001
- *
11002
- * 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
11003
11292
  *
11004
- * *[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.
11005
11294
  *
11006
- * Endpoint: `GET /api/tx/{txid}/outspend/{vout}`
11295
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-blocks-v1)*
11007
11296
  *
11008
- * @param {Txid} txid - Transaction ID
11009
- * @param {Vout} vout - Output index
11010
- * @param {{ signal?: AbortSignal, onUpdate?: (value: TxOutspend) => void }} [options]
11011
- * @returns {Promise<TxOutspend>}
11297
+ * Endpoint: `GET /api/v1/blocks`
11298
+ * @param {{ signal?: AbortSignal, onValue?: (value: BlockInfoV1[]) => void }} [options]
11299
+ * @returns {Promise<BlockInfoV1[]>}
11012
11300
  */
11013
- async getTxOutspend(txid, vout, { signal, onUpdate } = {}) {
11014
- const path = `/api/tx/${txid}/outspend/${vout}`;
11015
- return this.getJson(path, { signal, onUpdate });
11301
+ async getBlocksV1({ signal, onValue } = {}) {
11302
+ const path = `/api/v1/blocks`;
11303
+ return this.getJson(path, { signal, onValue });
11016
11304
  }
11017
11305
 
11018
11306
  /**
11019
- * All output spend statuses
11307
+ * Blocks from height with extras
11020
11308
  *
11021
- * 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.
11022
11310
  *
11023
- * *[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)*
11024
11312
  *
11025
- * Endpoint: `GET /api/tx/{txid}/outspends`
11313
+ * Endpoint: `GET /api/v1/blocks/{height}`
11026
11314
  *
11027
- * @param {Txid} txid
11028
- * @param {{ signal?: AbortSignal, onUpdate?: (value: TxOutspend[]) => void }} [options]
11029
- * @returns {Promise<TxOutspend[]>}
11315
+ * @param {Height} height
11316
+ * @param {{ signal?: AbortSignal, onValue?: (value: BlockInfoV1[]) => void }} [options]
11317
+ * @returns {Promise<BlockInfoV1[]>}
11030
11318
  */
11031
- async getTxOutspends(txid, { signal, onUpdate } = {}) {
11032
- const path = `/api/tx/${txid}/outspends`;
11033
- 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 });
11034
11322
  }
11035
11323
 
11036
11324
  /**
11037
- * Transaction raw
11038
- *
11039
- * Returns a transaction as binary data.
11325
+ * List all mining pools
11040
11326
  *
11041
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-transaction-raw)*
11327
+ * Get list of all known mining pools with their identifiers.
11042
11328
  *
11043
- * Endpoint: `GET /api/tx/{txid}/raw`
11329
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-mining-pools)*
11044
11330
  *
11045
- * @param {Txid} txid
11046
- * @param {{ signal?: AbortSignal, onUpdate?: (value: *) => void }} [options]
11047
- * @returns {Promise<*>}
11331
+ * Endpoint: `GET /api/v1/mining/pools`
11332
+ * @param {{ signal?: AbortSignal, onValue?: (value: PoolInfo[]) => void }} [options]
11333
+ * @returns {Promise<PoolInfo[]>}
11048
11334
  */
11049
- async getTxRaw(txid, { signal, onUpdate } = {}) {
11050
- const path = `/api/tx/${txid}/raw`;
11051
- 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 });
11052
11338
  }
11053
11339
 
11054
11340
  /**
11055
- * Transaction status
11341
+ * Mining pool statistics
11056
11342
  *
11057
- * 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`.
11058
11344
  *
11059
- * *[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)*
11060
11346
  *
11061
- * Endpoint: `GET /api/tx/{txid}/status`
11347
+ * Endpoint: `GET /api/v1/mining/pools/{time_period}`
11062
11348
  *
11063
- * @param {Txid} txid
11064
- * @param {{ signal?: AbortSignal, onUpdate?: (value: TxStatus) => void }} [options]
11065
- * @returns {Promise<TxStatus>}
11349
+ * @param {TimePeriod} time_period
11350
+ * @param {{ signal?: AbortSignal, onValue?: (value: PoolsSummary) => void }} [options]
11351
+ * @returns {Promise<PoolsSummary>}
11066
11352
  */
11067
- async getTxStatus(txid, { signal, onUpdate } = {}) {
11068
- const path = `/api/tx/${txid}/status`;
11069
- 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 });
11070
11356
  }
11071
11357
 
11072
11358
  /**
11073
- * Available URPD cohorts
11359
+ * Mining pool details
11074
11360
  *
11075
- * 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.
11076
11362
  *
11077
- * Endpoint: `GET /api/urpd`
11078
- * @param {{ signal?: AbortSignal, onUpdate?: (value: Cohort[]) => void }} [options]
11079
- * @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>}
11080
11370
  */
11081
- async listUrpdCohorts({ signal, onUpdate } = {}) {
11082
- const path = `/api/urpd`;
11083
- 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 });
11084
11374
  }
11085
11375
 
11086
11376
  /**
11087
- * Latest URPD
11088
- *
11089
- * 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)
11090
11378
  *
11091
- * See the URPD tag description for the response shape and `agg` options.
11379
+ * Get hashrate data for all mining pools.
11092
11380
  *
11093
- * Endpoint: `GET /api/urpd/{cohort}`
11381
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-mining-pool-hashrates)*
11094
11382
  *
11095
- * @param {Cohort} cohort
11096
- * @param {UrpdAggregation=} [agg] - Aggregation strategy. Default: raw (no aggregation). Accepts `bucket` as alias.
11097
- * @param {{ signal?: AbortSignal, onUpdate?: (value: Urpd) => void }} [options]
11098
- * @returns {Promise<Urpd>}
11383
+ * Endpoint: `GET /api/v1/mining/hashrate/pools`
11384
+ * @param {{ signal?: AbortSignal, onValue?: (value: PoolHashrateEntry[]) => void }} [options]
11385
+ * @returns {Promise<PoolHashrateEntry[]>}
11099
11386
  */
11100
- async getUrpd(cohort, agg, { signal, onUpdate } = {}) {
11101
- const params = new URLSearchParams();
11102
- if (agg !== undefined) params.set('agg', String(agg));
11103
- const query = params.toString();
11104
- const path = `/api/urpd/${cohort}${query ? '?' + query : ''}`;
11105
- 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 });
11106
11390
  }
11107
11391
 
11108
11392
  /**
11109
- * Available URPD dates
11393
+ * All pools hashrate
11110
11394
  *
11111
- * 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`.
11112
11396
  *
11113
- * Endpoint: `GET /api/urpd/{cohort}/dates`
11397
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-mining-pool-hashrates)*
11114
11398
  *
11115
- * @param {Cohort} cohort
11116
- * @param {{ signal?: AbortSignal, onUpdate?: (value: Date[]) => void }} [options]
11117
- * @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[]>}
11118
11404
  */
11119
- async listUrpdDates(cohort, { signal, onUpdate } = {}) {
11120
- const path = `/api/urpd/${cohort}/dates`;
11121
- 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 });
11122
11408
  }
11123
11409
 
11124
11410
  /**
11125
- * URPD at date
11411
+ * Mining pool hashrate
11126
11412
  *
11127
- * 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.
11128
11414
  *
11129
- * 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)*
11130
11416
  *
11131
- * Endpoint: `GET /api/urpd/{cohort}/{date}`
11417
+ * Endpoint: `GET /api/v1/mining/pool/{slug}/hashrate`
11132
11418
  *
11133
- * @param {Cohort} cohort
11134
- * @param {string} date
11135
- * @param {UrpdAggregation=} [agg] - Aggregation strategy. Default: raw (no aggregation). Accepts `bucket` as alias.
11136
- * @param {{ signal?: AbortSignal, onUpdate?: (value: Urpd) => void }} [options]
11137
- * @returns {Promise<Urpd>}
11419
+ * @param {PoolSlug} slug
11420
+ * @param {{ signal?: AbortSignal, onValue?: (value: PoolHashrateEntry[]) => void }} [options]
11421
+ * @returns {Promise<PoolHashrateEntry[]>}
11138
11422
  */
11139
- async getUrpdAt(cohort, date, agg, { signal, onUpdate } = {}) {
11140
- const params = new URLSearchParams();
11141
- if (agg !== undefined) params.set('agg', String(agg));
11142
- const query = params.toString();
11143
- const path = `/api/urpd/${cohort}/${date}${query ? '?' + query : ''}`;
11144
- 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 });
11145
11426
  }
11146
11427
 
11147
11428
  /**
11148
- * Block (v1)
11429
+ * Mining pool blocks
11149
11430
  *
11150
- * Returns block details with extras by hash.
11431
+ * Get the 10 most recent blocks mined by a specific pool.
11151
11432
  *
11152
- * *[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)*
11153
11434
  *
11154
- * Endpoint: `GET /api/v1/block/{hash}`
11435
+ * Endpoint: `GET /api/v1/mining/pool/{slug}/blocks`
11155
11436
  *
11156
- * @param {BlockHash} hash
11157
- * @param {{ signal?: AbortSignal, onUpdate?: (value: BlockInfoV1) => void }} [options]
11158
- * @returns {Promise<BlockInfoV1>}
11437
+ * @param {PoolSlug} slug
11438
+ * @param {{ signal?: AbortSignal, onValue?: (value: BlockInfoV1[]) => void }} [options]
11439
+ * @returns {Promise<BlockInfoV1[]>}
11159
11440
  */
11160
- async getBlockV1(hash, { signal, onUpdate } = {}) {
11161
- const path = `/api/v1/block/${hash}`;
11162
- 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 });
11163
11444
  }
11164
11445
 
11165
11446
  /**
11166
- * Recent blocks with extras
11447
+ * Mining pool blocks from height
11167
11448
  *
11168
- * 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.
11169
11450
  *
11170
- * *[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)*
11171
11452
  *
11172
- * Endpoint: `GET /api/v1/blocks`
11173
- * @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]
11174
11458
  * @returns {Promise<BlockInfoV1[]>}
11175
11459
  */
11176
- async getBlocksV1({ signal, onUpdate } = {}) {
11177
- const path = `/api/v1/blocks`;
11178
- 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 });
11179
11463
  }
11180
11464
 
11181
11465
  /**
11182
- * Blocks from height with extras
11183
- *
11184
- * Retrieve up to 10 blocks with extended data going backwards from the given height.
11466
+ * Network hashrate (all time)
11185
11467
  *
11186
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-blocks-v1)*
11468
+ * Get network hashrate and difficulty data for all time.
11187
11469
  *
11188
- * Endpoint: `GET /api/v1/blocks/{height}`
11470
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-hashrate)*
11189
11471
  *
11190
- * @param {Height} height
11191
- * @param {{ signal?: AbortSignal, onUpdate?: (value: BlockInfoV1[]) => void }} [options]
11192
- * @returns {Promise<BlockInfoV1[]>}
11472
+ * Endpoint: `GET /api/v1/mining/hashrate`
11473
+ * @param {{ signal?: AbortSignal, onValue?: (value: HashrateSummary) => void }} [options]
11474
+ * @returns {Promise<HashrateSummary>}
11193
11475
  */
11194
- async getBlocksV1FromHeight(height, { signal, onUpdate } = {}) {
11195
- const path = `/api/v1/blocks/${height}`;
11196
- 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 });
11197
11479
  }
11198
11480
 
11199
11481
  /**
11200
- * CPFP info
11482
+ * Network hashrate
11201
11483
  *
11202
- * 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`.
11203
11485
  *
11204
- * *[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)*
11205
11487
  *
11206
- * Endpoint: `GET /api/v1/cpfp/{txid}`
11488
+ * Endpoint: `GET /api/v1/mining/hashrate/{time_period}`
11207
11489
  *
11208
- * @param {Txid} txid
11209
- * @param {{ signal?: AbortSignal, onUpdate?: (value: CpfpInfo) => void }} [options]
11210
- * @returns {Promise<CpfpInfo>}
11490
+ * @param {TimePeriod} time_period
11491
+ * @param {{ signal?: AbortSignal, onValue?: (value: HashrateSummary) => void }} [options]
11492
+ * @returns {Promise<HashrateSummary>}
11211
11493
  */
11212
- async getCpfp(txid, { signal, onUpdate } = {}) {
11213
- const path = `/api/v1/cpfp/${txid}`;
11214
- 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 });
11215
11497
  }
11216
11498
 
11217
11499
  /**
11218
- * Difficulty adjustment
11500
+ * Difficulty adjustments (all time)
11219
11501
  *
11220
- * Get current difficulty adjustment progress and estimates.
11502
+ * Get historical difficulty adjustments including timestamp, block height, difficulty value, and percentage change.
11221
11503
  *
11222
- * *[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)*
11223
11505
  *
11224
- * Endpoint: `GET /api/v1/difficulty-adjustment`
11225
- * @param {{ signal?: AbortSignal, onUpdate?: (value: DifficultyAdjustment) => void }} [options]
11226
- * @returns {Promise<DifficultyAdjustment>}
11506
+ * Endpoint: `GET /api/v1/mining/difficulty-adjustments`
11507
+ * @param {{ signal?: AbortSignal, onValue?: (value: DifficultyAdjustmentEntry[]) => void }} [options]
11508
+ * @returns {Promise<DifficultyAdjustmentEntry[]>}
11227
11509
  */
11228
- async getDifficultyAdjustment({ signal, onUpdate } = {}) {
11229
- const path = `/api/v1/difficulty-adjustment`;
11230
- 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 });
11231
11513
  }
11232
11514
 
11233
11515
  /**
11234
- * Projected mempool blocks
11516
+ * Difficulty adjustments
11235
11517
  *
11236
- * 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`.
11237
11519
  *
11238
- * *[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)*
11239
11521
  *
11240
- * Endpoint: `GET /api/v1/fees/mempool-blocks`
11241
- * @param {{ signal?: AbortSignal, onUpdate?: (value: MempoolBlock[]) => void }} [options]
11242
- * @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[]>}
11243
11527
  */
11244
- async getMempoolBlocks({ signal, onUpdate } = {}) {
11245
- const path = `/api/v1/fees/mempool-blocks`;
11246
- 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 });
11247
11531
  }
11248
11532
 
11249
11533
  /**
11250
- * Precise recommended fees
11534
+ * Mining reward statistics
11251
11535
  *
11252
- * 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.
11253
11537
  *
11254
- * *[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)*
11255
11539
  *
11256
- * Endpoint: `GET /api/v1/fees/precise`
11257
- * @param {{ signal?: AbortSignal, onUpdate?: (value: RecommendedFees) => void }} [options]
11258
- * @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>}
11259
11545
  */
11260
- async getPreciseFees({ signal, onUpdate } = {}) {
11261
- const path = `/api/v1/fees/precise`;
11262
- 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 });
11263
11549
  }
11264
11550
 
11265
11551
  /**
11266
- * Recommended fees
11552
+ * Block fees
11267
11553
  *
11268
- * 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`.
11269
11555
  *
11270
- * *[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)*
11271
11557
  *
11272
- * Endpoint: `GET /api/v1/fees/recommended`
11273
- * @param {{ signal?: AbortSignal, onUpdate?: (value: RecommendedFees) => void }} [options]
11274
- * @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[]>}
11275
11563
  */
11276
- async getRecommendedFees({ signal, onUpdate } = {}) {
11277
- const path = `/api/v1/fees/recommended`;
11278
- 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 });
11279
11567
  }
11280
11568
 
11281
11569
  /**
11282
- * Historical price
11570
+ * Block rewards
11283
11571
  *
11284
- * 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`.
11285
11573
  *
11286
- * *[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)*
11287
11575
  *
11288
- * Endpoint: `GET /api/v1/historical-price`
11576
+ * Endpoint: `GET /api/v1/mining/blocks/rewards/{time_period}`
11289
11577
  *
11290
- * @param {Timestamp=} [timestamp]
11291
- * @param {{ signal?: AbortSignal, onUpdate?: (value: HistoricalPrice) => void }} [options]
11292
- * @returns {Promise<HistoricalPrice>}
11578
+ * @param {TimePeriod} time_period
11579
+ * @param {{ signal?: AbortSignal, onValue?: (value: BlockRewardsEntry[]) => void }} [options]
11580
+ * @returns {Promise<BlockRewardsEntry[]>}
11293
11581
  */
11294
- async getHistoricalPrice(timestamp, { signal, onUpdate } = {}) {
11295
- const params = new URLSearchParams();
11296
- if (timestamp !== undefined) params.set('timestamp', String(timestamp));
11297
- const query = params.toString();
11298
- const path = `/api/v1/historical-price${query ? '?' + query : ''}`;
11299
- 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 });
11300
11585
  }
11301
11586
 
11302
11587
  /**
@@ -11309,393 +11594,422 @@ class BrkClient extends BrkClientBase {
11309
11594
  * Endpoint: `GET /api/v1/mining/blocks/fee-rates/{time_period}`
11310
11595
  *
11311
11596
  * @param {TimePeriod} time_period
11312
- * @param {{ signal?: AbortSignal, onUpdate?: (value: BlockFeeRatesEntry[]) => void }} [options]
11597
+ * @param {{ signal?: AbortSignal, onValue?: (value: BlockFeeRatesEntry[]) => void }} [options]
11313
11598
  * @returns {Promise<BlockFeeRatesEntry[]>}
11314
11599
  */
11315
- async getBlockFeeRates(time_period, { signal, onUpdate } = {}) {
11600
+ async getBlockFeeRates(time_period, { signal, onValue } = {}) {
11316
11601
  const path = `/api/v1/mining/blocks/fee-rates/${time_period}`;
11317
- return this.getJson(path, { signal, onUpdate });
11602
+ return this.getJson(path, { signal, onValue });
11318
11603
  }
11319
11604
 
11320
11605
  /**
11321
- * Block fees
11606
+ * Block sizes and weights
11322
11607
  *
11323
- * 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`.
11324
11609
  *
11325
- * *[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)*
11326
11611
  *
11327
- * Endpoint: `GET /api/v1/mining/blocks/fees/{time_period}`
11612
+ * Endpoint: `GET /api/v1/mining/blocks/sizes-weights/{time_period}`
11328
11613
  *
11329
11614
  * @param {TimePeriod} time_period
11330
- * @param {{ signal?: AbortSignal, onUpdate?: (value: BlockFeesEntry[]) => void }} [options]
11331
- * @returns {Promise<BlockFeesEntry[]>}
11615
+ * @param {{ signal?: AbortSignal, onValue?: (value: BlockSizesWeights) => void }} [options]
11616
+ * @returns {Promise<BlockSizesWeights>}
11332
11617
  */
11333
- async getBlockFees(time_period, { signal, onUpdate } = {}) {
11334
- const path = `/api/v1/mining/blocks/fees/${time_period}`;
11335
- 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 });
11336
11621
  }
11337
11622
 
11338
11623
  /**
11339
- * Block rewards
11624
+ * Projected mempool blocks
11340
11625
  *
11341
- * 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.
11342
11627
  *
11343
- * *[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)*
11344
11629
  *
11345
- * 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
11346
11641
  *
11347
- * @param {TimePeriod} time_period
11348
- * @param {{ signal?: AbortSignal, onUpdate?: (value: BlockRewardsEntry[]) => void }} [options]
11349
- * @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>}
11350
11649
  */
11351
- async getBlockRewards(time_period, { signal, onUpdate } = {}) {
11352
- const path = `/api/v1/mining/blocks/rewards/${time_period}`;
11353
- 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 });
11354
11653
  }
11355
11654
 
11356
11655
  /**
11357
- * Block sizes and weights
11656
+ * Precise recommended fees
11358
11657
  *
11359
- * 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
11360
11673
  *
11361
- * *[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.
11362
11675
  *
11363
- * Endpoint: `GET /api/v1/mining/blocks/sizes-weights/{time_period}`
11676
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-mempool)*
11364
11677
  *
11365
- * @param {TimePeriod} time_period
11366
- * @param {{ signal?: AbortSignal, onUpdate?: (value: BlockSizesWeights) => void }} [options]
11367
- * @returns {Promise<BlockSizesWeights>}
11678
+ * Endpoint: `GET /api/mempool`
11679
+ * @param {{ signal?: AbortSignal, onValue?: (value: MempoolInfo) => void }} [options]
11680
+ * @returns {Promise<MempoolInfo>}
11368
11681
  */
11369
- async getBlockSizesWeights(time_period, { signal, onUpdate } = {}) {
11370
- const path = `/api/v1/mining/blocks/sizes-weights/${time_period}`;
11371
- return this.getJson(path, { signal, onUpdate });
11682
+ async getMempool({ signal, onValue } = {}) {
11683
+ const path = `/api/mempool`;
11684
+ return this.getJson(path, { signal, onValue });
11372
11685
  }
11373
11686
 
11374
11687
  /**
11375
- * Block by timestamp
11376
- *
11377
- * Find the block closest to a given UNIX timestamp.
11688
+ * Mempool content hash
11378
11689
  *
11379
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-timestamp)*
11380
- *
11381
- * 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.
11382
11691
  *
11383
- * @param {Timestamp} timestamp
11384
- * @param {{ signal?: AbortSignal, onUpdate?: (value: BlockTimestamp) => void }} [options]
11385
- * @returns {Promise<BlockTimestamp>}
11692
+ * Endpoint: `GET /api/mempool/hash`
11693
+ * @param {{ signal?: AbortSignal, onValue?: (value: number) => void }} [options]
11694
+ * @returns {Promise<number>}
11386
11695
  */
11387
- async getBlockByTimestamp(timestamp, { signal, onUpdate } = {}) {
11388
- const path = `/api/v1/mining/blocks/timestamp/${timestamp}`;
11389
- return this.getJson(path, { signal, onUpdate });
11696
+ async getMempoolHash({ signal, onValue } = {}) {
11697
+ const path = `/api/mempool/hash`;
11698
+ return this.getJson(path, { signal, onValue });
11390
11699
  }
11391
11700
 
11392
11701
  /**
11393
- * Difficulty adjustments (all time)
11702
+ * Mempool transaction IDs
11394
11703
  *
11395
- * Get historical difficulty adjustments including timestamp, block height, difficulty value, and percentage change.
11704
+ * Get all transaction IDs currently in the mempool.
11396
11705
  *
11397
- * *[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)*
11398
11707
  *
11399
- * Endpoint: `GET /api/v1/mining/difficulty-adjustments`
11400
- * @param {{ signal?: AbortSignal, onUpdate?: (value: DifficultyAdjustmentEntry[]) => void }} [options]
11401
- * @returns {Promise<DifficultyAdjustmentEntry[]>}
11708
+ * Endpoint: `GET /api/mempool/txids`
11709
+ * @param {{ signal?: AbortSignal, onValue?: (value: Txid[]) => void }} [options]
11710
+ * @returns {Promise<Txid[]>}
11402
11711
  */
11403
- async getDifficultyAdjustments({ signal, onUpdate } = {}) {
11404
- const path = `/api/v1/mining/difficulty-adjustments`;
11405
- return this.getJson(path, { signal, onUpdate });
11712
+ async getMempoolTxids({ signal, onValue } = {}) {
11713
+ const path = `/api/mempool/txids`;
11714
+ return this.getJson(path, { signal, onValue });
11406
11715
  }
11407
11716
 
11408
11717
  /**
11409
- * Difficulty adjustments
11410
- *
11411
- * Get historical difficulty adjustments for a time period. Valid periods: `24h`, `3d`, `1w`, `1m`, `3m`, `6m`, `1y`, `2y`, `3y`.
11718
+ * Recent mempool transactions
11412
11719
  *
11413
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-difficulty-adjustments)*
11720
+ * Get the last 10 transactions to enter the mempool.
11414
11721
  *
11415
- * Endpoint: `GET /api/v1/mining/difficulty-adjustments/{time_period}`
11722
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-mempool-recent)*
11416
11723
  *
11417
- * @param {TimePeriod} time_period
11418
- * @param {{ signal?: AbortSignal, onUpdate?: (value: DifficultyAdjustmentEntry[]) => void }} [options]
11419
- * @returns {Promise<DifficultyAdjustmentEntry[]>}
11724
+ * Endpoint: `GET /api/mempool/recent`
11725
+ * @param {{ signal?: AbortSignal, onValue?: (value: MempoolRecentTx[]) => void }} [options]
11726
+ * @returns {Promise<MempoolRecentTx[]>}
11420
11727
  */
11421
- async getDifficultyAdjustmentsByPeriod(time_period, { signal, onUpdate } = {}) {
11422
- const path = `/api/v1/mining/difficulty-adjustments/${time_period}`;
11423
- return this.getJson(path, { signal, onUpdate });
11728
+ async getMempoolRecent({ signal, onValue } = {}) {
11729
+ const path = `/api/mempool/recent`;
11730
+ return this.getJson(path, { signal, onValue });
11424
11731
  }
11425
11732
 
11426
11733
  /**
11427
- * Network hashrate (all time)
11734
+ * Recent RBF replacements
11428
11735
  *
11429
- * 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`.
11430
11737
  *
11431
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-hashrate)*
11738
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-replacements)*
11432
11739
  *
11433
- * Endpoint: `GET /api/v1/mining/hashrate`
11434
- * @param {{ signal?: AbortSignal, onUpdate?: (value: HashrateSummary) => void }} [options]
11435
- * @returns {Promise<HashrateSummary>}
11740
+ * Endpoint: `GET /api/v1/replacements`
11741
+ * @param {{ signal?: AbortSignal, onValue?: (value: ReplacementNode[]) => void }} [options]
11742
+ * @returns {Promise<ReplacementNode[]>}
11436
11743
  */
11437
- async getHashrate({ signal, onUpdate } = {}) {
11438
- const path = `/api/v1/mining/hashrate`;
11439
- return this.getJson(path, { signal, onUpdate });
11744
+ async getReplacements({ signal, onValue } = {}) {
11745
+ const path = `/api/v1/replacements`;
11746
+ return this.getJson(path, { signal, onValue });
11440
11747
  }
11441
11748
 
11442
11749
  /**
11443
- * All pools hashrate (all time)
11750
+ * Recent full-RBF replacements
11444
11751
  *
11445
- * 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).
11446
11753
  *
11447
- * *[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)*
11448
11755
  *
11449
- * Endpoint: `GET /api/v1/mining/hashrate/pools`
11450
- * @param {{ signal?: AbortSignal, onUpdate?: (value: PoolHashrateEntry[]) => void }} [options]
11451
- * @returns {Promise<PoolHashrateEntry[]>}
11756
+ * Endpoint: `GET /api/v1/fullrbf/replacements`
11757
+ * @param {{ signal?: AbortSignal, onValue?: (value: ReplacementNode[]) => void }} [options]
11758
+ * @returns {Promise<ReplacementNode[]>}
11452
11759
  */
11453
- async getPoolsHashrate({ signal, onUpdate } = {}) {
11454
- const path = `/api/v1/mining/hashrate/pools`;
11455
- 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 });
11456
11763
  }
11457
11764
 
11458
11765
  /**
11459
- * All pools hashrate
11460
- *
11461
- * Get hashrate data for all mining pools for a time period. Valid periods: `1m`, `3m`, `6m`, `1y`, `2y`, `3y`.
11462
- *
11463
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-mining-pool-hashrates)*
11766
+ * Live BTC/USD price
11464
11767
  *
11465
- * 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.
11466
11769
  *
11467
- * @param {TimePeriod} time_period
11468
- * @param {{ signal?: AbortSignal, onUpdate?: (value: PoolHashrateEntry[]) => void }} [options]
11469
- * @returns {Promise<PoolHashrateEntry[]>}
11770
+ * Endpoint: `GET /api/mempool/price`
11771
+ * @param {{ signal?: AbortSignal, onValue?: (value: Dollars) => void }} [options]
11772
+ * @returns {Promise<Dollars>}
11470
11773
  */
11471
- async getPoolsHashrateByPeriod(time_period, { signal, onUpdate } = {}) {
11472
- const path = `/api/v1/mining/hashrate/pools/${time_period}`;
11473
- return this.getJson(path, { signal, onUpdate });
11774
+ async getLivePrice({ signal, onValue } = {}) {
11775
+ const path = `/api/mempool/price`;
11776
+ return this.getJson(path, { signal, onValue });
11474
11777
  }
11475
11778
 
11476
11779
  /**
11477
- * Network hashrate
11478
- *
11479
- * 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
11480
11781
  *
11481
- * *[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.
11482
11783
  *
11483
- * Endpoint: `GET /api/v1/mining/hashrate/{time_period}`
11784
+ * Endpoint: `GET /api/tx-index/{index}`
11484
11785
  *
11485
- * @param {TimePeriod} time_period
11486
- * @param {{ signal?: AbortSignal, onUpdate?: (value: HashrateSummary) => void }} [options]
11487
- * @returns {Promise<HashrateSummary>}
11786
+ * @param {TxIndex} index
11787
+ * @param {{ signal?: AbortSignal, onValue?: (value: Txid) => void }} [options]
11788
+ * @returns {Promise<Txid>}
11488
11789
  */
11489
- async getHashrateByPeriod(time_period, { signal, onUpdate } = {}) {
11490
- const path = `/api/v1/mining/hashrate/${time_period}`;
11491
- 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 });
11492
11793
  }
11493
11794
 
11494
11795
  /**
11495
- * Mining pool details
11796
+ * CPFP info
11496
11797
  *
11497
- * 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.
11498
11799
  *
11499
- * *[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)*
11500
11801
  *
11501
- * Endpoint: `GET /api/v1/mining/pool/{slug}`
11802
+ * Endpoint: `GET /api/v1/cpfp/{txid}`
11502
11803
  *
11503
- * @param {PoolSlug} slug
11504
- * @param {{ signal?: AbortSignal, onUpdate?: (value: PoolDetail) => void }} [options]
11505
- * @returns {Promise<PoolDetail>}
11804
+ * @param {Txid} txid
11805
+ * @param {{ signal?: AbortSignal, onValue?: (value: CpfpInfo) => void }} [options]
11806
+ * @returns {Promise<CpfpInfo>}
11506
11807
  */
11507
- async getPool(slug, { signal, onUpdate } = {}) {
11508
- const path = `/api/v1/mining/pool/${slug}`;
11509
- 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 });
11510
11811
  }
11511
11812
 
11512
11813
  /**
11513
- * Mining pool blocks
11814
+ * RBF replacement history
11514
11815
  *
11515
- * 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.
11516
11817
  *
11517
- * *[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)*
11518
11819
  *
11519
- * Endpoint: `GET /api/v1/mining/pool/{slug}/blocks`
11820
+ * Endpoint: `GET /api/v1/tx/{txid}/rbf`
11520
11821
  *
11521
- * @param {PoolSlug} slug
11522
- * @param {{ signal?: AbortSignal, onUpdate?: (value: BlockInfoV1[]) => void }} [options]
11523
- * @returns {Promise<BlockInfoV1[]>}
11822
+ * @param {Txid} txid
11823
+ * @param {{ signal?: AbortSignal, onValue?: (value: RbfResponse) => void }} [options]
11824
+ * @returns {Promise<RbfResponse>}
11524
11825
  */
11525
- async getPoolBlocks(slug, { signal, onUpdate } = {}) {
11526
- const path = `/api/v1/mining/pool/${slug}/blocks`;
11527
- 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 });
11528
11829
  }
11529
11830
 
11530
11831
  /**
11531
- * Mining pool blocks from height
11832
+ * Transaction information
11532
11833
  *
11533
- * 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.
11534
11835
  *
11535
- * *[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)*
11536
11837
  *
11537
- * Endpoint: `GET /api/v1/mining/pool/{slug}/blocks/{height}`
11838
+ * Endpoint: `GET /api/tx/{txid}`
11538
11839
  *
11539
- * @param {PoolSlug} slug
11540
- * @param {Height} height
11541
- * @param {{ signal?: AbortSignal, onUpdate?: (value: BlockInfoV1[]) => void }} [options]
11542
- * @returns {Promise<BlockInfoV1[]>}
11840
+ * @param {Txid} txid
11841
+ * @param {{ signal?: AbortSignal, onValue?: (value: Transaction) => void }} [options]
11842
+ * @returns {Promise<Transaction>}
11543
11843
  */
11544
- async getPoolBlocksFrom(slug, height, { signal, onUpdate } = {}) {
11545
- const path = `/api/v1/mining/pool/${slug}/blocks/${height}`;
11546
- 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 });
11547
11847
  }
11548
11848
 
11549
11849
  /**
11550
- * Mining pool hashrate
11850
+ * Transaction hex
11551
11851
  *
11552
- * 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.
11553
11853
  *
11554
- * *[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)*
11555
11855
  *
11556
- * Endpoint: `GET /api/v1/mining/pool/{slug}/hashrate`
11856
+ * Endpoint: `GET /api/tx/{txid}/hex`
11557
11857
  *
11558
- * @param {PoolSlug} slug
11559
- * @param {{ signal?: AbortSignal, onUpdate?: (value: PoolHashrateEntry[]) => void }} [options]
11560
- * @returns {Promise<PoolHashrateEntry[]>}
11858
+ * @param {Txid} txid
11859
+ * @param {{ signal?: AbortSignal, onValue?: (value: Hex) => void }} [options]
11860
+ * @returns {Promise<Hex>}
11561
11861
  */
11562
- async getPoolHashrate(slug, { signal, onUpdate } = {}) {
11563
- const path = `/api/v1/mining/pool/${slug}/hashrate`;
11564
- 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 });
11565
11865
  }
11566
11866
 
11567
11867
  /**
11568
- * List all mining pools
11868
+ * Transaction merkleblock proof
11569
11869
  *
11570
- * Get list of all known mining pools with their identifiers.
11870
+ * Get the merkleblock proof for a transaction (BIP37 format, hex encoded).
11571
11871
  *
11572
- * *[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)*
11573
11873
  *
11574
- * Endpoint: `GET /api/v1/mining/pools`
11575
- * @param {{ signal?: AbortSignal, onUpdate?: (value: PoolInfo[]) => void }} [options]
11576
- * @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>}
11577
11879
  */
11578
- async getPools({ signal, onUpdate } = {}) {
11579
- const path = `/api/v1/mining/pools`;
11580
- 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 });
11581
11883
  }
11582
11884
 
11583
11885
  /**
11584
- * Mining pool statistics
11886
+ * Transaction merkle proof
11585
11887
  *
11586
- * 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.
11587
11889
  *
11588
- * *[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)*
11589
11891
  *
11590
- * Endpoint: `GET /api/v1/mining/pools/{time_period}`
11892
+ * Endpoint: `GET /api/tx/{txid}/merkle-proof`
11591
11893
  *
11592
- * @param {TimePeriod} time_period
11593
- * @param {{ signal?: AbortSignal, onUpdate?: (value: PoolsSummary) => void }} [options]
11594
- * @returns {Promise<PoolsSummary>}
11894
+ * @param {Txid} txid
11895
+ * @param {{ signal?: AbortSignal, onValue?: (value: MerkleProof) => void }} [options]
11896
+ * @returns {Promise<MerkleProof>}
11595
11897
  */
11596
- async getPoolStats(time_period, { signal, onUpdate } = {}) {
11597
- const path = `/api/v1/mining/pools/${time_period}`;
11598
- 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 });
11599
11901
  }
11600
11902
 
11601
11903
  /**
11602
- * Mining reward statistics
11904
+ * Output spend status
11603
11905
  *
11604
- * 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.
11605
11907
  *
11606
- * *[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)*
11607
11909
  *
11608
- * Endpoint: `GET /api/v1/mining/reward-stats/{block_count}`
11910
+ * Endpoint: `GET /api/tx/{txid}/outspend/{vout}`
11609
11911
  *
11610
- * @param {number} block_count - Number of recent blocks to include
11611
- * @param {{ signal?: AbortSignal, onUpdate?: (value: RewardStats) => void }} [options]
11612
- * @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>}
11613
11916
  */
11614
- async getRewardStats(block_count, { signal, onUpdate } = {}) {
11615
- const path = `/api/v1/mining/reward-stats/${block_count}`;
11616
- 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 });
11617
11920
  }
11618
11921
 
11619
11922
  /**
11620
- * Current BTC price
11923
+ * All output spend statuses
11621
11924
  *
11622
- * 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.
11623
11926
  *
11624
- * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-price)*
11927
+ * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-transaction-outspends)*
11625
11928
  *
11626
- * Endpoint: `GET /api/v1/prices`
11627
- * @param {{ signal?: AbortSignal, onUpdate?: (value: Prices) => void }} [options]
11628
- * @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[]>}
11629
11934
  */
11630
- async getPrices({ signal, onUpdate } = {}) {
11631
- const path = `/api/v1/prices`;
11632
- 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 });
11633
11938
  }
11634
11939
 
11635
11940
  /**
11636
- * Transaction first-seen times
11941
+ * Transaction raw
11637
11942
  *
11638
- * Returns timestamps when transactions were first seen in the mempool. Returns 0 for mined or unknown transactions.
11943
+ * Returns a transaction as binary data.
11639
11944
  *
11640
- * *[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)*
11641
11946
  *
11642
- * Endpoint: `GET /api/v1/transaction-times`
11643
- * @param {{ signal?: AbortSignal, onUpdate?: (value: number[]) => void }} [options]
11644
- * @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>}
11645
11952
  */
11646
- async getTransactionTimes({ signal, onUpdate } = {}) {
11647
- const path = `/api/v1/transaction-times`;
11648
- 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 });
11649
11956
  }
11650
11957
 
11651
11958
  /**
11652
- * RBF replacement history
11959
+ * Transaction status
11653
11960
  *
11654
- * 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.
11655
11962
  *
11656
- * *[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)*
11657
11964
  *
11658
- * Endpoint: `GET /api/v1/tx/{txid}/rbf`
11965
+ * Endpoint: `GET /api/tx/{txid}/status`
11659
11966
  *
11660
11967
  * @param {Txid} txid
11661
- * @param {{ signal?: AbortSignal, onUpdate?: (value: RbfResponse) => void }} [options]
11662
- * @returns {Promise<RbfResponse>}
11968
+ * @param {{ signal?: AbortSignal, onValue?: (value: TxStatus) => void }} [options]
11969
+ * @returns {Promise<TxStatus>}
11663
11970
  */
11664
- async getTxRbf(txid, { signal, onUpdate } = {}) {
11665
- const path = `/api/v1/tx/${txid}/rbf`;
11666
- 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 });
11667
11974
  }
11668
11975
 
11669
11976
  /**
11670
- * Validate address
11977
+ * Transaction first-seen times
11671
11978
  *
11672
- * 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.
11673
11980
  *
11674
- * *[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)*
11675
11982
  *
11676
- * Endpoint: `GET /api/v1/validate-address/{address}`
11983
+ * Endpoint: `GET /api/v1/transaction-times`
11677
11984
  *
11678
- * @param {string} address - Bitcoin address to validate (can be any string)
11679
- * @param {{ signal?: AbortSignal, onUpdate?: (value: AddrValidation) => void }} [options]
11680
- * @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[]>}
11681
11988
  */
11682
- async validateAddress(address, { signal, onUpdate } = {}) {
11683
- const path = `/api/v1/validate-address/${address}`;
11684
- 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 });
11685
11995
  }
11686
11996
 
11687
11997
  /**
11688
- * Health check
11998
+ * Broadcast transaction
11689
11999
  *
11690
- * 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.
11691
12001
  *
11692
- * Endpoint: `GET /health`
11693
- * @param {{ signal?: AbortSignal, onUpdate?: (value: Health) => void }} [options]
11694
- * @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>}
11695
12009
  */
11696
- async getHealth({ signal, onUpdate } = {}) {
11697
- const path = `/health`;
11698
- return this.getJson(path, { signal, onUpdate });
12010
+ async postTx(body, { signal } = {}) {
12011
+ const path = `/api/tx`;
12012
+ return this.postJson(path, body, { signal });
11699
12013
  }
11700
12014
 
11701
12015
  /**
@@ -11704,26 +12018,26 @@ class BrkClient extends BrkClientBase {
11704
12018
  * Full OpenAPI 3.1 specification for this API.
11705
12019
  *
11706
12020
  * Endpoint: `GET /openapi.json`
11707
- * @param {{ signal?: AbortSignal, onUpdate?: (value: *) => void }} [options]
12021
+ * @param {{ signal?: AbortSignal, onValue?: (value: *) => void }} [options]
11708
12022
  * @returns {Promise<*>}
11709
12023
  */
11710
- async getOpenapi({ signal, onUpdate } = {}) {
12024
+ async getOpenapi({ signal, onValue } = {}) {
11711
12025
  const path = `/openapi.json`;
11712
- return this.getText(path, { signal, onUpdate });
12026
+ return this.getText(path, { signal, onValue });
11713
12027
  }
11714
12028
 
11715
12029
  /**
11716
- * API version
12030
+ * Compact OpenAPI specification
11717
12031
  *
11718
- * 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`.
11719
12033
  *
11720
- * Endpoint: `GET /version`
11721
- * @param {{ signal?: AbortSignal, onUpdate?: (value: string) => void }} [options]
11722
- * @returns {Promise<string>}
12034
+ * Endpoint: `GET /api.json`
12035
+ * @param {{ signal?: AbortSignal, onValue?: (value: *) => void }} [options]
12036
+ * @returns {Promise<*>}
11723
12037
  */
11724
- async getVersion({ signal, onUpdate } = {}) {
11725
- const path = `/version`;
11726
- return this.getJson(path, { signal, onUpdate });
12038
+ async getApi({ signal, onValue } = {}) {
12039
+ const path = `/api.json`;
12040
+ return this.getJson(path, { signal, onValue });
11727
12041
  }
11728
12042
 
11729
12043
  }