brk-client 0.3.3 → 0.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +555 -12
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -29,6 +29,18 @@
29
29
  * @property {TypeIndex} typeIndex - Index of this address within its type on the blockchain
30
30
  * @property {Dollars} realizedPrice - Realized price (average cost basis) in USD
31
31
  */
32
+ /**
33
+ * @typedef {Object} AddrHashPrefixMatches
34
+ * @property {OutputType} addrType
35
+ * @property {string} prefix
36
+ * @property {boolean} truncated
37
+ * @property {Addr[]} addresses
38
+ */
39
+ /**
40
+ * @typedef {Object} AddrHashPrefixParam
41
+ * @property {OutputType} addrType
42
+ * @property {string} prefix
43
+ */
32
44
  /**
33
45
  * Address statistics in the mempool (unconfirmed transactions only)
34
46
  *
@@ -1485,6 +1497,12 @@ const _openBrowserCache = (option) => {
1485
1497
  return caches.open(name).catch(() => null);
1486
1498
  };
1487
1499
 
1500
+ /**
1501
+ * @param {string} url
1502
+ * @returns {URL}
1503
+ */
1504
+ const _parseBaseUrl = (url) => new URL(url, typeof location === 'undefined' ? undefined : location.href);
1505
+
1488
1506
  /**
1489
1507
  * Custom error class for BRK client errors
1490
1508
  */
