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.
- package/index.js +1585 -1271
- 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 {
|
|
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 {
|
|
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 {
|
|
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
|
-
*
|
|
376
|
+
* CPFP cluster: the connected component the seed belongs to, plus its
|
|
377
|
+
* SFL linearization.
|
|
364
378
|
*
|
|
365
|
-
* @typedef {Object}
|
|
366
|
-
* @property {
|
|
367
|
-
* @property {
|
|
368
|
-
* @property {
|
|
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
|
-
*
|
|
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}
|
|
374
|
-
* @property {
|
|
375
|
-
* @property {
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
*
|
|
379
|
-
*
|
|
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
|
-
*
|
|
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"|"
|
|
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 {
|
|
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
|
-
*
|
|
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
|
|
1191
|
-
*
|
|
1192
|
-
*
|
|
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 -
|
|
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: `
|
|
1217
|
-
* @property {Dollars} unrealizedPnl - Unrealized P&L in USD against the close on the snapshot date: `
|
|
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} [
|
|
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
|
|
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}
|
|
1412
|
+
* @param {string|boolean|undefined} option
|
|
1322
1413
|
* @returns {Promise<Cache | null>}
|
|
1323
1414
|
*/
|
|
1324
|
-
const
|
|
1325
|
-
if (!_isBrowser ||
|
|
1326
|
-
const name = typeof
|
|
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 {(
|
|
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 {(
|
|
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 {(
|
|
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 {(
|
|
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 {(
|
|
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 {(
|
|
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 {(
|
|
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 {(
|
|
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 {
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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.
|
|
1775
|
+
this._browserCachePromise = _openBrowserCache(isString ? undefined : options.browserCache);
|
|
1680
1776
|
/** @type {Cache | null} */
|
|
1681
|
-
this.
|
|
1682
|
-
this.
|
|
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
|
|
1701
|
-
*
|
|
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 {{
|
|
1845
|
+
* @param {{ onValue?: (value: T) => void, signal?: AbortSignal }} [options]
|
|
1706
1846
|
* @returns {Promise<T>}
|
|
1707
1847
|
*/
|
|
1708
|
-
async _getCached(path, parse, {
|
|
1848
|
+
async _getCached(path, parse, { onValue, signal } = {}) {
|
|
1709
1849
|
const url = `${this.baseUrl}${path}`;
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
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
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1749
|
-
|
|
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 `
|
|
1913
|
+
* Make a GET request expecting a JSON response. Cached and supports `onValue`.
|
|
1757
1914
|
* @template T
|
|
1758
1915
|
* @param {string} path
|
|
1759
|
-
* @param {{
|
|
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 `
|
|
1925
|
+
* Cached and supports `onValue`, same as `getJson`.
|
|
1769
1926
|
* @param {string} path
|
|
1770
|
-
* @param {{
|
|
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} [
|
|
2010
|
+
* @param {(value: DateSeriesData<T>) => void} [onValue]
|
|
1782
2011
|
* @returns {Promise<DateSeriesData<T>>}
|
|
1783
2012
|
*/
|
|
1784
|
-
async _fetchSeriesData(path,
|
|
1785
|
-
const
|
|
1786
|
-
const raw = await this.getJson(path, {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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.
|
|
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
|
-
"
|
|
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
|
-
"
|
|
7546
|
+
"arkpool": "ArkPool",
|
|
7547
|
+
"asicminer": "ASICMiner",
|
|
7548
|
+
"axbt": "A-XBT",
|
|
7549
|
+
"batpool": "BATPOOL",
|
|
7550
|
+
"bcmonster": "BCMonster",
|
|
7359
7551
|
"bcpoolio": "bcpool.io",
|
|
7360
|
-
"
|
|
7361
|
-
"
|
|
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
|
-
"
|
|
7368
|
-
"
|
|
7369
|
-
"
|
|
7370
|
-
"
|
|
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
|
-
"
|
|
7373
|
-
"
|
|
7374
|
-
"
|
|
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
|
-
"
|
|
7386
|
-
"
|
|
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
|
-
"
|
|
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
|
-
"
|
|
7395
|
-
"
|
|
7396
|
-
"
|
|
7397
|
-
"
|
|
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
|
-
"
|
|
7403
|
-
"rawpool": "Rawpool",
|
|
7404
|
-
"haominer": "haominer",
|
|
7619
|
+
"hashpool": "HASHPOOL",
|
|
7405
7620
|
"helix": "Helix",
|
|
7406
|
-
"
|
|
7407
|
-
"
|
|
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
|
-
"
|
|
7414
|
-
"
|
|
7415
|
-
"
|
|
7416
|
-
"
|
|
7417
|
-
"
|
|
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
|
-
"
|
|
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
|
-
"
|
|
7430
|
-
"
|
|
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
|
-
"
|
|
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
|
-
"
|
|
7435
|
-
"
|
|
7436
|
-
"
|
|
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
|
-
"
|
|
7439
|
-
"
|
|
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
|
-
"
|
|
7444
|
-
"
|
|
7696
|
+
"triplemining": "TripleMining",
|
|
7697
|
+
"twentyoneinc": "21 Inc.",
|
|
7698
|
+
"ultimuspool": "ULTIMUSPOOL",
|
|
7699
|
+
"unknown": "Unknown",
|
|
7445
7700
|
"unomp": "UNOMP",
|
|
7446
|
-
"
|
|
7447
|
-
"
|
|
7448
|
-
"
|
|
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
|
-
"
|
|
7460
|
-
"
|
|
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
|
-
*
|
|
10477
|
+
* Health check
|
|
10244
10478
|
*
|
|
10245
|
-
*
|
|
10479
|
+
* Returns the health status of the API server, including uptime information.
|
|
10246
10480
|
*
|
|
10247
|
-
* Endpoint: `GET /
|
|
10248
|
-
* @param {{ signal?: AbortSignal,
|
|
10249
|
-
* @returns {Promise
|
|
10481
|
+
* Endpoint: `GET /health`
|
|
10482
|
+
* @param {{ signal?: AbortSignal, onValue?: (value: Health) => void }} [options]
|
|
10483
|
+
* @returns {Promise<Health>}
|
|
10250
10484
|
*/
|
|
10251
|
-
async
|
|
10252
|
-
const path = `/
|
|
10253
|
-
return this.
|
|
10485
|
+
async getHealth({ signal, onValue } = {}) {
|
|
10486
|
+
const path = `/health`;
|
|
10487
|
+
return this.getJson(path, { signal, onValue });
|
|
10254
10488
|
}
|
|
10255
10489
|
|
|
10256
10490
|
/**
|
|
10257
|
-
*
|
|
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
|
-
*
|
|
10493
|
+
* Returns the current version of the API server
|
|
10264
10494
|
*
|
|
10265
|
-
*
|
|
10266
|
-
* @param {{ signal?: AbortSignal,
|
|
10267
|
-
* @returns {Promise<
|
|
10495
|
+
* Endpoint: `GET /version`
|
|
10496
|
+
* @param {{ signal?: AbortSignal, onValue?: (value: string) => void }} [options]
|
|
10497
|
+
* @returns {Promise<string>}
|
|
10268
10498
|
*/
|
|
10269
|
-
async
|
|
10270
|
-
const path = `/
|
|
10271
|
-
return this.getJson(path, { signal,
|
|
10499
|
+
async getVersion({ signal, onValue } = {}) {
|
|
10500
|
+
const path = `/version`;
|
|
10501
|
+
return this.getJson(path, { signal, onValue });
|
|
10272
10502
|
}
|
|
10273
10503
|
|
|
10274
10504
|
/**
|
|
10275
|
-
*
|
|
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
|
-
*
|
|
10507
|
+
* Returns the sync status of the indexer, including indexed height, tip height, blocks behind, and last indexed timestamp.
|
|
10282
10508
|
*
|
|
10283
|
-
*
|
|
10284
|
-
* @param {
|
|
10285
|
-
* @
|
|
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
|
|
10289
|
-
const
|
|
10290
|
-
|
|
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
|
-
*
|
|
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
|
-
*
|
|
10521
|
+
* Returns the disk space used by BRK and Bitcoin data.
|
|
10304
10522
|
*
|
|
10305
|
-
*
|
|
10306
|
-
* @param {
|
|
10307
|
-
* @
|
|
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
|
|
10311
|
-
const
|
|
10312
|
-
|
|
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
|
-
*
|
|
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
|
-
*
|
|
10535
|
+
* Returns the complete hierarchical catalog of available series organized as a tree structure. Series are grouped by categories and subcategories.
|
|
10326
10536
|
*
|
|
10327
|
-
*
|
|
10328
|
-
* @param {{ signal?: AbortSignal,
|
|
10329
|
-
* @returns {Promise<
|
|
10537
|
+
* Endpoint: `GET /api/series`
|
|
10538
|
+
* @param {{ signal?: AbortSignal, onValue?: (value: TreeNode) => void }} [options]
|
|
10539
|
+
* @returns {Promise<TreeNode>}
|
|
10330
10540
|
*/
|
|
10331
|
-
async
|
|
10332
|
-
const path = `/api/
|
|
10333
|
-
return this.getJson(path, { signal,
|
|
10541
|
+
async getSeriesTree({ signal, onValue } = {}) {
|
|
10542
|
+
const path = `/api/series`;
|
|
10543
|
+
return this.getJson(path, { signal, onValue });
|
|
10334
10544
|
}
|
|
10335
10545
|
|
|
10336
10546
|
/**
|
|
10337
|
-
*
|
|
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
|
-
*
|
|
10549
|
+
* Returns the number of series available per index type.
|
|
10344
10550
|
*
|
|
10345
|
-
*
|
|
10346
|
-
* @param {{ signal?: AbortSignal,
|
|
10347
|
-
* @returns {Promise<
|
|
10551
|
+
* Endpoint: `GET /api/series/count`
|
|
10552
|
+
* @param {{ signal?: AbortSignal, onValue?: (value: SeriesCount[]) => void }} [options]
|
|
10553
|
+
* @returns {Promise<SeriesCount[]>}
|
|
10348
10554
|
*/
|
|
10349
|
-
async
|
|
10350
|
-
const path = `/api/
|
|
10351
|
-
return this.getJson(path, { signal,
|
|
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
|
-
*
|
|
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
|
-
*
|
|
10563
|
+
* Returns all available indexes with their accepted query aliases. Use any alias when querying series.
|
|
10362
10564
|
*
|
|
10363
|
-
*
|
|
10364
|
-
* @param {{ signal?: AbortSignal,
|
|
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
|
|
10368
|
-
const path = `/api/
|
|
10369
|
-
return this.
|
|
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
|
-
*
|
|
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
|
-
*
|
|
10577
|
+
* Paginated flat list of all available series names. Use `page` query param for pagination.
|
|
10378
10578
|
*
|
|
10379
|
-
* Endpoint: `GET /api/
|
|
10579
|
+
* Endpoint: `GET /api/series/list`
|
|
10380
10580
|
*
|
|
10381
|
-
* @param {
|
|
10382
|
-
* @param {
|
|
10383
|
-
* @
|
|
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
|
|
10386
|
-
const
|
|
10387
|
-
|
|
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
|
-
*
|
|
10392
|
-
*
|
|
10393
|
-
* Returns the hex-encoded 80-byte block header.
|
|
10596
|
+
* Search series
|
|
10394
10597
|
*
|
|
10395
|
-
*
|
|
10598
|
+
* Fuzzy search for series by name. Supports partial matches and typos.
|
|
10396
10599
|
*
|
|
10397
|
-
* Endpoint: `GET /api/
|
|
10600
|
+
* Endpoint: `GET /api/series/search`
|
|
10398
10601
|
*
|
|
10399
|
-
* @param {
|
|
10400
|
-
* @param {
|
|
10401
|
-
* @
|
|
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
|
|
10404
|
-
const
|
|
10405
|
-
|
|
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
|
-
*
|
|
10410
|
-
*
|
|
10411
|
-
* Returns the raw block data in binary format.
|
|
10617
|
+
* Get series info
|
|
10412
10618
|
*
|
|
10413
|
-
*
|
|
10619
|
+
* Returns the supported indexes and value type for the specified series.
|
|
10414
10620
|
*
|
|
10415
|
-
* Endpoint: `GET /api/
|
|
10621
|
+
* Endpoint: `GET /api/series/{series}`
|
|
10416
10622
|
*
|
|
10417
|
-
* @param {
|
|
10418
|
-
* @param {{ signal?: AbortSignal,
|
|
10419
|
-
* @returns {Promise
|
|
10623
|
+
* @param {SeriesName} series
|
|
10624
|
+
* @param {{ signal?: AbortSignal, onValue?: (value: SeriesInfo) => void }} [options]
|
|
10625
|
+
* @returns {Promise<SeriesInfo>}
|
|
10420
10626
|
*/
|
|
10421
|
-
async
|
|
10422
|
-
const path = `/api/
|
|
10423
|
-
return this.
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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/
|
|
10637
|
+
* Endpoint: `GET /api/series/{series}/{index}`
|
|
10434
10638
|
*
|
|
10435
|
-
* @param {
|
|
10436
|
-
* @param {
|
|
10437
|
-
* @
|
|
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
|
|
10440
|
-
const
|
|
10441
|
-
|
|
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
|
-
*
|
|
10661
|
+
* Get raw series data
|
|
10446
10662
|
*
|
|
10447
|
-
*
|
|
10663
|
+
* Returns just the data array without the SeriesData wrapper. Supports the same range and format parameters as the standard endpoint.
|
|
10448
10664
|
*
|
|
10449
|
-
*
|
|
10665
|
+
* Endpoint: `GET /api/series/{series}/{index}/data`
|
|
10450
10666
|
*
|
|
10451
|
-
*
|
|
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
|
-
*
|
|
10454
|
-
*
|
|
10455
|
-
*
|
|
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
|
|
10459
|
-
const path = `/api/
|
|
10460
|
-
return this.
|
|
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
|
-
*
|
|
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
|
-
*
|
|
10708
|
+
* Returns the total number of data points for a series at the given index.
|
|
10469
10709
|
*
|
|
10470
|
-
* Endpoint: `GET /api/
|
|
10710
|
+
* Endpoint: `GET /api/series/{series}/{index}/len`
|
|
10471
10711
|
*
|
|
10472
|
-
* @param {
|
|
10473
|
-
* @param {
|
|
10474
|
-
* @
|
|
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
|
|
10477
|
-
const path = `/api/
|
|
10478
|
-
return this.getJson(path, { signal,
|
|
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
|
-
*
|
|
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
|
-
*
|
|
10725
|
+
* Returns the current version of a series. Changes when the series data is updated.
|
|
10487
10726
|
*
|
|
10488
|
-
* Endpoint: `GET /api/
|
|
10727
|
+
* Endpoint: `GET /api/series/{series}/{index}/version`
|
|
10489
10728
|
*
|
|
10490
|
-
* @param {
|
|
10491
|
-
* @param {
|
|
10492
|
-
* @
|
|
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
|
|
10495
|
-
const path = `/api/
|
|
10496
|
-
return this.getJson(path, { signal,
|
|
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
|
-
*
|
|
10740
|
+
* Bulk series data
|
|
10501
10741
|
*
|
|
10502
|
-
*
|
|
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
|
-
*
|
|
10744
|
+
* Endpoint: `GET /api/series/bulk`
|
|
10505
10745
|
*
|
|
10506
|
-
*
|
|
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
|
-
*
|
|
10509
|
-
*
|
|
10510
|
-
*
|
|
10511
|
-
* @
|
|
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
|
|
10514
|
-
const path = `/api/
|
|
10515
|
-
return this.getJson(path, { signal,
|
|
10778
|
+
async listUrpdCohorts({ signal, onValue } = {}) {
|
|
10779
|
+
const path = `/api/urpd`;
|
|
10780
|
+
return this.getJson(path, { signal, onValue });
|
|
10516
10781
|
}
|
|
10517
10782
|
|
|
10518
10783
|
/**
|
|
10519
|
-
*
|
|
10784
|
+
* Available URPD dates
|
|
10520
10785
|
*
|
|
10521
|
-
*
|
|
10786
|
+
* Dates for which a URPD snapshot is available for the cohort. One entry per UTC day, sorted ascending.
|
|
10522
10787
|
*
|
|
10523
|
-
*
|
|
10788
|
+
* Endpoint: `GET /api/urpd/{cohort}/dates`
|
|
10524
10789
|
*
|
|
10525
|
-
*
|
|
10526
|
-
* @param {{ signal?: AbortSignal,
|
|
10527
|
-
* @returns {Promise<
|
|
10790
|
+
* @param {Cohort} cohort
|
|
10791
|
+
* @param {{ signal?: AbortSignal, onValue?: (value: Date[]) => void }} [options]
|
|
10792
|
+
* @returns {Promise<Date[]>}
|
|
10528
10793
|
*/
|
|
10529
|
-
async
|
|
10530
|
-
const path = `/api/
|
|
10531
|
-
return this.getJson(path, { signal,
|
|
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
|
-
*
|
|
10800
|
+
* Latest URPD
|
|
10536
10801
|
*
|
|
10537
|
-
*
|
|
10802
|
+
* URPD for the most recent available date in the cohort. The response's `date` field echoes which date was served.
|
|
10538
10803
|
*
|
|
10539
|
-
*
|
|
10804
|
+
* See the URPD tag description for the response shape and `agg` options.
|
|
10540
10805
|
*
|
|
10541
|
-
* Endpoint: `GET /api/
|
|
10542
|
-
*
|
|
10543
|
-
* @
|
|
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
|
|
10546
|
-
const
|
|
10547
|
-
|
|
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
|
-
*
|
|
10822
|
+
* URPD at date
|
|
10552
10823
|
*
|
|
10553
|
-
* Returns
|
|
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
|
-
*
|
|
10826
|
+
* See the URPD tag description for unit conventions and `agg` options.
|
|
10556
10827
|
*
|
|
10557
|
-
* Endpoint: `GET /api/
|
|
10558
|
-
*
|
|
10559
|
-
* @
|
|
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
|
|
10562
|
-
const
|
|
10563
|
-
|
|
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
|
-
*
|
|
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
|
-
*
|
|
10847
|
+
* Get current difficulty adjustment progress and estimates.
|
|
10572
10848
|
*
|
|
10573
|
-
*
|
|
10849
|
+
* *[Mempool.space docs](https://mempool.space/docs/api/rest#get-difficulty-adjustment)*
|
|
10574
10850
|
*
|
|
10575
|
-
*
|
|
10576
|
-
* @param {{ signal?: AbortSignal,
|
|
10577
|
-
* @returns {Promise<
|
|
10851
|
+
* Endpoint: `GET /api/v1/difficulty-adjustment`
|
|
10852
|
+
* @param {{ signal?: AbortSignal, onValue?: (value: DifficultyAdjustment) => void }} [options]
|
|
10853
|
+
* @returns {Promise<DifficultyAdjustment>}
|
|
10578
10854
|
*/
|
|
10579
|
-
async
|
|
10580
|
-
const path = `/api/
|
|
10581
|
-
return this.getJson(path, { signal,
|
|
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
|
-
*
|
|
10861
|
+
* Current BTC price
|
|
10586
10862
|
*
|
|
10587
|
-
*
|
|
10863
|
+
* Returns bitcoin latest price (on-chain derived, USD only).
|
|
10588
10864
|
*
|
|
10589
|
-
* *[Mempool.space docs](https://mempool.space/docs/api/rest#get-
|
|
10865
|
+
* *[Mempool.space docs](https://mempool.space/docs/api/rest#get-price)*
|
|
10590
10866
|
*
|
|
10591
|
-
* Endpoint: `GET /api/
|
|
10592
|
-
* @param {{ signal?: AbortSignal,
|
|
10593
|
-
* @returns {Promise<
|
|
10867
|
+
* Endpoint: `GET /api/v1/prices`
|
|
10868
|
+
* @param {{ signal?: AbortSignal, onValue?: (value: Prices) => void }} [options]
|
|
10869
|
+
* @returns {Promise<Prices>}
|
|
10594
10870
|
*/
|
|
10595
|
-
async
|
|
10596
|
-
const path = `/api/
|
|
10597
|
-
return this.getJson(path, { signal,
|
|
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
|
-
*
|
|
10877
|
+
* Historical price
|
|
10602
10878
|
*
|
|
10603
|
-
*
|
|
10879
|
+
* Get historical BTC/USD price. Optionally specify a UNIX timestamp to get the price at that time.
|
|
10604
10880
|
*
|
|
10605
|
-
*
|
|
10606
|
-
*
|
|
10607
|
-
*
|
|
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
|
|
10610
|
-
const
|
|
10611
|
-
|
|
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
|
-
*
|
|
10898
|
+
* Address information
|
|
10616
10899
|
*
|
|
10617
|
-
*
|
|
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-
|
|
10902
|
+
* *[Mempool.space docs](https://mempool.space/docs/api/rest#get-address)*
|
|
10620
10903
|
*
|
|
10621
|
-
* Endpoint: `GET /api/
|
|
10622
|
-
*
|
|
10623
|
-
* @
|
|
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
|
|
10626
|
-
const path = `/api/
|
|
10627
|
-
return this.getJson(path, { signal,
|
|
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
|
-
*
|
|
10916
|
+
* Address transactions
|
|
10632
10917
|
*
|
|
10633
|
-
* Get
|
|
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-
|
|
10920
|
+
* *[Mempool.space docs](https://mempool.space/docs/api/rest#get-address-transactions)*
|
|
10636
10921
|
*
|
|
10637
|
-
* Endpoint: `GET /api/
|
|
10638
|
-
*
|
|
10639
|
-
* @
|
|
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
|
|
10642
|
-
const path = `/api/
|
|
10643
|
-
return this.getJson(path, { signal,
|
|
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
|
-
*
|
|
10934
|
+
* Address confirmed transactions
|
|
10648
10935
|
*
|
|
10649
|
-
*
|
|
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
|
-
*
|
|
10652
|
-
*
|
|
10653
|
-
*
|
|
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
|
|
10656
|
-
const path = `/api/
|
|
10657
|
-
return this.getJson(path, { signal,
|
|
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
|
-
*
|
|
10952
|
+
* Address confirmed transactions (paginated)
|
|
10662
10953
|
*
|
|
10663
|
-
*
|
|
10954
|
+
* Get the next 25 confirmed transactions strictly older than `after_txid` (Esplora-canonical pagination form, matches mempool.space).
|
|
10664
10955
|
*
|
|
10665
|
-
*
|
|
10956
|
+
* *[Mempool.space docs](https://mempool.space/docs/api/rest#get-address-transactions-chain)*
|
|
10666
10957
|
*
|
|
10667
|
-
*
|
|
10668
|
-
*
|
|
10669
|
-
* @param {
|
|
10670
|
-
* @param {
|
|
10671
|
-
* @param {
|
|
10672
|
-
* @
|
|
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
|
|
10677
|
-
const
|
|
10678
|
-
|
|
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
|
-
*
|
|
10971
|
+
* Address mempool transactions
|
|
10692
10972
|
*
|
|
10693
|
-
*
|
|
10973
|
+
* Get unconfirmed transactions for an address from the mempool, newest first (up to 50).
|
|
10694
10974
|
*
|
|
10695
|
-
*
|
|
10696
|
-
*
|
|
10697
|
-
*
|
|
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
|
|
10700
|
-
const path = `/api/
|
|
10701
|
-
return this.getJson(path, { signal,
|
|
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
|
-
*
|
|
10989
|
+
* Address UTXOs
|
|
10706
10990
|
*
|
|
10707
|
-
*
|
|
10991
|
+
* Get unspent transaction outputs (UTXOs) for an address. Returns txid, vout, value, and confirmation status for each UTXO.
|
|
10708
10992
|
*
|
|
10709
|
-
*
|
|
10710
|
-
*
|
|
10711
|
-
*
|
|
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
|
|
10714
|
-
const path = `/api/
|
|
10715
|
-
return this.getJson(path, { signal,
|
|
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
|
-
*
|
|
11007
|
+
* Validate address
|
|
10720
11008
|
*
|
|
10721
|
-
*
|
|
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
|
-
*
|
|
11011
|
+
* *[Mempool.space docs](https://mempool.space/docs/api/rest#get-address-validate)*
|
|
10724
11012
|
*
|
|
10725
|
-
*
|
|
10726
|
-
*
|
|
10727
|
-
* @param {
|
|
10728
|
-
* @
|
|
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
|
|
10731
|
-
const
|
|
10732
|
-
|
|
10733
|
-
|
|
10734
|
-
|
|
10735
|
-
|
|
10736
|
-
|
|
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
|
-
*
|
|
11043
|
+
* Block (v1)
|
|
10741
11044
|
*
|
|
10742
|
-
*
|
|
11045
|
+
* Returns block details with extras by hash.
|
|
10743
11046
|
*
|
|
10744
|
-
*
|
|
11047
|
+
* *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-v1)*
|
|
10745
11048
|
*
|
|
10746
|
-
*
|
|
10747
|
-
*
|
|
10748
|
-
* @param {
|
|
10749
|
-
* @
|
|
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
|
|
10752
|
-
const
|
|
10753
|
-
|
|
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
|
-
*
|
|
11061
|
+
* Block header
|
|
10762
11062
|
*
|
|
10763
|
-
* Returns the
|
|
11063
|
+
* Returns the hex-encoded 80-byte block header.
|
|
10764
11064
|
*
|
|
10765
|
-
*
|
|
11065
|
+
* *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-header)*
|
|
10766
11066
|
*
|
|
10767
|
-
*
|
|
10768
|
-
*
|
|
10769
|
-
* @
|
|
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
|
|
10772
|
-
const path = `/api/
|
|
10773
|
-
return this.
|
|
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
|
-
*
|
|
11079
|
+
* Block hash by height
|
|
10778
11080
|
*
|
|
10779
|
-
*
|
|
11081
|
+
* Retrieve the block hash at a given height. Returns the hash as plain text.
|
|
10780
11082
|
*
|
|
10781
|
-
*
|
|
11083
|
+
* *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-height)*
|
|
10782
11084
|
*
|
|
10783
|
-
*
|
|
10784
|
-
*
|
|
10785
|
-
* @param {
|
|
10786
|
-
* @param {
|
|
10787
|
-
* @
|
|
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
|
|
10793
|
-
const
|
|
10794
|
-
|
|
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
|
-
*
|
|
11097
|
+
* Block by timestamp
|
|
10806
11098
|
*
|
|
10807
|
-
*
|
|
11099
|
+
* Find the block closest to a given UNIX timestamp.
|
|
10808
11100
|
*
|
|
10809
|
-
*
|
|
11101
|
+
* *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-timestamp)*
|
|
10810
11102
|
*
|
|
10811
|
-
*
|
|
10812
|
-
*
|
|
10813
|
-
* @param {
|
|
10814
|
-
* @param {
|
|
10815
|
-
* @
|
|
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
|
|
10821
|
-
const
|
|
10822
|
-
|
|
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
|
-
*
|
|
11115
|
+
* Raw block
|
|
10834
11116
|
*
|
|
10835
|
-
* Returns the
|
|
11117
|
+
* Returns the raw block data in binary format.
|
|
10836
11118
|
*
|
|
10837
|
-
*
|
|
11119
|
+
* *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-raw)*
|
|
10838
11120
|
*
|
|
10839
|
-
*
|
|
10840
|
-
*
|
|
10841
|
-
* @param {
|
|
10842
|
-
* @
|
|
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
|
|
10845
|
-
const path = `/api/
|
|
10846
|
-
return this.
|
|
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
|
-
*
|
|
11133
|
+
* Block status
|
|
10851
11134
|
*
|
|
10852
|
-
* Returns the
|
|
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
|
-
*
|
|
11137
|
+
* *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-status)*
|
|
10855
11138
|
*
|
|
10856
|
-
*
|
|
10857
|
-
*
|
|
10858
|
-
* @param {
|
|
10859
|
-
* @
|
|
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
|
|
10862
|
-
const path = `/api/
|
|
10863
|
-
return this.getJson(path, { signal,
|
|
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
|
-
*
|
|
11151
|
+
* Block tip height
|
|
10868
11152
|
*
|
|
10869
|
-
* Returns the
|
|
11153
|
+
* Returns the height of the last block.
|
|
10870
11154
|
*
|
|
10871
|
-
*
|
|
11155
|
+
* *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-tip-height)*
|
|
10872
11156
|
*
|
|
10873
|
-
*
|
|
10874
|
-
* @param {
|
|
10875
|
-
* @
|
|
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
|
|
10879
|
-
const path = `/api/
|
|
10880
|
-
return this.
|
|
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
|
-
*
|
|
11167
|
+
* Block tip hash
|
|
10885
11168
|
*
|
|
10886
|
-
* Returns the
|
|
11169
|
+
* Returns the hash of the last block.
|
|
10887
11170
|
*
|
|
10888
|
-
*
|
|
10889
|
-
*
|
|
10890
|
-
*
|
|
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
|
|
10893
|
-
const path = `/api/
|
|
10894
|
-
return this.
|
|
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
|
-
*
|
|
11183
|
+
* Transaction ID at index
|
|
10899
11184
|
*
|
|
10900
|
-
*
|
|
11185
|
+
* Retrieve a single transaction ID at a specific index within a block. Returns plain text txid.
|
|
10901
11186
|
*
|
|
10902
|
-
*
|
|
10903
|
-
*
|
|
10904
|
-
*
|
|
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
|
|
10907
|
-
const path = `/api/
|
|
10908
|
-
return this.
|
|
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
|
-
*
|
|
11202
|
+
* Block transaction IDs
|
|
10913
11203
|
*
|
|
10914
|
-
* Retrieve
|
|
11204
|
+
* Retrieve all transaction IDs in a block. Returns an array of txids in block order.
|
|
10915
11205
|
*
|
|
10916
|
-
*
|
|
11206
|
+
* *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-transaction-ids)*
|
|
10917
11207
|
*
|
|
10918
|
-
*
|
|
10919
|
-
*
|
|
10920
|
-
* @
|
|
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
|
|
10923
|
-
const path = `/api/
|
|
10924
|
-
return this.
|
|
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
|
-
*
|
|
11220
|
+
* Block transactions
|
|
10929
11221
|
*
|
|
10930
|
-
* Retrieve
|
|
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-
|
|
11224
|
+
* *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-transactions)*
|
|
10933
11225
|
*
|
|
10934
|
-
* Endpoint: `GET /api/
|
|
11226
|
+
* Endpoint: `GET /api/block/{hash}/txs`
|
|
10935
11227
|
*
|
|
10936
|
-
* @param {
|
|
10937
|
-
* @param {{ signal?: AbortSignal,
|
|
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
|
|
10941
|
-
const path = `/api/
|
|
10942
|
-
return this.getJson(path, { signal,
|
|
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
|
-
*
|
|
11238
|
+
* Block transactions (paginated)
|
|
10947
11239
|
*
|
|
10948
|
-
* Retrieve
|
|
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-
|
|
11242
|
+
* *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-transactions)*
|
|
10951
11243
|
*
|
|
10952
|
-
* Endpoint: `GET /api/
|
|
11244
|
+
* Endpoint: `GET /api/block/{hash}/txs/{start_index}`
|
|
10953
11245
|
*
|
|
10954
|
-
* @param {
|
|
10955
|
-
* @param {
|
|
10956
|
-
* @
|
|
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
|
|
10959
|
-
const path = `/api/
|
|
10960
|
-
return this.
|
|
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
|
-
*
|
|
10965
|
-
*
|
|
10966
|
-
* Get the merkle inclusion proof for a transaction.
|
|
11257
|
+
* Recent blocks
|
|
10967
11258
|
*
|
|
10968
|
-
*
|
|
11259
|
+
* Retrieve the last 10 blocks. Returns block metadata for each block.
|
|
10969
11260
|
*
|
|
10970
|
-
*
|
|
11261
|
+
* *[Mempool.space docs](https://mempool.space/docs/api/rest#get-blocks)*
|
|
10971
11262
|
*
|
|
10972
|
-
*
|
|
10973
|
-
* @param {{ signal?: AbortSignal,
|
|
10974
|
-
* @returns {Promise<
|
|
11263
|
+
* Endpoint: `GET /api/blocks`
|
|
11264
|
+
* @param {{ signal?: AbortSignal, onValue?: (value: BlockInfo[]) => void }} [options]
|
|
11265
|
+
* @returns {Promise<BlockInfo[]>}
|
|
10975
11266
|
*/
|
|
10976
|
-
async
|
|
10977
|
-
const path = `/api/
|
|
10978
|
-
return this.getJson(path, { signal,
|
|
11267
|
+
async getBlocks({ signal, onValue } = {}) {
|
|
11268
|
+
const path = `/api/blocks`;
|
|
11269
|
+
return this.getJson(path, { signal, onValue });
|
|
10979
11270
|
}
|
|
10980
11271
|
|
|
10981
11272
|
/**
|
|
10982
|
-
*
|
|
11273
|
+
* Blocks from height
|
|
10983
11274
|
*
|
|
10984
|
-
*
|
|
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-
|
|
11277
|
+
* *[Mempool.space docs](https://mempool.space/docs/api/rest#get-blocks)*
|
|
10987
11278
|
*
|
|
10988
|
-
* Endpoint: `GET /api/
|
|
11279
|
+
* Endpoint: `GET /api/blocks/{height}`
|
|
10989
11280
|
*
|
|
10990
|
-
* @param {
|
|
10991
|
-
* @param {{ signal?: AbortSignal,
|
|
10992
|
-
* @returns {Promise
|
|
11281
|
+
* @param {Height} height
|
|
11282
|
+
* @param {{ signal?: AbortSignal, onValue?: (value: BlockInfo[]) => void }} [options]
|
|
11283
|
+
* @returns {Promise<BlockInfo[]>}
|
|
10993
11284
|
*/
|
|
10994
|
-
async
|
|
10995
|
-
const path = `/api/
|
|
10996
|
-
return this.
|
|
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
|
-
*
|
|
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
|
-
*
|
|
11293
|
+
* Retrieve the last 15 blocks with extended data including pool identification and fee statistics.
|
|
11005
11294
|
*
|
|
11006
|
-
*
|
|
11295
|
+
* *[Mempool.space docs](https://mempool.space/docs/api/rest#get-blocks-v1)*
|
|
11007
11296
|
*
|
|
11008
|
-
*
|
|
11009
|
-
* @param {
|
|
11010
|
-
* @
|
|
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
|
|
11014
|
-
const path = `/api/
|
|
11015
|
-
return this.getJson(path, { signal,
|
|
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
|
-
*
|
|
11307
|
+
* Blocks from height with extras
|
|
11020
11308
|
*
|
|
11021
|
-
*
|
|
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-
|
|
11311
|
+
* *[Mempool.space docs](https://mempool.space/docs/api/rest#get-blocks-v1)*
|
|
11024
11312
|
*
|
|
11025
|
-
* Endpoint: `GET /api/
|
|
11313
|
+
* Endpoint: `GET /api/v1/blocks/{height}`
|
|
11026
11314
|
*
|
|
11027
|
-
* @param {
|
|
11028
|
-
* @param {{ signal?: AbortSignal,
|
|
11029
|
-
* @returns {Promise<
|
|
11315
|
+
* @param {Height} height
|
|
11316
|
+
* @param {{ signal?: AbortSignal, onValue?: (value: BlockInfoV1[]) => void }} [options]
|
|
11317
|
+
* @returns {Promise<BlockInfoV1[]>}
|
|
11030
11318
|
*/
|
|
11031
|
-
async
|
|
11032
|
-
const path = `/api/
|
|
11033
|
-
return this.getJson(path, { signal,
|
|
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
|
-
*
|
|
11038
|
-
*
|
|
11039
|
-
* Returns a transaction as binary data.
|
|
11325
|
+
* List all mining pools
|
|
11040
11326
|
*
|
|
11041
|
-
*
|
|
11327
|
+
* Get list of all known mining pools with their identifiers.
|
|
11042
11328
|
*
|
|
11043
|
-
*
|
|
11329
|
+
* *[Mempool.space docs](https://mempool.space/docs/api/rest#get-mining-pools)*
|
|
11044
11330
|
*
|
|
11045
|
-
*
|
|
11046
|
-
* @param {{ signal?: AbortSignal,
|
|
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
|
|
11050
|
-
const path = `/api/
|
|
11051
|
-
return this.
|
|
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
|
-
*
|
|
11341
|
+
* Mining pool statistics
|
|
11056
11342
|
*
|
|
11057
|
-
*
|
|
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-
|
|
11345
|
+
* *[Mempool.space docs](https://mempool.space/docs/api/rest#get-mining-pools)*
|
|
11060
11346
|
*
|
|
11061
|
-
* Endpoint: `GET /api/
|
|
11347
|
+
* Endpoint: `GET /api/v1/mining/pools/{time_period}`
|
|
11062
11348
|
*
|
|
11063
|
-
* @param {
|
|
11064
|
-
* @param {{ signal?: AbortSignal,
|
|
11065
|
-
* @returns {Promise<
|
|
11349
|
+
* @param {TimePeriod} time_period
|
|
11350
|
+
* @param {{ signal?: AbortSignal, onValue?: (value: PoolsSummary) => void }} [options]
|
|
11351
|
+
* @returns {Promise<PoolsSummary>}
|
|
11066
11352
|
*/
|
|
11067
|
-
async
|
|
11068
|
-
const path = `/api/
|
|
11069
|
-
return this.getJson(path, { signal,
|
|
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
|
-
*
|
|
11359
|
+
* Mining pool details
|
|
11074
11360
|
*
|
|
11075
|
-
*
|
|
11361
|
+
* Get detailed information about a specific mining pool including block counts and shares for different time periods.
|
|
11076
11362
|
*
|
|
11077
|
-
*
|
|
11078
|
-
*
|
|
11079
|
-
*
|
|
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
|
|
11082
|
-
const path = `/api/
|
|
11083
|
-
return this.getJson(path, { signal,
|
|
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
|
-
*
|
|
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
|
-
*
|
|
11379
|
+
* Get hashrate data for all mining pools.
|
|
11092
11380
|
*
|
|
11093
|
-
*
|
|
11381
|
+
* *[Mempool.space docs](https://mempool.space/docs/api/rest#get-mining-pool-hashrates)*
|
|
11094
11382
|
*
|
|
11095
|
-
*
|
|
11096
|
-
* @param {
|
|
11097
|
-
* @
|
|
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
|
|
11101
|
-
const
|
|
11102
|
-
|
|
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
|
-
*
|
|
11393
|
+
* All pools hashrate
|
|
11110
11394
|
*
|
|
11111
|
-
*
|
|
11395
|
+
* Get hashrate data for all mining pools for a time period. Valid periods: `1m`, `3m`, `6m`, `1y`, `2y`, `3y`.
|
|
11112
11396
|
*
|
|
11113
|
-
*
|
|
11397
|
+
* *[Mempool.space docs](https://mempool.space/docs/api/rest#get-mining-pool-hashrates)*
|
|
11114
11398
|
*
|
|
11115
|
-
*
|
|
11116
|
-
*
|
|
11117
|
-
* @
|
|
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
|
|
11120
|
-
const path = `/api/
|
|
11121
|
-
return this.getJson(path, { signal,
|
|
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
|
-
*
|
|
11411
|
+
* Mining pool hashrate
|
|
11126
11412
|
*
|
|
11127
|
-
*
|
|
11413
|
+
* Get hashrate history for a specific mining pool.
|
|
11128
11414
|
*
|
|
11129
|
-
*
|
|
11415
|
+
* *[Mempool.space docs](https://mempool.space/docs/api/rest#get-mining-pool-hashrate)*
|
|
11130
11416
|
*
|
|
11131
|
-
* Endpoint: `GET /api/
|
|
11417
|
+
* Endpoint: `GET /api/v1/mining/pool/{slug}/hashrate`
|
|
11132
11418
|
*
|
|
11133
|
-
* @param {
|
|
11134
|
-
* @param {
|
|
11135
|
-
* @
|
|
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
|
|
11140
|
-
const
|
|
11141
|
-
|
|
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
|
-
*
|
|
11429
|
+
* Mining pool blocks
|
|
11149
11430
|
*
|
|
11150
|
-
*
|
|
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-
|
|
11433
|
+
* *[Mempool.space docs](https://mempool.space/docs/api/rest#get-mining-pool-blocks)*
|
|
11153
11434
|
*
|
|
11154
|
-
* Endpoint: `GET /api/v1/
|
|
11435
|
+
* Endpoint: `GET /api/v1/mining/pool/{slug}/blocks`
|
|
11155
11436
|
*
|
|
11156
|
-
* @param {
|
|
11157
|
-
* @param {{ signal?: AbortSignal,
|
|
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
|
|
11161
|
-
const path = `/api/v1/
|
|
11162
|
-
return this.getJson(path, { signal,
|
|
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
|
-
*
|
|
11447
|
+
* Mining pool blocks from height
|
|
11167
11448
|
*
|
|
11168
|
-
*
|
|
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
|
|
11451
|
+
* *[Mempool.space docs](https://mempool.space/docs/api/rest#get-mining-pool-blocks)*
|
|
11171
11452
|
*
|
|
11172
|
-
* Endpoint: `GET /api/v1/blocks`
|
|
11173
|
-
*
|
|
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
|
|
11177
|
-
const path = `/api/v1/blocks`;
|
|
11178
|
-
return this.getJson(path, { signal,
|
|
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
|
-
*
|
|
11183
|
-
*
|
|
11184
|
-
* Retrieve up to 10 blocks with extended data going backwards from the given height.
|
|
11466
|
+
* Network hashrate (all time)
|
|
11185
11467
|
*
|
|
11186
|
-
*
|
|
11468
|
+
* Get network hashrate and difficulty data for all time.
|
|
11187
11469
|
*
|
|
11188
|
-
*
|
|
11470
|
+
* *[Mempool.space docs](https://mempool.space/docs/api/rest#get-hashrate)*
|
|
11189
11471
|
*
|
|
11190
|
-
*
|
|
11191
|
-
* @param {{ signal?: AbortSignal,
|
|
11192
|
-
* @returns {Promise<
|
|
11472
|
+
* Endpoint: `GET /api/v1/mining/hashrate`
|
|
11473
|
+
* @param {{ signal?: AbortSignal, onValue?: (value: HashrateSummary) => void }} [options]
|
|
11474
|
+
* @returns {Promise<HashrateSummary>}
|
|
11193
11475
|
*/
|
|
11194
|
-
async
|
|
11195
|
-
const path = `/api/v1/
|
|
11196
|
-
return this.getJson(path, { signal,
|
|
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
|
-
*
|
|
11482
|
+
* Network hashrate
|
|
11201
11483
|
*
|
|
11202
|
-
*
|
|
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-
|
|
11486
|
+
* *[Mempool.space docs](https://mempool.space/docs/api/rest#get-hashrate)*
|
|
11205
11487
|
*
|
|
11206
|
-
* Endpoint: `GET /api/v1/
|
|
11488
|
+
* Endpoint: `GET /api/v1/mining/hashrate/{time_period}`
|
|
11207
11489
|
*
|
|
11208
|
-
* @param {
|
|
11209
|
-
* @param {{ signal?: AbortSignal,
|
|
11210
|
-
* @returns {Promise<
|
|
11490
|
+
* @param {TimePeriod} time_period
|
|
11491
|
+
* @param {{ signal?: AbortSignal, onValue?: (value: HashrateSummary) => void }} [options]
|
|
11492
|
+
* @returns {Promise<HashrateSummary>}
|
|
11211
11493
|
*/
|
|
11212
|
-
async
|
|
11213
|
-
const path = `/api/v1/
|
|
11214
|
-
return this.getJson(path, { signal,
|
|
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
|
|
11500
|
+
* Difficulty adjustments (all time)
|
|
11219
11501
|
*
|
|
11220
|
-
* Get
|
|
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-
|
|
11504
|
+
* *[Mempool.space docs](https://mempool.space/docs/api/rest#get-difficulty-adjustments)*
|
|
11223
11505
|
*
|
|
11224
|
-
* Endpoint: `GET /api/v1/difficulty-
|
|
11225
|
-
* @param {{ signal?: AbortSignal,
|
|
11226
|
-
* @returns {Promise<
|
|
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
|
|
11229
|
-
const path = `/api/v1/difficulty-
|
|
11230
|
-
return this.getJson(path, { signal,
|
|
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
|
-
*
|
|
11516
|
+
* Difficulty adjustments
|
|
11235
11517
|
*
|
|
11236
|
-
* Get
|
|
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-
|
|
11520
|
+
* *[Mempool.space docs](https://mempool.space/docs/api/rest#get-difficulty-adjustments)*
|
|
11239
11521
|
*
|
|
11240
|
-
* Endpoint: `GET /api/v1/
|
|
11241
|
-
*
|
|
11242
|
-
* @
|
|
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
|
|
11245
|
-
const path = `/api/v1/
|
|
11246
|
-
return this.getJson(path, { signal,
|
|
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
|
-
*
|
|
11534
|
+
* Mining reward statistics
|
|
11251
11535
|
*
|
|
11252
|
-
* Get
|
|
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-
|
|
11538
|
+
* *[Mempool.space docs](https://mempool.space/docs/api/rest#get-reward-stats)*
|
|
11255
11539
|
*
|
|
11256
|
-
* Endpoint: `GET /api/v1/
|
|
11257
|
-
*
|
|
11258
|
-
* @
|
|
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
|
|
11261
|
-
const path = `/api/v1/
|
|
11262
|
-
return this.getJson(path, { signal,
|
|
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
|
-
*
|
|
11552
|
+
* Block fees
|
|
11267
11553
|
*
|
|
11268
|
-
* Get
|
|
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-
|
|
11556
|
+
* *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-fees)*
|
|
11271
11557
|
*
|
|
11272
|
-
* Endpoint: `GET /api/v1/fees/
|
|
11273
|
-
*
|
|
11274
|
-
* @
|
|
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
|
|
11277
|
-
const path = `/api/v1/fees
|
|
11278
|
-
return this.getJson(path, { signal,
|
|
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
|
-
*
|
|
11570
|
+
* Block rewards
|
|
11283
11571
|
*
|
|
11284
|
-
* Get
|
|
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-
|
|
11574
|
+
* *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-rewards)*
|
|
11287
11575
|
*
|
|
11288
|
-
* Endpoint: `GET /api/v1/
|
|
11576
|
+
* Endpoint: `GET /api/v1/mining/blocks/rewards/{time_period}`
|
|
11289
11577
|
*
|
|
11290
|
-
* @param {
|
|
11291
|
-
* @param {{ signal?: AbortSignal,
|
|
11292
|
-
* @returns {Promise<
|
|
11578
|
+
* @param {TimePeriod} time_period
|
|
11579
|
+
* @param {{ signal?: AbortSignal, onValue?: (value: BlockRewardsEntry[]) => void }} [options]
|
|
11580
|
+
* @returns {Promise<BlockRewardsEntry[]>}
|
|
11293
11581
|
*/
|
|
11294
|
-
async
|
|
11295
|
-
const
|
|
11296
|
-
|
|
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,
|
|
11597
|
+
* @param {{ signal?: AbortSignal, onValue?: (value: BlockFeeRatesEntry[]) => void }} [options]
|
|
11313
11598
|
* @returns {Promise<BlockFeeRatesEntry[]>}
|
|
11314
11599
|
*/
|
|
11315
|
-
async getBlockFeeRates(time_period, { signal,
|
|
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,
|
|
11602
|
+
return this.getJson(path, { signal, onValue });
|
|
11318
11603
|
}
|
|
11319
11604
|
|
|
11320
11605
|
/**
|
|
11321
|
-
* Block
|
|
11606
|
+
* Block sizes and weights
|
|
11322
11607
|
*
|
|
11323
|
-
* Get average
|
|
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-
|
|
11610
|
+
* *[Mempool.space docs](https://mempool.space/docs/api/rest#get-sizes-weights)*
|
|
11326
11611
|
*
|
|
11327
|
-
* Endpoint: `GET /api/v1/mining/blocks/
|
|
11612
|
+
* Endpoint: `GET /api/v1/mining/blocks/sizes-weights/{time_period}`
|
|
11328
11613
|
*
|
|
11329
11614
|
* @param {TimePeriod} time_period
|
|
11330
|
-
* @param {{ signal?: AbortSignal,
|
|
11331
|
-
* @returns {Promise<
|
|
11615
|
+
* @param {{ signal?: AbortSignal, onValue?: (value: BlockSizesWeights) => void }} [options]
|
|
11616
|
+
* @returns {Promise<BlockSizesWeights>}
|
|
11332
11617
|
*/
|
|
11333
|
-
async
|
|
11334
|
-
const path = `/api/v1/mining/blocks/
|
|
11335
|
-
return this.getJson(path, { signal,
|
|
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
|
-
*
|
|
11624
|
+
* Projected mempool blocks
|
|
11340
11625
|
*
|
|
11341
|
-
* Get
|
|
11626
|
+
* Get projected blocks from the mempool for fee estimation.
|
|
11342
11627
|
*
|
|
11343
|
-
* *[Mempool.space docs](https://mempool.space/docs/api/rest#get-
|
|
11628
|
+
* *[Mempool.space docs](https://mempool.space/docs/api/rest#get-mempool-blocks-fees)*
|
|
11344
11629
|
*
|
|
11345
|
-
* Endpoint: `GET /api/v1/
|
|
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
|
-
*
|
|
11348
|
-
*
|
|
11349
|
-
*
|
|
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
|
|
11352
|
-
const path = `/api/v1/
|
|
11353
|
-
return this.getJson(path, { signal,
|
|
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
|
-
*
|
|
11656
|
+
* Precise recommended fees
|
|
11358
11657
|
*
|
|
11359
|
-
* Get
|
|
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
|
-
*
|
|
11674
|
+
* Get current mempool statistics including transaction count, total vsize, total fees, and fee histogram.
|
|
11362
11675
|
*
|
|
11363
|
-
*
|
|
11676
|
+
* *[Mempool.space docs](https://mempool.space/docs/api/rest#get-mempool)*
|
|
11364
11677
|
*
|
|
11365
|
-
*
|
|
11366
|
-
* @param {{ signal?: AbortSignal,
|
|
11367
|
-
* @returns {Promise<
|
|
11678
|
+
* Endpoint: `GET /api/mempool`
|
|
11679
|
+
* @param {{ signal?: AbortSignal, onValue?: (value: MempoolInfo) => void }} [options]
|
|
11680
|
+
* @returns {Promise<MempoolInfo>}
|
|
11368
11681
|
*/
|
|
11369
|
-
async
|
|
11370
|
-
const path = `/api/
|
|
11371
|
-
return this.getJson(path, { signal,
|
|
11682
|
+
async getMempool({ signal, onValue } = {}) {
|
|
11683
|
+
const path = `/api/mempool`;
|
|
11684
|
+
return this.getJson(path, { signal, onValue });
|
|
11372
11685
|
}
|
|
11373
11686
|
|
|
11374
11687
|
/**
|
|
11375
|
-
*
|
|
11376
|
-
*
|
|
11377
|
-
* Find the block closest to a given UNIX timestamp.
|
|
11688
|
+
* Mempool content hash
|
|
11378
11689
|
*
|
|
11379
|
-
*
|
|
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
|
-
*
|
|
11384
|
-
* @param {{ signal?: AbortSignal,
|
|
11385
|
-
* @returns {Promise<
|
|
11692
|
+
* Endpoint: `GET /api/mempool/hash`
|
|
11693
|
+
* @param {{ signal?: AbortSignal, onValue?: (value: number) => void }} [options]
|
|
11694
|
+
* @returns {Promise<number>}
|
|
11386
11695
|
*/
|
|
11387
|
-
async
|
|
11388
|
-
const path = `/api/
|
|
11389
|
-
return this.getJson(path, { signal,
|
|
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
|
-
*
|
|
11702
|
+
* Mempool transaction IDs
|
|
11394
11703
|
*
|
|
11395
|
-
* Get
|
|
11704
|
+
* Get all transaction IDs currently in the mempool.
|
|
11396
11705
|
*
|
|
11397
|
-
* *[Mempool.space docs](https://mempool.space/docs/api/rest#get-
|
|
11706
|
+
* *[Mempool.space docs](https://mempool.space/docs/api/rest#get-mempool-transaction-ids)*
|
|
11398
11707
|
*
|
|
11399
|
-
* Endpoint: `GET /api/
|
|
11400
|
-
* @param {{ signal?: AbortSignal,
|
|
11401
|
-
* @returns {Promise<
|
|
11708
|
+
* Endpoint: `GET /api/mempool/txids`
|
|
11709
|
+
* @param {{ signal?: AbortSignal, onValue?: (value: Txid[]) => void }} [options]
|
|
11710
|
+
* @returns {Promise<Txid[]>}
|
|
11402
11711
|
*/
|
|
11403
|
-
async
|
|
11404
|
-
const path = `/api/
|
|
11405
|
-
return this.getJson(path, { signal,
|
|
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
|
-
*
|
|
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
|
-
*
|
|
11720
|
+
* Get the last 10 transactions to enter the mempool.
|
|
11414
11721
|
*
|
|
11415
|
-
*
|
|
11722
|
+
* *[Mempool.space docs](https://mempool.space/docs/api/rest#get-mempool-recent)*
|
|
11416
11723
|
*
|
|
11417
|
-
*
|
|
11418
|
-
* @param {{ signal?: AbortSignal,
|
|
11419
|
-
* @returns {Promise<
|
|
11724
|
+
* Endpoint: `GET /api/mempool/recent`
|
|
11725
|
+
* @param {{ signal?: AbortSignal, onValue?: (value: MempoolRecentTx[]) => void }} [options]
|
|
11726
|
+
* @returns {Promise<MempoolRecentTx[]>}
|
|
11420
11727
|
*/
|
|
11421
|
-
async
|
|
11422
|
-
const path = `/api/
|
|
11423
|
-
return this.getJson(path, { signal,
|
|
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
|
-
*
|
|
11734
|
+
* Recent RBF replacements
|
|
11428
11735
|
*
|
|
11429
|
-
*
|
|
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-
|
|
11738
|
+
* *[Mempool.space docs](https://mempool.space/docs/api/rest#get-replacements)*
|
|
11432
11739
|
*
|
|
11433
|
-
* Endpoint: `GET /api/v1/
|
|
11434
|
-
* @param {{ signal?: AbortSignal,
|
|
11435
|
-
* @returns {Promise<
|
|
11740
|
+
* Endpoint: `GET /api/v1/replacements`
|
|
11741
|
+
* @param {{ signal?: AbortSignal, onValue?: (value: ReplacementNode[]) => void }} [options]
|
|
11742
|
+
* @returns {Promise<ReplacementNode[]>}
|
|
11436
11743
|
*/
|
|
11437
|
-
async
|
|
11438
|
-
const path = `/api/v1/
|
|
11439
|
-
return this.getJson(path, { signal,
|
|
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
|
-
*
|
|
11750
|
+
* Recent full-RBF replacements
|
|
11444
11751
|
*
|
|
11445
|
-
*
|
|
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-
|
|
11754
|
+
* *[Mempool.space docs](https://mempool.space/docs/api/rest#get-fullrbf-replacements)*
|
|
11448
11755
|
*
|
|
11449
|
-
* Endpoint: `GET /api/v1/
|
|
11450
|
-
* @param {{ signal?: AbortSignal,
|
|
11451
|
-
* @returns {Promise<
|
|
11756
|
+
* Endpoint: `GET /api/v1/fullrbf/replacements`
|
|
11757
|
+
* @param {{ signal?: AbortSignal, onValue?: (value: ReplacementNode[]) => void }} [options]
|
|
11758
|
+
* @returns {Promise<ReplacementNode[]>}
|
|
11452
11759
|
*/
|
|
11453
|
-
async
|
|
11454
|
-
const path = `/api/v1/
|
|
11455
|
-
return this.getJson(path, { signal,
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
11468
|
-
* @param {{ signal?: AbortSignal,
|
|
11469
|
-
* @returns {Promise<
|
|
11770
|
+
* Endpoint: `GET /api/mempool/price`
|
|
11771
|
+
* @param {{ signal?: AbortSignal, onValue?: (value: Dollars) => void }} [options]
|
|
11772
|
+
* @returns {Promise<Dollars>}
|
|
11470
11773
|
*/
|
|
11471
|
-
async
|
|
11472
|
-
const path = `/api/
|
|
11473
|
-
return this.getJson(path, { signal,
|
|
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
|
-
*
|
|
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
|
-
*
|
|
11782
|
+
* Retrieve the transaction ID (txid) at a given global transaction index. Returns the txid as plain text.
|
|
11482
11783
|
*
|
|
11483
|
-
* Endpoint: `GET /api/
|
|
11784
|
+
* Endpoint: `GET /api/tx-index/{index}`
|
|
11484
11785
|
*
|
|
11485
|
-
* @param {
|
|
11486
|
-
* @param {{ signal?: AbortSignal,
|
|
11487
|
-
* @returns {Promise<
|
|
11786
|
+
* @param {TxIndex} index
|
|
11787
|
+
* @param {{ signal?: AbortSignal, onValue?: (value: Txid) => void }} [options]
|
|
11788
|
+
* @returns {Promise<Txid>}
|
|
11488
11789
|
*/
|
|
11489
|
-
async
|
|
11490
|
-
const path = `/api/
|
|
11491
|
-
return this.
|
|
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
|
-
*
|
|
11796
|
+
* CPFP info
|
|
11496
11797
|
*
|
|
11497
|
-
*
|
|
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-
|
|
11800
|
+
* *[Mempool.space docs](https://mempool.space/docs/api/rest#get-children-pay-for-parent)*
|
|
11500
11801
|
*
|
|
11501
|
-
* Endpoint: `GET /api/v1/
|
|
11802
|
+
* Endpoint: `GET /api/v1/cpfp/{txid}`
|
|
11502
11803
|
*
|
|
11503
|
-
* @param {
|
|
11504
|
-
* @param {{ signal?: AbortSignal,
|
|
11505
|
-
* @returns {Promise<
|
|
11804
|
+
* @param {Txid} txid
|
|
11805
|
+
* @param {{ signal?: AbortSignal, onValue?: (value: CpfpInfo) => void }} [options]
|
|
11806
|
+
* @returns {Promise<CpfpInfo>}
|
|
11506
11807
|
*/
|
|
11507
|
-
async
|
|
11508
|
-
const path = `/api/v1/
|
|
11509
|
-
return this.getJson(path, { signal,
|
|
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
|
-
*
|
|
11814
|
+
* RBF replacement history
|
|
11514
11815
|
*
|
|
11515
|
-
*
|
|
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-
|
|
11818
|
+
* *[Mempool.space docs](https://mempool.space/docs/api/rest#get-transaction-rbf-history)*
|
|
11518
11819
|
*
|
|
11519
|
-
* Endpoint: `GET /api/v1/
|
|
11820
|
+
* Endpoint: `GET /api/v1/tx/{txid}/rbf`
|
|
11520
11821
|
*
|
|
11521
|
-
* @param {
|
|
11522
|
-
* @param {{ signal?: AbortSignal,
|
|
11523
|
-
* @returns {Promise<
|
|
11822
|
+
* @param {Txid} txid
|
|
11823
|
+
* @param {{ signal?: AbortSignal, onValue?: (value: RbfResponse) => void }} [options]
|
|
11824
|
+
* @returns {Promise<RbfResponse>}
|
|
11524
11825
|
*/
|
|
11525
|
-
async
|
|
11526
|
-
const path = `/api/v1/
|
|
11527
|
-
return this.getJson(path, { signal,
|
|
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
|
-
*
|
|
11832
|
+
* Transaction information
|
|
11532
11833
|
*
|
|
11533
|
-
*
|
|
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-
|
|
11836
|
+
* *[Mempool.space docs](https://mempool.space/docs/api/rest#get-transaction)*
|
|
11536
11837
|
*
|
|
11537
|
-
* Endpoint: `GET /api/
|
|
11838
|
+
* Endpoint: `GET /api/tx/{txid}`
|
|
11538
11839
|
*
|
|
11539
|
-
* @param {
|
|
11540
|
-
* @param {
|
|
11541
|
-
* @
|
|
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
|
|
11545
|
-
const path = `/api/
|
|
11546
|
-
return this.getJson(path, { signal,
|
|
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
|
-
*
|
|
11850
|
+
* Transaction hex
|
|
11551
11851
|
*
|
|
11552
|
-
*
|
|
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-
|
|
11854
|
+
* *[Mempool.space docs](https://mempool.space/docs/api/rest#get-transaction-hex)*
|
|
11555
11855
|
*
|
|
11556
|
-
* Endpoint: `GET /api/
|
|
11856
|
+
* Endpoint: `GET /api/tx/{txid}/hex`
|
|
11557
11857
|
*
|
|
11558
|
-
* @param {
|
|
11559
|
-
* @param {{ signal?: AbortSignal,
|
|
11560
|
-
* @returns {Promise<
|
|
11858
|
+
* @param {Txid} txid
|
|
11859
|
+
* @param {{ signal?: AbortSignal, onValue?: (value: Hex) => void }} [options]
|
|
11860
|
+
* @returns {Promise<Hex>}
|
|
11561
11861
|
*/
|
|
11562
|
-
async
|
|
11563
|
-
const path = `/api/
|
|
11564
|
-
return this.
|
|
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
|
-
*
|
|
11868
|
+
* Transaction merkleblock proof
|
|
11569
11869
|
*
|
|
11570
|
-
* Get
|
|
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-
|
|
11872
|
+
* *[Mempool.space docs](https://mempool.space/docs/api/rest#get-transaction-merkleblock-proof)*
|
|
11573
11873
|
*
|
|
11574
|
-
* Endpoint: `GET /api/
|
|
11575
|
-
*
|
|
11576
|
-
* @
|
|
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
|
|
11579
|
-
const path = `/api/
|
|
11580
|
-
return this.
|
|
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
|
-
*
|
|
11886
|
+
* Transaction merkle proof
|
|
11585
11887
|
*
|
|
11586
|
-
* Get
|
|
11888
|
+
* Get the merkle inclusion proof for a transaction.
|
|
11587
11889
|
*
|
|
11588
|
-
* *[Mempool.space docs](https://mempool.space/docs/api/rest#get-
|
|
11890
|
+
* *[Mempool.space docs](https://mempool.space/docs/api/rest#get-transaction-merkle-proof)*
|
|
11589
11891
|
*
|
|
11590
|
-
* Endpoint: `GET /api/
|
|
11892
|
+
* Endpoint: `GET /api/tx/{txid}/merkle-proof`
|
|
11591
11893
|
*
|
|
11592
|
-
* @param {
|
|
11593
|
-
* @param {{ signal?: AbortSignal,
|
|
11594
|
-
* @returns {Promise<
|
|
11894
|
+
* @param {Txid} txid
|
|
11895
|
+
* @param {{ signal?: AbortSignal, onValue?: (value: MerkleProof) => void }} [options]
|
|
11896
|
+
* @returns {Promise<MerkleProof>}
|
|
11595
11897
|
*/
|
|
11596
|
-
async
|
|
11597
|
-
const path = `/api/
|
|
11598
|
-
return this.getJson(path, { signal,
|
|
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
|
-
*
|
|
11904
|
+
* Output spend status
|
|
11603
11905
|
*
|
|
11604
|
-
* Get
|
|
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-
|
|
11908
|
+
* *[Mempool.space docs](https://mempool.space/docs/api/rest#get-transaction-outspend)*
|
|
11607
11909
|
*
|
|
11608
|
-
* Endpoint: `GET /api/
|
|
11910
|
+
* Endpoint: `GET /api/tx/{txid}/outspend/{vout}`
|
|
11609
11911
|
*
|
|
11610
|
-
* @param {
|
|
11611
|
-
* @param {
|
|
11612
|
-
* @
|
|
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
|
|
11615
|
-
const path = `/api/
|
|
11616
|
-
return this.getJson(path, { signal,
|
|
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
|
-
*
|
|
11923
|
+
* All output spend statuses
|
|
11621
11924
|
*
|
|
11622
|
-
* Returns
|
|
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-
|
|
11927
|
+
* *[Mempool.space docs](https://mempool.space/docs/api/rest#get-transaction-outspends)*
|
|
11625
11928
|
*
|
|
11626
|
-
* Endpoint: `GET /api/
|
|
11627
|
-
*
|
|
11628
|
-
* @
|
|
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
|
|
11631
|
-
const path = `/api/
|
|
11632
|
-
return this.getJson(path, { signal,
|
|
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
|
|
11941
|
+
* Transaction raw
|
|
11637
11942
|
*
|
|
11638
|
-
* Returns
|
|
11943
|
+
* Returns a transaction as binary data.
|
|
11639
11944
|
*
|
|
11640
|
-
* *[Mempool.space docs](https://mempool.space/docs/api/rest#get-transaction-
|
|
11945
|
+
* *[Mempool.space docs](https://mempool.space/docs/api/rest#get-transaction-raw)*
|
|
11641
11946
|
*
|
|
11642
|
-
* Endpoint: `GET /api/
|
|
11643
|
-
*
|
|
11644
|
-
* @
|
|
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
|
|
11647
|
-
const path = `/api/
|
|
11648
|
-
return this.
|
|
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
|
-
*
|
|
11959
|
+
* Transaction status
|
|
11653
11960
|
*
|
|
11654
|
-
*
|
|
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-
|
|
11963
|
+
* *[Mempool.space docs](https://mempool.space/docs/api/rest#get-transaction-status)*
|
|
11657
11964
|
*
|
|
11658
|
-
* Endpoint: `GET /api/
|
|
11965
|
+
* Endpoint: `GET /api/tx/{txid}/status`
|
|
11659
11966
|
*
|
|
11660
11967
|
* @param {Txid} txid
|
|
11661
|
-
* @param {{ signal?: AbortSignal,
|
|
11662
|
-
* @returns {Promise<
|
|
11968
|
+
* @param {{ signal?: AbortSignal, onValue?: (value: TxStatus) => void }} [options]
|
|
11969
|
+
* @returns {Promise<TxStatus>}
|
|
11663
11970
|
*/
|
|
11664
|
-
async
|
|
11665
|
-
const path = `/api/
|
|
11666
|
-
return this.getJson(path, { signal,
|
|
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
|
-
*
|
|
11977
|
+
* Transaction first-seen times
|
|
11671
11978
|
*
|
|
11672
|
-
*
|
|
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-
|
|
11981
|
+
* *[Mempool.space docs](https://mempool.space/docs/api/rest#get-transaction-times)*
|
|
11675
11982
|
*
|
|
11676
|
-
* Endpoint: `GET /api/v1/
|
|
11983
|
+
* Endpoint: `GET /api/v1/transaction-times`
|
|
11677
11984
|
*
|
|
11678
|
-
* @param {
|
|
11679
|
-
* @param {{ signal?: AbortSignal,
|
|
11680
|
-
* @returns {Promise<
|
|
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
|
|
11683
|
-
const
|
|
11684
|
-
|
|
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
|
-
*
|
|
11998
|
+
* Broadcast transaction
|
|
11689
11999
|
*
|
|
11690
|
-
*
|
|
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
|
-
*
|
|
11693
|
-
*
|
|
11694
|
-
*
|
|
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
|
|
11697
|
-
const path = `/
|
|
11698
|
-
return this.
|
|
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,
|
|
12021
|
+
* @param {{ signal?: AbortSignal, onValue?: (value: *) => void }} [options]
|
|
11708
12022
|
* @returns {Promise<*>}
|
|
11709
12023
|
*/
|
|
11710
|
-
async getOpenapi({ signal,
|
|
12024
|
+
async getOpenapi({ signal, onValue } = {}) {
|
|
11711
12025
|
const path = `/openapi.json`;
|
|
11712
|
-
return this.getText(path, { signal,
|
|
12026
|
+
return this.getText(path, { signal, onValue });
|
|
11713
12027
|
}
|
|
11714
12028
|
|
|
11715
12029
|
/**
|
|
11716
|
-
*
|
|
12030
|
+
* Compact OpenAPI specification
|
|
11717
12031
|
*
|
|
11718
|
-
*
|
|
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 /
|
|
11721
|
-
* @param {{ signal?: AbortSignal,
|
|
11722
|
-
* @returns {Promise
|
|
12034
|
+
* Endpoint: `GET /api.json`
|
|
12035
|
+
* @param {{ signal?: AbortSignal, onValue?: (value: *) => void }} [options]
|
|
12036
|
+
* @returns {Promise<*>}
|
|
11723
12037
|
*/
|
|
11724
|
-
async
|
|
11725
|
-
const path = `/
|
|
11726
|
-
return this.getJson(path, { signal,
|
|
12038
|
+
async getApi({ signal, onValue } = {}) {
|
|
12039
|
+
const path = `/api.json`;
|
|
12040
|
+
return this.getJson(path, { signal, onValue });
|
|
11727
12041
|
}
|
|
11728
12042
|
|
|
11729
12043
|
}
|