@@ -1837,6 +1855,9 @@ class BrkClientBase {
1837
1855
  const isString = typeof options === 'string';
1838
1856
  const rawUrl = isString ? options : options.baseUrl;
1839
1857
  this.baseUrl = rawUrl.endsWith('/') ? rawUrl.slice(0, -1) : rawUrl;
1858
+ const url = _parseBaseUrl(this.baseUrl);
1859
+ this.url = url.href.endsWith('/') ? url.href.slice(0, -1) : url.href;
1860
+ this.domain = url.hostname;
1840
1861
  this.timeout = isString ? 5000 : (options.timeout ?? 5000);
1841
1862
  /** @type {Promise<Cache | null>} */
1842
1863
  this._browserCachePromise = _openBrowserCache(isString ? undefined : options.browserCache);
@@ -2506,6 +2527,22 @@ function create_10y1m1w1y2y3m3y4y5y6m6y8yPattern3(client, acc) {
2506
2527
  * @property {AdjustedRatioValuePattern} sopr
2507
2528
  */
2508
2529
 
2530
+ /**
2531
+ * @typedef {Object} CapCapitalizedGrossLossMvrvNetPeakPriceProfitSellSoprPattern2
2532
+ * @property {CentsDeltaToUsdPattern} cap
2533
+ * @property {PricePattern} capitalized
2534
+ * @property {BlockCumulativeSumPattern} grossPnl
2535
+ * @property {BlockCumulativeNegativeSumPattern} loss
2536
+ * @property {SeriesPattern1<StoredF32>} mvrv
2537
+ * @property {BlockChangeCumulativeDeltaSumPattern} netPnl
2538
+ * @property {BlockCumulativeSumPattern} peakRegret
2539
+ * @property {BpsCentsPercentilesRatioSatsSmaStdUsdPattern} price
2540
+ * @property {BlockCumulativeSumPattern} profit
2541
+ * @property {_1m1w1y24hPattern<StoredF64>} profitToLossRatio
2542
+ * @property {_1m1w1y24hPattern8} sellSideRiskRatio
2543
+ * @property {RatioValuePattern2} sopr
2544
+ */
2545
+
2509
2546
  /**
2510
2547
  * @typedef {Object} EmptyOpP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern2
2511
2548
  * @property {_1m1w1y24hBpsPercentRatioPattern} empty
@@ -3017,6 +3054,17 @@ function create_1m1w1y24hBpsPercentRatioPattern(client, acc) {
3017
3054
  * @property {_1m1w1y24hBpsPercentRatioPattern} spendableOutputToReusedAddrShare
3018
3055
  */
3019
3056
 
3057
+ /**
3058
+ * @typedef {Object} ActivityCostInvestedOutputsRealizedSupplyUnrealizedPattern2
3059
+ * @property {CoindaysCoinyearsDormancyTransferPattern} activity
3060
+ * @property {InMaxMinPerSupplyPattern} costBasis
3061
+ * @property {InPattern} investedCapital
3062
+ * @property {SpendingSpentUnspentPattern} outputs
3063
+ * @property {CapCapitalizedGrossLossMvrvNetPeakPriceProfitSellSoprPattern2} realized
3064
+ * @property {DeltaDominanceHalfInTotalPattern2} supply
3065
+ * @property {CapitalizedGrossInvestedLossNetNuplProfitSentimentPattern2} unrealized
3066
+ */
3067
+
3020
3068
  /**
3021
3069
  * @typedef {Object} CapLossMvrvNetPriceProfitSoprPattern
3022
3070
  * @property {CentsDeltaUsdPattern} cap
@@ -5046,6 +5094,25 @@ function createPriceRatioPattern(client, acc, disc) {
5046
5094
  };
5047
5095
  }
5048
5096
 
5097
+ /**
5098
+ * @typedef {Object} RatioValuePattern2
5099
+ * @property {_1m1w1y24hPattern<StoredF64>} ratio
5100
+ * @property {AverageBlockCumulativeSumPattern<Cents>} valueDestroyed
5101
+ */
5102
+
5103
+ /**
5104
+ * Create a RatioValuePattern2 pattern node
5105
+ * @param {BrkClient} client
5106
+ * @param {string} acc - Accumulated series name
5107
+ * @returns {RatioValuePattern2}
5108
+ */
5109
+ function createRatioValuePattern2(client, acc) {
5110
+ return {
5111
+ ratio: create_1m1w1y24hPattern(client, _m(acc, 'sopr')),
5112
+ valueDestroyed: createAverageBlockCumulativeSumPattern(client, _m(acc, 'value_destroyed')),
5113
+ };
5114
+ }
5115
+
5049
5116
  /**
5050
5117
  * @typedef {Object} RatioValuePattern
5051
5118
  * @property {_24hPattern} ratio
@@ -6787,6 +6854,7 @@ function createTransferPattern(client, acc) {
6787
6854
  * @property {SeriesTree_Cohorts_Utxo_OverAge} overAge
6788
6855
  * @property {SeriesTree_Cohorts_Utxo_Epoch} epoch
6789
6856
  * @property {SeriesTree_Cohorts_Utxo_Class} class
6857
+ * @property {SeriesTree_Cohorts_Utxo_Entry} entry
6790
6858
  * @property {SeriesTree_Cohorts_Utxo_OverAmount} overAmount
6791
6859
  * @property {SeriesTree_Cohorts_Utxo_AmountRange} amountRange
6792
6860
  * @property {SeriesTree_Cohorts_Utxo_UnderAmount} underAmount
@@ -7144,7 +7212,7 @@ function createTransferPattern(client, acc) {
7144
7212
  * @property {SeriesTree_Cohorts_Utxo_Lth_Realized_Price} price
7145
7213
  * @property {SeriesPattern1<StoredF32>} mvrv
7146
7214
  * @property {BlockChangeCumulativeDeltaSumPattern} netPnl
7147
- * @property {SeriesTree_Cohorts_Utxo_Lth_Realized_Sopr} sopr
7215
+ * @property {RatioValuePattern2} sopr
7148
7216
  * @property {BlockCumulativeSumPattern} grossPnl
7149
7217
  * @property {_1m1w1y24hPattern8} sellSideRiskRatio
7150
7218
  * @property {BlockCumulativeSumPattern} peakRegret
@@ -7248,12 +7316,6 @@ function createTransferPattern(client, acc) {
7248
7316
  * @property {PriceRatioPattern} m3sd
7249
7317
  */
7250
7318
 
7251
- /**
7252
- * @typedef {Object} SeriesTree_Cohorts_Utxo_Lth_Realized_Sopr
7253
- * @property {AverageBlockCumulativeSumPattern<Cents>} valueDestroyed
7254
- * @property {_1m1w1y24hPattern<StoredF64>} ratio
7255
- */
7256
-
7257
7319
  /**
7258
7320
  * @typedef {Object} SeriesTree_Cohorts_Utxo_AgeRange
7259
7321
  * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} under1h
@@ -7354,6 +7416,258 @@ function createTransferPattern(client, acc) {
7354
7416
  * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _2026
7355
7417
  */
7356
7418
 
7419
+ /**
7420
+ * @typedef {Object} SeriesTree_Cohorts_Utxo_Entry
7421
+ * @property {SeriesTree_Cohorts_Utxo_Entry_Discount} discount
7422
+ * @property {SeriesTree_Cohorts_Utxo_Entry_Premium} premium
7423
+ */
7424
+
7425
+ /**
7426
+ * @typedef {Object} SeriesTree_Cohorts_Utxo_Entry_Discount
7427
+ * @property {DeltaDominanceHalfInTotalPattern2} supply
7428
+ * @property {SpendingSpentUnspentPattern} outputs
7429
+ * @property {CoindaysCoinyearsDormancyTransferPattern} activity
7430
+ * @property {SeriesTree_Cohorts_Utxo_Entry_Discount_Realized} realized
7431
+ * @property {InMaxMinPerSupplyPattern} costBasis
7432
+ * @property {CapitalizedGrossInvestedLossNetNuplProfitSentimentPattern2} unrealized
7433
+ * @property {InPattern} investedCapital
7434
+ */
7435
+
7436
+ /**
7437
+ * @typedef {Object} SeriesTree_Cohorts_Utxo_Entry_Discount_Realized
7438
+ * @property {CentsDeltaToUsdPattern} cap
7439
+ * @property {BlockCumulativeSumPattern} profit
7440
+ * @property {BlockCumulativeNegativeSumPattern} loss
7441
+ * @property {SeriesTree_Cohorts_Utxo_Entry_Discount_Realized_Price} price
7442
+ * @property {SeriesPattern1<StoredF32>} mvrv
7443
+ * @property {BlockChangeCumulativeDeltaSumPattern} netPnl
7444
+ * @property {RatioValuePattern2} sopr
7445
+ * @property {BlockCumulativeSumPattern} grossPnl
7446
+ * @property {_1m1w1y24hPattern8} sellSideRiskRatio
7447
+ * @property {BlockCumulativeSumPattern} peakRegret
7448
+ * @property {PricePattern} capitalized
7449
+ * @property {_1m1w1y24hPattern<StoredF64>} profitToLossRatio
7450
+ */
7451
+
7452
+ /**
7453
+ * @typedef {Object} SeriesTree_Cohorts_Utxo_Entry_Discount_Realized_Price
7454
+ * @property {SeriesPattern1<Dollars>} usd
7455
+ * @property {SeriesPattern1<Cents>} cents
7456
+ * @property {SeriesPattern1<SatsFract>} sats
7457
+ * @property {SeriesPattern1<BasisPoints32>} bps
7458
+ * @property {SeriesPattern1<StoredF32>} ratio
7459
+ * @property {Pct0Pct1Pct2Pct5Pct95Pct98Pct99Pattern} percentiles
7460
+ * @property {_1m1w1y2y4yAllPattern} sma
7461
+ * @property {SeriesTree_Cohorts_Utxo_Entry_Discount_Realized_Price_StdDev} stdDev
7462
+ */
7463
+
7464
+ /**
7465
+ * @typedef {Object} SeriesTree_Cohorts_Utxo_Entry_Discount_Realized_Price_StdDev
7466
+ * @property {SeriesTree_Cohorts_Utxo_Entry_Discount_Realized_Price_StdDev_All} all
7467
+ * @property {SeriesTree_Cohorts_Utxo_Entry_Discount_Realized_Price_StdDev_4y} _4y
7468
+ * @property {SeriesTree_Cohorts_Utxo_Entry_Discount_Realized_Price_StdDev_2y} _2y
7469
+ * @property {SeriesTree_Cohorts_Utxo_Entry_Discount_Realized_Price_StdDev_1y} _1y
7470
+ */
7471
+
7472
+ /**
7473
+ * @typedef {Object} SeriesTree_Cohorts_Utxo_Entry_Discount_Realized_Price_StdDev_All
7474
+ * @property {SeriesPattern1<StoredF32>} sd
7475
+ * @property {SeriesPattern1<StoredF32>} zscore
7476
+ * @property {CentsSatsUsdPattern} _0sd
7477
+ * @property {PriceRatioPattern} p05sd
7478
+ * @property {PriceRatioPattern} p1sd
7479
+ * @property {PriceRatioPattern} p15sd
7480
+ * @property {PriceRatioPattern} p2sd
7481
+ * @property {PriceRatioPattern} p25sd
7482
+ * @property {PriceRatioPattern} p3sd
7483
+ * @property {PriceRatioPattern} m05sd
7484
+ * @property {PriceRatioPattern} m1sd
7485
+ * @property {PriceRatioPattern} m15sd
7486
+ * @property {PriceRatioPattern} m2sd
7487
+ * @property {PriceRatioPattern} m25sd
7488
+ * @property {PriceRatioPattern} m3sd
7489
+ */
7490
+
7491
+ /**
7492
+ * @typedef {Object} SeriesTree_Cohorts_Utxo_Entry_Discount_Realized_Price_StdDev_4y
7493
+ * @property {SeriesPattern1<StoredF32>} sd
7494
+ * @property {SeriesPattern1<StoredF32>} zscore
7495
+ * @property {CentsSatsUsdPattern} _0sd
7496
+ * @property {PriceRatioPattern} p05sd
7497
+ * @property {PriceRatioPattern} p1sd
7498
+ * @property {PriceRatioPattern} p15sd
7499
+ * @property {PriceRatioPattern} p2sd
7500
+ * @property {PriceRatioPattern} p25sd
7501
+ * @property {PriceRatioPattern} p3sd
7502
+ * @property {PriceRatioPattern} m05sd
7503
+ * @property {PriceRatioPattern} m1sd
7504
+ * @property {PriceRatioPattern} m15sd
7505
+ * @property {PriceRatioPattern} m2sd
7506
+ * @property {PriceRatioPattern} m25sd
7507
+ * @property {PriceRatioPattern} m3sd
7508
+ */
7509
+
7510
+ /**
7511
+ * @typedef {Object} SeriesTree_Cohorts_Utxo_Entry_Discount_Realized_Price_StdDev_2y
7512
+ * @property {SeriesPattern1<StoredF32>} sd
7513
+ * @property {SeriesPattern1<StoredF32>} zscore
7514
+ * @property {CentsSatsUsdPattern} _0sd
7515
+ * @property {PriceRatioPattern} p05sd
7516
+ * @property {PriceRatioPattern} p1sd
7517
+ * @property {PriceRatioPattern} p15sd
7518
+ * @property {PriceRatioPattern} p2sd
7519
+ * @property {PriceRatioPattern} p25sd
7520
+ * @property {PriceRatioPattern} p3sd
7521
+ * @property {PriceRatioPattern} m05sd
7522
+ * @property {PriceRatioPattern} m1sd
7523
+ * @property {PriceRatioPattern} m15sd
7524
+ * @property {PriceRatioPattern} m2sd
7525
+ * @property {PriceRatioPattern} m25sd
7526
+ * @property {PriceRatioPattern} m3sd
7527
+ */
7528
+
7529
+ /**
7530
+ * @typedef {Object} SeriesTree_Cohorts_Utxo_Entry_Discount_Realized_Price_StdDev_1y
7531
+ * @property {SeriesPattern1<StoredF32>} sd
7532
+ * @property {SeriesPattern1<StoredF32>} zscore
7533
+ * @property {CentsSatsUsdPattern} _0sd
7534
+ * @property {PriceRatioPattern} p05sd
7535
+ * @property {PriceRatioPattern} p1sd
7536
+ * @property {PriceRatioPattern} p15sd
7537
+ * @property {PriceRatioPattern} p2sd
7538
+ * @property {PriceRatioPattern} p25sd
7539
+ * @property {PriceRatioPattern} p3sd
7540
+ * @property {PriceRatioPattern} m05sd
7541
+ * @property {PriceRatioPattern} m1sd
7542
+ * @property {PriceRatioPattern} m15sd
7543
+ * @property {PriceRatioPattern} m2sd
7544
+ * @property {PriceRatioPattern} m25sd
7545
+ * @property {PriceRatioPattern} m3sd
7546
+ */
7547
+
7548
+ /**
7549
+ * @typedef {Object} SeriesTree_Cohorts_Utxo_Entry_Premium
7550
+ * @property {DeltaDominanceHalfInTotalPattern2} supply
7551
+ * @property {SpendingSpentUnspentPattern} outputs
7552
+ * @property {CoindaysCoinyearsDormancyTransferPattern} activity
7553
+ * @property {SeriesTree_Cohorts_Utxo_Entry_Premium_Realized} realized
7554
+ * @property {InMaxMinPerSupplyPattern} costBasis
7555
+ * @property {CapitalizedGrossInvestedLossNetNuplProfitSentimentPattern2} unrealized
7556
+ * @property {InPattern} investedCapital
7557
+ */
7558
+
7559
+ /**
7560
+ * @typedef {Object} SeriesTree_Cohorts_Utxo_Entry_Premium_Realized
7561
+ * @property {CentsDeltaToUsdPattern} cap
7562
+ * @property {BlockCumulativeSumPattern} profit
7563
+ * @property {BlockCumulativeNegativeSumPattern} loss
7564
+ * @property {SeriesTree_Cohorts_Utxo_Entry_Premium_Realized_Price} price
7565
+ * @property {SeriesPattern1<StoredF32>} mvrv
7566
+ * @property {BlockChangeCumulativeDeltaSumPattern} netPnl
7567
+ * @property {RatioValuePattern2} sopr
7568
+ * @property {BlockCumulativeSumPattern} grossPnl
7569
+ * @property {_1m1w1y24hPattern8} sellSideRiskRatio
7570
+ * @property {BlockCumulativeSumPattern} peakRegret
7571
+ * @property {PricePattern} capitalized
7572
+ * @property {_1m1w1y24hPattern<StoredF64>} profitToLossRatio
7573
+ */
7574
+
7575
+ /**
7576
+ * @typedef {Object} SeriesTree_Cohorts_Utxo_Entry_Premium_Realized_Price
7577
+ * @property {SeriesPattern1<Dollars>} usd
7578
+ * @property {SeriesPattern1<Cents>} cents
7579
+ * @property {SeriesPattern1<SatsFract>} sats
7580
+ * @property {SeriesPattern1<BasisPoints32>} bps
7581
+ * @property {SeriesPattern1<StoredF32>} ratio
7582
+ * @property {Pct0Pct1Pct2Pct5Pct95Pct98Pct99Pattern} percentiles
7583
+ * @property {_1m1w1y2y4yAllPattern} sma
7584
+ * @property {SeriesTree_Cohorts_Utxo_Entry_Premium_Realized_Price_StdDev} stdDev
7585
+ */
7586
+
7587
+ /**
7588
+ * @typedef {Object} SeriesTree_Cohorts_Utxo_Entry_Premium_Realized_Price_StdDev
7589
+ * @property {SeriesTree_Cohorts_Utxo_Entry_Premium_Realized_Price_StdDev_All} all
7590
+ * @property {SeriesTree_Cohorts_Utxo_Entry_Premium_Realized_Price_StdDev_4y} _4y
7591
+ * @property {SeriesTree_Cohorts_Utxo_Entry_Premium_Realized_Price_StdDev_2y} _2y
7592
+ * @property {SeriesTree_Cohorts_Utxo_Entry_Premium_Realized_Price_StdDev_1y} _1y
7593
+ */
7594
+
7595
+ /**
7596
+ * @typedef {Object} SeriesTree_Cohorts_Utxo_Entry_Premium_Realized_Price_StdDev_All
7597
+ * @property {SeriesPattern1<StoredF32>} sd
7598
+ * @property {SeriesPattern1<StoredF32>} zscore
7599
+ * @property {CentsSatsUsdPattern} _0sd
7600
+ * @property {PriceRatioPattern} p05sd
7601
+ * @property {PriceRatioPattern} p1sd
7602
+ * @property {PriceRatioPattern} p15sd
7603
+ * @property {PriceRatioPattern} p2sd
7604
+ * @property {PriceRatioPattern} p25sd
7605
+ * @property {PriceRatioPattern} p3sd
7606
+ * @property {PriceRatioPattern} m05sd
7607
+ * @property {PriceRatioPattern} m1sd
7608
+ * @property {PriceRatioPattern} m15sd
7609
+ * @property {PriceRatioPattern} m2sd
7610
+ * @property {PriceRatioPattern} m25sd
7611
+ * @property {PriceRatioPattern} m3sd
7612
+ */
7613
+
7614
+ /**
7615
+ * @typedef {Object} SeriesTree_Cohorts_Utxo_Entry_Premium_Realized_Price_StdDev_4y
7616
+ * @property {SeriesPattern1<StoredF32>} sd
7617
+ * @property {SeriesPattern1<StoredF32>} zscore
7618
+ * @property {CentsSatsUsdPattern} _0sd
7619
+ * @property {PriceRatioPattern} p05sd
7620
+ * @property {PriceRatioPattern} p1sd
7621
+ * @property {PriceRatioPattern} p15sd
7622
+ * @property {PriceRatioPattern} p2sd
7623
+ * @property {PriceRatioPattern} p25sd
7624
+ * @property {PriceRatioPattern} p3sd
7625
+ * @property {PriceRatioPattern} m05sd
7626
+ * @property {PriceRatioPattern} m1sd
7627
+ * @property {PriceRatioPattern} m15sd
7628
+ * @property {PriceRatioPattern} m2sd
7629
+ * @property {PriceRatioPattern} m25sd
7630
+ * @property {PriceRatioPattern} m3sd
7631
+ */
7632
+
7633
+ /**
7634
+ * @typedef {Object} SeriesTree_Cohorts_Utxo_Entry_Premium_Realized_Price_StdDev_2y
7635
+ * @property {SeriesPattern1<StoredF32>} sd
7636
+ * @property {SeriesPattern1<StoredF32>} zscore
7637
+ * @property {CentsSatsUsdPattern} _0sd
7638
+ * @property {PriceRatioPattern} p05sd
7639
+ * @property {PriceRatioPattern} p1sd
7640
+ * @property {PriceRatioPattern} p15sd
7641
+ * @property {PriceRatioPattern} p2sd
7642
+ * @property {PriceRatioPattern} p25sd
7643
+ * @property {PriceRatioPattern} p3sd
7644
+ * @property {PriceRatioPattern} m05sd
7645
+ * @property {PriceRatioPattern} m1sd
7646
+ * @property {PriceRatioPattern} m15sd
7647
+ * @property {PriceRatioPattern} m2sd
7648
+ * @property {PriceRatioPattern} m25sd
7649
+ * @property {PriceRatioPattern} m3sd
7650
+ */
7651
+
7652
+ /**
7653
+ * @typedef {Object} SeriesTree_Cohorts_Utxo_Entry_Premium_Realized_Price_StdDev_1y
7654
+ * @property {SeriesPattern1<StoredF32>} sd
7655
+ * @property {SeriesPattern1<StoredF32>} zscore
7656
+ * @property {CentsSatsUsdPattern} _0sd
7657
+ * @property {PriceRatioPattern} p05sd
7658
+ * @property {PriceRatioPattern} p1sd
7659
+ * @property {PriceRatioPattern} p15sd
7660
+ * @property {PriceRatioPattern} p2sd
7661
+ * @property {PriceRatioPattern} p25sd
7662
+ * @property {PriceRatioPattern} p3sd
7663
+ * @property {PriceRatioPattern} m05sd
7664
+ * @property {PriceRatioPattern} m1sd
7665
+ * @property {PriceRatioPattern} m15sd
7666
+ * @property {PriceRatioPattern} m2sd
7667
+ * @property {PriceRatioPattern} m25sd
7668
+ * @property {PriceRatioPattern} m3sd
7669
+ */
7670
+
7357
7671
  /**
7358
7672
  * @typedef {Object} SeriesTree_Cohorts_Utxo_OverAmount
7359
7673
  * @property {ActivityOutputsRealizedSupplyUnrealizedPattern2} _1sat
@@ -7579,7 +7893,7 @@ function createTransferPattern(client, acc) {
7579
7893
  * @extends BrkClientBase
7580
7894
  */
7581
7895
  class BrkClient extends BrkClientBase {
7582
- VERSION = "v0.3.3";
7896
+ VERSION = "v0.3.5";
7583
7897
 
7584
7898
  INDEXES = /** @type {const} */ ([
7585
7899
  "minute10",
@@ -7919,6 +8233,19 @@ class BrkClient extends BrkClientBase {
7919
8233
  }
7920
8234
  });
7921
8235
 
8236
+ ENTRY_NAMES = /** @type {const} */ ({
8237
+ "discount": {
8238
+ "id": "veteran",
8239
+ "short": "Veteran",
8240
+ "long": "Veteran Coins"
8241
+ },
8242
+ "premium": {
8243
+ "id": "rookie",
8244
+ "short": "Rookie",
8245
+ "long": "Rookie Coins"
8246
+ }
8247
+ });
8248
+
7922
8249
  SPENDABLE_TYPE_NAMES = /** @type {const} */ ({
7923
8250
  "p2pk65": {
7924
8251
  "id": "p2pk65",
@@ -10239,10 +10566,7 @@ class BrkClient extends BrkClientBase {
10239
10566
  },
10240
10567
  mvrv: createSeriesPattern1(this, 'lth_mvrv'),
10241
10568
  netPnl: createBlockChangeCumulativeDeltaSumPattern(this, 'lth_net'),
10242
- sopr: {
10243
- valueDestroyed: createAverageBlockCumulativeSumPattern(this, 'lth_value_destroyed'),
10244
- ratio: create_1m1w1y24hPattern(this, 'lth_sopr'),
10245
- },
10569
+ sopr: createRatioValuePattern2(this, 'lth'),
10246
10570
  grossPnl: createBlockCumulativeSumPattern(this, 'lth_realized_gross_pnl'),
10247
10571
  sellSideRiskRatio: create_1m1w1y24hPattern8(this, 'lth_sell_side_risk_ratio'),
10248
10572
  peakRegret: createBlockCumulativeSumPattern(this, 'lth_realized_peak_regret'),
@@ -10343,6 +10667,208 @@ class BrkClient extends BrkClientBase {
10343
10667
  _2025: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'class_2025'),
10344
10668
  _2026: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'class_2026'),
10345
10669
  },
10670
+ entry: {
10671
+ discount: {
10672
+ supply: createDeltaDominanceHalfInTotalPattern2(this, 'veteran_supply'),
10673
+ outputs: createSpendingSpentUnspentPattern(this, 'veteran'),
10674
+ activity: createCoindaysCoinyearsDormancyTransferPattern(this, 'veteran'),
10675
+ realized: {
10676
+ cap: createCentsDeltaToUsdPattern(this, 'veteran_realized_cap'),
10677
+ profit: createBlockCumulativeSumPattern(this, 'veteran_realized_profit'),
10678
+ loss: createBlockCumulativeNegativeSumPattern(this, 'veteran_realized_loss'),
10679
+ price: {
10680
+ usd: createSeriesPattern1(this, 'veteran_realized_price'),
10681
+ cents: createSeriesPattern1(this, 'veteran_realized_price_cents'),
10682
+ sats: createSeriesPattern1(this, 'veteran_realized_price_sats'),
10683
+ bps: createSeriesPattern1(this, 'veteran_realized_price_ratio_bps'),
10684
+ ratio: createSeriesPattern1(this, 'veteran_realized_price_ratio'),
10685
+ percentiles: createPct0Pct1Pct2Pct5Pct95Pct98Pct99Pattern(this, 'veteran_realized_price'),
10686
+ sma: create_1m1w1y2y4yAllPattern(this, 'veteran_realized_price_ratio_sma'),
10687
+ stdDev: {
10688
+ all: {
10689
+ sd: createSeriesPattern1(this, 'veteran_realized_price_ratio_sd'),
10690
+ zscore: createSeriesPattern1(this, 'veteran_realized_price_ratio_zscore'),
10691
+ _0sd: createCentsSatsUsdPattern(this, 'veteran_realized_price_0sd'),
10692
+ p05sd: createPriceRatioPattern(this, 'veteran_realized_price', 'p0_5sd'),
10693
+ p1sd: createPriceRatioPattern(this, 'veteran_realized_price', 'p1sd'),
10694
+ p15sd: createPriceRatioPattern(this, 'veteran_realized_price', 'p1_5sd'),
10695
+ p2sd: createPriceRatioPattern(this, 'veteran_realized_price', 'p2sd'),
10696
+ p25sd: createPriceRatioPattern(this, 'veteran_realized_price', 'p2_5sd'),
10697
+ p3sd: createPriceRatioPattern(this, 'veteran_realized_price', 'p3sd'),
10698
+ m05sd: createPriceRatioPattern(this, 'veteran_realized_price', 'm0_5sd'),
10699
+ m1sd: createPriceRatioPattern(this, 'veteran_realized_price', 'm1sd'),
10700
+ m15sd: createPriceRatioPattern(this, 'veteran_realized_price', 'm1_5sd'),
10701
+ m2sd: createPriceRatioPattern(this, 'veteran_realized_price', 'm2sd'),
10702
+ m25sd: createPriceRatioPattern(this, 'veteran_realized_price', 'm2_5sd'),
10703
+ m3sd: createPriceRatioPattern(this, 'veteran_realized_price', 'm3sd'),
10704
+ },
10705
+ _4y: {
10706
+ sd: createSeriesPattern1(this, 'veteran_realized_price_ratio_sd_4y'),
10707
+ zscore: createSeriesPattern1(this, 'veteran_realized_price_ratio_zscore_4y'),
10708
+ _0sd: createCentsSatsUsdPattern(this, 'veteran_realized_price_0sd_4y'),
10709
+ p05sd: createPriceRatioPattern(this, 'veteran_realized_price', 'p0_5sd_4y'),
10710
+ p1sd: createPriceRatioPattern(this, 'veteran_realized_price', 'p1sd_4y'),
10711
+ p15sd: createPriceRatioPattern(this, 'veteran_realized_price', 'p1_5sd_4y'),
10712
+ p2sd: createPriceRatioPattern(this, 'veteran_realized_price', 'p2sd_4y'),
10713
+ p25sd: createPriceRatioPattern(this, 'veteran_realized_price', 'p2_5sd_4y'),
10714
+ p3sd: createPriceRatioPattern(this, 'veteran_realized_price', 'p3sd_4y'),
10715
+ m05sd: createPriceRatioPattern(this, 'veteran_realized_price', 'm0_5sd_4y'),
10716
+ m1sd: createPriceRatioPattern(this, 'veteran_realized_price', 'm1sd_4y'),
10717
+ m15sd: createPriceRatioPattern(this, 'veteran_realized_price', 'm1_5sd_4y'),
10718
+ m2sd: createPriceRatioPattern(this, 'veteran_realized_price', 'm2sd_4y'),
10719
+ m25sd: createPriceRatioPattern(this, 'veteran_realized_price', 'm2_5sd_4y'),
10720
+ m3sd: createPriceRatioPattern(this, 'veteran_realized_price', 'm3sd_4y'),
10721
+ },
10722
+ _2y: {
10723
+ sd: createSeriesPattern1(this, 'veteran_realized_price_ratio_sd_2y'),
10724
+ zscore: createSeriesPattern1(this, 'veteran_realized_price_ratio_zscore_2y'),
10725
+ _0sd: createCentsSatsUsdPattern(this, 'veteran_realized_price_0sd_2y'),
10726
+ p05sd: createPriceRatioPattern(this, 'veteran_realized_price', 'p0_5sd_2y'),
10727
+ p1sd: createPriceRatioPattern(this, 'veteran_realized_price', 'p1sd_2y'),
10728
+ p15sd: createPriceRatioPattern(this, 'veteran_realized_price', 'p1_5sd_2y'),
10729
+ p2sd: createPriceRatioPattern(this, 'veteran_realized_price', 'p2sd_2y'),
10730
+ p25sd: createPriceRatioPattern(this, 'veteran_realized_price', 'p2_5sd_2y'),
10731
+ p3sd: createPriceRatioPattern(this, 'veteran_realized_price', 'p3sd_2y'),
10732
+ m05sd: createPriceRatioPattern(this, 'veteran_realized_price', 'm0_5sd_2y'),
10733
+ m1sd: createPriceRatioPattern(this, 'veteran_realized_price', 'm1sd_2y'),
10734
+ m15sd: createPriceRatioPattern(this, 'veteran_realized_price', 'm1_5sd_2y'),
10735
+ m2sd: createPriceRatioPattern(this, 'veteran_realized_price', 'm2sd_2y'),
10736
+ m25sd: createPriceRatioPattern(this, 'veteran_realized_price', 'm2_5sd_2y'),
10737
+ m3sd: createPriceRatioPattern(this, 'veteran_realized_price', 'm3sd_2y'),
10738
+ },
10739
+ _1y: {
10740
+ sd: createSeriesPattern1(this, 'veteran_realized_price_ratio_sd_1y'),
10741
+ zscore: createSeriesPattern1(this, 'veteran_realized_price_ratio_zscore_1y'),
10742
+ _0sd: createCentsSatsUsdPattern(this, 'veteran_realized_price_0sd_1y'),
10743
+ p05sd: createPriceRatioPattern(this, 'veteran_realized_price', 'p0_5sd_1y'),
10744
+ p1sd: createPriceRatioPattern(this, 'veteran_realized_price', 'p1sd_1y'),
10745
+ p15sd: createPriceRatioPattern(this, 'veteran_realized_price', 'p1_5sd_1y'),
10746
+ p2sd: createPriceRatioPattern(this, 'veteran_realized_price', 'p2sd_1y'),
10747
+ p25sd: createPriceRatioPattern(this, 'veteran_realized_price', 'p2_5sd_1y'),
10748
+ p3sd: createPriceRatioPattern(this, 'veteran_realized_price', 'p3sd_1y'),
10749
+ m05sd: createPriceRatioPattern(this, 'veteran_realized_price', 'm0_5sd_1y'),
10750
+ m1sd: createPriceRatioPattern(this, 'veteran_realized_price', 'm1sd_1y'),
10751
+ m15sd: createPriceRatioPattern(this, 'veteran_realized_price', 'm1_5sd_1y'),
10752
+ m2sd: createPriceRatioPattern(this, 'veteran_realized_price', 'm2sd_1y'),
10753
+ m25sd: createPriceRatioPattern(this, 'veteran_realized_price', 'm2_5sd_1y'),
10754
+ m3sd: createPriceRatioPattern(this, 'veteran_realized_price', 'm3sd_1y'),
10755
+ },
10756
+ },
10757
+ },
10758
+ mvrv: createSeriesPattern1(this, 'veteran_mvrv'),
10759
+ netPnl: createBlockChangeCumulativeDeltaSumPattern(this, 'veteran_net'),
10760
+ sopr: createRatioValuePattern2(this, 'veteran'),
10761
+ grossPnl: createBlockCumulativeSumPattern(this, 'veteran_realized_gross_pnl'),
10762
+ sellSideRiskRatio: create_1m1w1y24hPattern8(this, 'veteran_sell_side_risk_ratio'),
10763
+ peakRegret: createBlockCumulativeSumPattern(this, 'veteran_realized_peak_regret'),
10764
+ capitalized: createPricePattern(this, 'veteran_capitalized_price'),
10765
+ profitToLossRatio: create_1m1w1y24hPattern(this, 'veteran_realized_profit_to_loss_ratio'),
10766
+ },
10767
+ costBasis: createInMaxMinPerSupplyPattern(this, 'veteran'),
10768
+ unrealized: createCapitalizedGrossInvestedLossNetNuplProfitSentimentPattern2(this, 'veteran'),
10769
+ investedCapital: createInPattern(this, 'veteran_invested_capital_in'),
10770
+ },
10771
+ premium: {
10772
+ supply: createDeltaDominanceHalfInTotalPattern2(this, 'rookie_supply'),
10773
+ outputs: createSpendingSpentUnspentPattern(this, 'rookie'),
10774
+ activity: createCoindaysCoinyearsDormancyTransferPattern(this, 'rookie'),
10775
+ realized: {
10776
+ cap: createCentsDeltaToUsdPattern(this, 'rookie_realized_cap'),
10777
+ profit: createBlockCumulativeSumPattern(this, 'rookie_realized_profit'),
10778
+ loss: createBlockCumulativeNegativeSumPattern(this, 'rookie_realized_loss'),
10779
+ price: {
10780
+ usd: createSeriesPattern1(this, 'rookie_realized_price'),
10781
+ cents: createSeriesPattern1(this, 'rookie_realized_price_cents'),
10782
+ sats: createSeriesPattern1(this, 'rookie_realized_price_sats'),
10783
+ bps: createSeriesPattern1(this, 'rookie_realized_price_ratio_bps'),
10784
+ ratio: createSeriesPattern1(this, 'rookie_realized_price_ratio'),
10785
+ percentiles: createPct0Pct1Pct2Pct5Pct95Pct98Pct99Pattern(this, 'rookie_realized_price'),
10786
+ sma: create_1m1w1y2y4yAllPattern(this, 'rookie_realized_price_ratio_sma'),
10787
+ stdDev: {
10788
+ all: {
10789
+ sd: createSeriesPattern1(this, 'rookie_realized_price_ratio_sd'),
10790
+ zscore: createSeriesPattern1(this, 'rookie_realized_price_ratio_zscore'),
10791
+ _0sd: createCentsSatsUsdPattern(this, 'rookie_realized_price_0sd'),
10792
+ p05sd: createPriceRatioPattern(this, 'rookie_realized_price', 'p0_5sd'),
10793
+ p1sd: createPriceRatioPattern(this, 'rookie_realized_price', 'p1sd'),
10794
+ p15sd: createPriceRatioPattern(this, 'rookie_realized_price', 'p1_5sd'),
10795
+ p2sd: createPriceRatioPattern(this, 'rookie_realized_price', 'p2sd'),
10796
+ p25sd: createPriceRatioPattern(this, 'rookie_realized_price', 'p2_5sd'),
10797
+ p3sd: createPriceRatioPattern(this, 'rookie_realized_price', 'p3sd'),
10798
+ m05sd: createPriceRatioPattern(this, 'rookie_realized_price', 'm0_5sd'),
10799
+ m1sd: createPriceRatioPattern(this, 'rookie_realized_price', 'm1sd'),
10800
+ m15sd: createPriceRatioPattern(this, 'rookie_realized_price', 'm1_5sd'),
10801
+ m2sd: createPriceRatioPattern(this, 'rookie_realized_price', 'm2sd'),
10802
+ m25sd: createPriceRatioPattern(this, 'rookie_realized_price', 'm2_5sd'),
10803
+ m3sd: createPriceRatioPattern(this, 'rookie_realized_price', 'm3sd'),
10804
+ },
10805
+ _4y: {
10806
+ sd: createSeriesPattern1(this, 'rookie_realized_price_ratio_sd_4y'),
10807
+ zscore: createSeriesPattern1(this, 'rookie_realized_price_ratio_zscore_4y'),
10808
+ _0sd: createCentsSatsUsdPattern(this, 'rookie_realized_price_0sd_4y'),
10809
+ p05sd: createPriceRatioPattern(this, 'rookie_realized_price', 'p0_5sd_4y'),
10810
+ p1sd: createPriceRatioPattern(this, 'rookie_realized_price', 'p1sd_4y'),
10811
+ p15sd: createPriceRatioPattern(this, 'rookie_realized_price', 'p1_5sd_4y'),
10812
+ p2sd: createPriceRatioPattern(this, 'rookie_realized_price', 'p2sd_4y'),
10813
+ p25sd: createPriceRatioPattern(this, 'rookie_realized_price', 'p2_5sd_4y'),
10814
+ p3sd: createPriceRatioPattern(this, 'rookie_realized_price', 'p3sd_4y'),
10815
+ m05sd: createPriceRatioPattern(this, 'rookie_realized_price', 'm0_5sd_4y'),
10816
+ m1sd: createPriceRatioPattern(this, 'rookie_realized_price', 'm1sd_4y'),
10817
+ m15sd: createPriceRatioPattern(this, 'rookie_realized_price', 'm1_5sd_4y'),
10818
+ m2sd: createPriceRatioPattern(this, 'rookie_realized_price', 'm2sd_4y'),
10819
+ m25sd: createPriceRatioPattern(this, 'rookie_realized_price', 'm2_5sd_4y'),
10820
+ m3sd: createPriceRatioPattern(this, 'rookie_realized_price', 'm3sd_4y'),
10821
+ },
10822
+ _2y: {
10823
+ sd: createSeriesPattern1(this, 'rookie_realized_price_ratio_sd_2y'),
10824
+ zscore: createSeriesPattern1(this, 'rookie_realized_price_ratio_zscore_2y'),
10825
+ _0sd: createCentsSatsUsdPattern(this, 'rookie_realized_price_0sd_2y'),
10826
+ p05sd: createPriceRatioPattern(this, 'rookie_realized_price', 'p0_5sd_2y'),
10827
+ p1sd: createPriceRatioPattern(this, 'rookie_realized_price', 'p1sd_2y'),
10828
+ p15sd: createPriceRatioPattern(this, 'rookie_realized_price', 'p1_5sd_2y'),
10829
+ p2sd: createPriceRatioPattern(this, 'rookie_realized_price', 'p2sd_2y'),
10830
+ p25sd: createPriceRatioPattern(this, 'rookie_realized_price', 'p2_5sd_2y'),
10831
+ p3sd: createPriceRatioPattern(this, 'rookie_realized_price', 'p3sd_2y'),
10832
+ m05sd: createPriceRatioPattern(this, 'rookie_realized_price', 'm0_5sd_2y'),
10833
+ m1sd: createPriceRatioPattern(this, 'rookie_realized_price', 'm1sd_2y'),
10834
+ m15sd: createPriceRatioPattern(this, 'rookie_realized_price', 'm1_5sd_2y'),
10835
+ m2sd: createPriceRatioPattern(this, 'rookie_realized_price', 'm2sd_2y'),
10836
+ m25sd: createPriceRatioPattern(this, 'rookie_realized_price', 'm2_5sd_2y'),
10837
+ m3sd: createPriceRatioPattern(this, 'rookie_realized_price', 'm3sd_2y'),
10838
+ },
10839
+ _1y: {
10840
+ sd: createSeriesPattern1(this, 'rookie_realized_price_ratio_sd_1y'),
10841
+ zscore: createSeriesPattern1(this, 'rookie_realized_price_ratio_zscore_1y'),
10842
+ _0sd: createCentsSatsUsdPattern(this, 'rookie_realized_price_0sd_1y'),
10843
+ p05sd: createPriceRatioPattern(this, 'rookie_realized_price', 'p0_5sd_1y'),
10844
+ p1sd: createPriceRatioPattern(this, 'rookie_realized_price', 'p1sd_1y'),
10845
+ p15sd: createPriceRatioPattern(this, 'rookie_realized_price', 'p1_5sd_1y'),
10846
+ p2sd: createPriceRatioPattern(this, 'rookie_realized_price', 'p2sd_1y'),
10847
+ p25sd: createPriceRatioPattern(this, 'rookie_realized_price', 'p2_5sd_1y'),
10848
+ p3sd: createPriceRatioPattern(this, 'rookie_realized_price', 'p3sd_1y'),
10849
+ m05sd: createPriceRatioPattern(this, 'rookie_realized_price', 'm0_5sd_1y'),
10850
+ m1sd: createPriceRatioPattern(this, 'rookie_realized_price', 'm1sd_1y'),
10851
+ m15sd: createPriceRatioPattern(this, 'rookie_realized_price', 'm1_5sd_1y'),
10852
+ m2sd: createPriceRatioPattern(this, 'rookie_realized_price', 'm2sd_1y'),
10853
+ m25sd: createPriceRatioPattern(this, 'rookie_realized_price', 'm2_5sd_1y'),
10854
+ m3sd: createPriceRatioPattern(this, 'rookie_realized_price', 'm3sd_1y'),
10855
+ },
10856
+ },
10857
+ },
10858
+ mvrv: createSeriesPattern1(this, 'rookie_mvrv'),
10859
+ netPnl: createBlockChangeCumulativeDeltaSumPattern(this, 'rookie_net'),
10860
+ sopr: createRatioValuePattern2(this, 'rookie'),
10861
+ grossPnl: createBlockCumulativeSumPattern(this, 'rookie_realized_gross_pnl'),
10862
+ sellSideRiskRatio: create_1m1w1y24hPattern8(this, 'rookie_sell_side_risk_ratio'),
10863
+ peakRegret: createBlockCumulativeSumPattern(this, 'rookie_realized_peak_regret'),
10864
+ capitalized: createPricePattern(this, 'rookie_capitalized_price'),
10865
+ profitToLossRatio: create_1m1w1y24hPattern(this, 'rookie_realized_profit_to_loss_ratio'),
10866
+ },
10867
+ costBasis: createInMaxMinPerSupplyPattern(this, 'rookie'),
10868
+ unrealized: createCapitalizedGrossInvestedLossNetNuplProfitSentimentPattern2(this, 'rookie'),
10869
+ investedCapital: createInPattern(this, 'rookie_invested_capital_in'),
10870
+ },
10871
+ },
10346
10872
  overAmount: {
10347
10873
  _1sat: createActivityOutputsRealizedSupplyUnrealizedPattern2(this, 'utxos_over_1sat'),
10348
10874
  _10sats: createActivityOutputsRealizedSupplyUnrealizedPattern2(this, 'utxos_over_10sats'),
@@ -10971,6 +11497,23 @@ class BrkClient extends BrkClientBase {
10971
11497
  return this.getJson(path, { signal, onValue, cache });
10972
11498
  }
10973
11499
 
11500
+ /**
11501
+ * Address hash-prefix matches
11502
+ *
11503
+ * Find addresses by address type and address-payload hash prefix. Intended for privacy-preserving client-side wallet discovery without sending raw addresses or xpubs. Fetch metadata for the returned addresses through `/api/address/{address}`.
11504
+ *
11505
+ * Endpoint: `GET /api/address/hash-prefix/{addr_type}/{prefix}`
11506
+ *
11507
+ * @param {OutputType} addr_type
11508
+ * @param {string} prefix
11509
+ * @param {{ signal?: AbortSignal, onValue?: (value: AddrHashPrefixMatches) => void, cache?: boolean }} [options]
11510
+ * @returns {Promise<AddrHashPrefixMatches>}
11511
+ */
11512
+ async getAddressHashPrefixMatches(addr_type, prefix, { signal, onValue, cache } = {}) {
11513
+ const path = `/api/address/hash-prefix/${addr_type}/${prefix}`;
11514
+ return this.getJson(path, { signal, onValue, cache });
11515
+ }
11516
+
10974
11517
  /**
10975
11518
  * Address information
10976
11519
  *
package/package.json CHANGED
@@ -40,5 +40,5 @@
40
40
  "url": "git+https://github.com/bitcoinresearchkit/brk.git"
41
41
  },
42
42
  "type": "module",
43
- "version": "0.3.3"
43
+ "version": "0.3.5"
44
44
  }