diff --git a/.gitignore b/.gitignore index 27fe5784a..345517cfb 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,7 @@ _* /*.py /api.json /*.json +/*.html # Logs *.log* diff --git a/Cargo.lock b/Cargo.lock index 1379005d8..4557b7941 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -489,6 +489,7 @@ dependencies = [ "brk_types", "minreq", "serde", + "serde_json", ] [[package]] diff --git a/crates/brk/README.md b/crates/brk/README.md index 3019541e9..d07d7e82d 100644 --- a/crates/brk/README.md +++ b/crates/brk/README.md @@ -2,44 +2,66 @@ Umbrella crate for the Bitcoin Research Kit. -## What It Enables - -Single dependency to access any BRK component. Enable only what you need via feature flags. +[crates.io](https://crates.io/crates/brk) | [docs.rs](https://docs.rs/brk) ## Usage +Single dependency to access any BRK component. Enable only what you need via feature flags. + ```toml [dependencies] -brk = { version = "0.x", features = ["query", "types"] } +brk = { version = "0.1", features = ["query", "types"] } ``` -```rust,ignore +```rust use brk::query::Query; use brk::types::Height; ``` -## Feature Flags +Feature flags match crate names without the `brk_` prefix. Use `full` to enable all. -| Feature | Crate | Description | -|---------|-------|-------------| -| `bencher` | `brk_bencher` | Benchmarking utilities | -| `binder` | `brk_binder` | Client code generation | -| `client` | `brk_client` | Generated Rust API client | -| `computer` | `brk_computer` | Metric computation | -| `error` | `brk_error` | Error types | -| `fetcher` | `brk_fetcher` | Price data fetching | -| `cohort` | `brk_cohort` | Cohort filtering | -| `indexer` | `brk_indexer` | Blockchain indexing | -| `iterator` | `brk_iterator` | Block iteration | -| `logger` | `brk_logger` | Logging setup | -| `mcp` | `brk_mcp` | MCP server | -| `mempool` | `brk_mempool` | Mempool monitoring | -| `query` | `brk_query` | Query interface | -| `reader` | `brk_reader` | Raw block reading | -| `rpc` | `brk_rpc` | Bitcoin RPC client | -| `server` | `brk_server` | HTTP API server | -| `store` | `brk_store` | Key-value storage | -| `traversable` | `brk_traversable` | Data traversal | -| `types` | `brk_types` | Domain types | +## Crates -Use `full` to enable all features. +**Core Pipeline** + +| Crate | Description | +|-------|-------------| +| [brk_reader](https://docs.rs/brk_reader) | Read blocks from `blk*.dat` with parallel parsing and XOR decoding | +| [brk_indexer](https://docs.rs/brk_indexer) | Index transactions, addresses, and UTXOs | +| [brk_computer](https://docs.rs/brk_computer) | Compute derived metrics (realized cap, MVRV, SOPR, cohorts, etc.) | +| [brk_mempool](https://docs.rs/brk_mempool) | Monitor mempool, estimate fees, project upcoming blocks | +| [brk_query](https://docs.rs/brk_query) | Query interface for indexed and computed data | +| [brk_server](https://docs.rs/brk_server) | REST API with OpenAPI docs | + +**Data & Storage** + +| Crate | Description | +|-------|-------------| +| [brk_types](https://docs.rs/brk_types) | Domain types: `Height`, `Sats`, `Txid`, addresses, etc. | +| [brk_store](https://docs.rs/brk_store) | Key-value storage (fjall wrapper) | +| [brk_fetcher](https://docs.rs/brk_fetcher) | Fetch price data from exchanges | +| [brk_rpc](https://docs.rs/brk_rpc) | Bitcoin Core RPC client | +| [brk_iterator](https://docs.rs/brk_iterator) | Unified block iteration with automatic source selection | +| [brk_cohort](https://docs.rs/brk_cohort) | UTXO and address cohort filtering | +| [brk_traversable](https://docs.rs/brk_traversable) | Navigate hierarchical data structures | + +**Clients & Integration** + +| Crate | Description | +|-------|-------------| +| [brk_client](https://docs.rs/brk_client) | Generated Rust API client | +| [brk_bindgen](https://docs.rs/brk_bindgen) | Generate typed clients (Rust, JavaScript, Python) | +| [brk_mcp](https://docs.rs/brk_mcp) | Model Context Protocol server for LLM integration | + +**Internal** + +| Crate | Description | +|-------|-------------| +| [brk_cli](https://docs.rs/brk_cli) | CLI binary (`cargo install --locked brk_cli`) | +| [brk_error](https://docs.rs/brk_error) | Error types | +| [brk_logger](https://docs.rs/brk_logger) | Logging infrastructure | +| [brk_bencher](https://docs.rs/brk_bencher) | Benchmarking utilities | + +## License + +MIT diff --git a/crates/brk_bindgen/src/generators/javascript/api.rs b/crates/brk_bindgen/src/generators/javascript/api.rs index cdacd24df..61efdd7a0 100644 --- a/crates/brk_bindgen/src/generators/javascript/api.rs +++ b/crates/brk_bindgen/src/generators/javascript/api.rs @@ -2,7 +2,7 @@ use std::fmt::Write; -use crate::{Endpoint, Parameter, generators::MANUAL_GENERIC_TYPES, to_camel_case}; +use crate::{Endpoint, Parameter, generators::{MANUAL_GENERIC_TYPES, write_description}, to_camel_case}; /// Generate API methods for the BrkClient class. pub fn generate_api_methods(output: &mut String, endpoints: &[Endpoint]) { @@ -28,9 +28,13 @@ pub fn generate_api_methods(output: &mut String, endpoints: &[Endpoint]) { && endpoint.summary.as_ref() != Some(desc) { writeln!(output, " *").unwrap(); - writeln!(output, " * {}", desc).unwrap(); + write_description(output, desc, " * ", " *"); } + // Add endpoint path + writeln!(output, " *").unwrap(); + writeln!(output, " * Endpoint: `{} {}`", endpoint.method.to_uppercase(), endpoint.path).unwrap(); + if !endpoint.path_params.is_empty() || !endpoint.query_params.is_empty() { writeln!(output, " *").unwrap(); } diff --git a/crates/brk_bindgen/src/generators/javascript/client.rs b/crates/brk_bindgen/src/generators/javascript/client.rs index 3e9baf24e..d4b539093 100644 --- a/crates/brk_bindgen/src/generators/javascript/client.rs +++ b/crates/brk_bindgen/src/generators/javascript/client.rs @@ -23,15 +23,22 @@ pub fn generate_base_client(output: &mut String) { * @typedef {{Object}} BrkClientOptions * @property {{string}} baseUrl - Base URL for the API * @property {{number}} [timeout] - Request timeout in milliseconds + * @property {{string|boolean}} [cache] - Enable browser cache with default name (true), custom name (string), or disable (false). No effect in Node.js. Default: true */ const _isBrowser = typeof window !== 'undefined' && 'caches' in window; const _runIdle = (/** @type {{VoidFunction}} */ fn) => (globalThis.requestIdleCallback ?? setTimeout)(fn); +const _defaultCacheName = '__BRK_CLIENT__'; -/** @type {{Promise}} */ -const _cachePromise = _isBrowser - ? caches.open('__BRK_CLIENT__').catch(() => null) - : Promise.resolve(null); +/** + * @param {{string|boolean|undefined}} cache + * @returns {{Promise}} + */ +const _openCache = (cache) => {{ + if (!_isBrowser || cache === false) return Promise.resolve(null); + const name = typeof cache === 'string' ? cache : _defaultCacheName; + return caches.open(name).catch(() => null); +}}; /** * Custom error class for BRK client errors @@ -112,6 +119,8 @@ class BrkClientBase {{ const isString = typeof options === 'string'; this.baseUrl = isString ? options : options.baseUrl; this.timeout = isString ? 5000 : (options.timeout ?? 5000); + /** @type {{Promise}} */ + this._cachePromise = _openCache(isString ? undefined : options.cache); }} /** @@ -136,7 +145,7 @@ class BrkClientBase {{ async getJson(path, onUpdate) {{ const base = this.baseUrl.endsWith('/') ? this.baseUrl.slice(0, -1) : this.baseUrl; const url = `${{base}}${{path}}`; - const cache = await _cachePromise; + const cache = await this._cachePromise; const cachedRes = await cache?.match(url); const cachedJson = cachedRes ? await cachedRes.json() : null; diff --git a/crates/brk_bindgen/src/generators/mod.rs b/crates/brk_bindgen/src/generators/mod.rs index 5d8fb6213..3e3e754bb 100644 --- a/crates/brk_bindgen/src/generators/mod.rs +++ b/crates/brk_bindgen/src/generators/mod.rs @@ -7,6 +7,8 @@ //! - `api.rs` - API method generation //! - `mod.rs` - Entry point +use std::fmt::Write; + pub mod javascript; pub mod python; pub mod rust; @@ -17,3 +19,15 @@ pub use rust::generate_rust_client; /// Types that are manually defined as generics in client code, not from schema. pub const MANUAL_GENERIC_TYPES: &[&str] = &["MetricData", "MetricEndpoint"]; + +/// Write a multi-line description with the given prefix for each line. +/// `empty_prefix` is used for blank lines (e.g., " *" without trailing space). +pub fn write_description(output: &mut String, desc: &str, prefix: &str, empty_prefix: &str) { + for line in desc.lines() { + if line.is_empty() { + writeln!(output, "{}", empty_prefix).unwrap(); + } else { + writeln!(output, "{}{}", prefix, line).unwrap(); + } + } +} diff --git a/crates/brk_bindgen/src/generators/python/api.rs b/crates/brk_bindgen/src/generators/python/api.rs index a97c1ec98..0ef901090 100644 --- a/crates/brk_bindgen/src/generators/python/api.rs +++ b/crates/brk_bindgen/src/generators/python/api.rs @@ -2,7 +2,7 @@ use std::fmt::Write; -use crate::{Endpoint, Parameter, escape_python_keyword, generators::MANUAL_GENERIC_TYPES, to_snake_case}; +use crate::{Endpoint, Parameter, escape_python_keyword, generators::{MANUAL_GENERIC_TYPES, write_description}, to_snake_case}; use super::client::generate_class_constants; use super::types::js_type_to_python; @@ -69,16 +69,31 @@ pub fn generate_api_methods(output: &mut String, endpoints: &[Endpoint]) { (Some(summary), Some(desc)) if summary != desc => { writeln!(output, " \"\"\"{}.", summary.trim_end_matches('.')).unwrap(); writeln!(output).unwrap(); - writeln!(output, " {}\"\"\"", desc).unwrap(); + write_description(output, desc, " ", ""); } (Some(summary), _) => { - writeln!(output, " \"\"\"{}\"\"\"", summary).unwrap(); + writeln!(output, " \"\"\"{}", summary).unwrap(); } (None, Some(desc)) => { - writeln!(output, " \"\"\"{}\"\"\"", desc).unwrap(); + // First line includes opening quotes + let mut lines = desc.lines(); + if let Some(first) = lines.next() { + writeln!(output, " \"\"\"{}", first).unwrap(); + } + for line in lines { + if line.is_empty() { + writeln!(output).unwrap(); + } else { + writeln!(output, " {}", line).unwrap(); + } + } + } + (None, None) => { + write!(output, " \"\"\"").unwrap(); } - (None, None) => {} } + writeln!(output).unwrap(); + writeln!(output, " Endpoint: `{} {}`\"\"\"", endpoint.method.to_uppercase(), endpoint.path).unwrap(); // Build path let path = build_path_template(&endpoint.path, &endpoint.path_params); diff --git a/crates/brk_bindgen/src/generators/rust/api.rs b/crates/brk_bindgen/src/generators/rust/api.rs index 1d23b64a5..e3113f768 100644 --- a/crates/brk_bindgen/src/generators/rust/api.rs +++ b/crates/brk_bindgen/src/generators/rust/api.rs @@ -2,7 +2,7 @@ use std::fmt::Write; -use crate::{Endpoint, VERSION, to_snake_case}; +use crate::{Endpoint, VERSION, generators::write_description, to_snake_case}; use super::types::js_type_to_rust; @@ -78,8 +78,11 @@ pub fn generate_api_methods(output: &mut String, endpoints: &[Endpoint]) { && endpoint.summary.as_ref() != Some(desc) { writeln!(output, " ///").unwrap(); - writeln!(output, " /// {}", desc).unwrap(); + write_description(output, desc, " /// ", " ///"); } + // Add endpoint path + writeln!(output, " ///").unwrap(); + writeln!(output, " /// Endpoint: `{} {}`", endpoint.method.to_uppercase(), endpoint.path).unwrap(); let params = build_method_params(endpoint); writeln!( diff --git a/crates/brk_client/Cargo.toml b/crates/brk_client/Cargo.toml index f099172b4..bb38d7158 100644 --- a/crates/brk_client/Cargo.toml +++ b/crates/brk_client/Cargo.toml @@ -15,3 +15,4 @@ brk_cohort = { workspace = true } brk_types = { workspace = true } minreq = { workspace = true } serde = { workspace = true } +serde_json = { workspace = true } diff --git a/crates/brk_client/README.md b/crates/brk_client/README.md index 03287f4ce..b6fd460ca 100644 --- a/crates/brk_client/README.md +++ b/crates/brk_client/README.md @@ -1 +1,57 @@ # brk_client + +Rust client for the [Bitcoin Research Kit](https://github.com/bitcoinresearchkit/brk) API. + +[crates.io](https://crates.io/crates/brk_client) | [docs.rs](https://docs.rs/brk_client) + +## Installation + +```toml +[dependencies] +brk_client = "0.1" +``` + +## Quick Start + +```rust +use brk_client::{BrkClient, Index}; + +fn main() -> brk_client::Result<()> { + let client = BrkClient::new("http://localhost:3000"); + + // Blockchain data (mempool.space compatible) + let block = client.get_block_by_height(800000)?; + let tx = client.get_tx("abc123...")?; + let address = client.get_address("bc1q...")?; + + // Metrics API - typed, chainable + let prices = client.metrics() + .price.usd.split.close + .by.dateindex() + .range(Some(-30), None)?; // Last 30 days + + // Generic metric fetching + let data = client.get_metric( + "price_close".into(), + Index::DateIndex, + Some(-30), None, None, None, + )?; + + Ok(()) +} +``` + +## Configuration + +```rust +use brk_client::{BrkClient, BrkClientOptions}; + +let client = BrkClient::with_options(BrkClientOptions { + base_url: "http://localhost:3000".to_string(), + timeout_secs: 60, +}); +``` + +## License + +MIT diff --git a/crates/brk_client/examples/basic.rs b/crates/brk_client/examples/basic.rs index 2e49a9686..bec553314 100644 --- a/crates/brk_client/examples/basic.rs +++ b/crates/brk_client/examples/basic.rs @@ -60,7 +60,7 @@ fn main() -> brk_client::Result<()> { println!("Last 3 circulating supply values: {:?}", circulating); // Using generic metric fetching - let metricdata = client.get_metric_by_index( + let metricdata = client.get_metric( Metric::from("price_close"), Index::DateIndex, Some(-3), diff --git a/crates/brk_client/src/lib.rs b/crates/brk_client/src/lib.rs index 5535efe4e..3e2b33774 100644 --- a/crates/brk_client/src/lib.rs +++ b/crates/brk_client/src/lib.rs @@ -2874,56 +2874,6 @@ impl Price111dSmaPattern { } } -/// Pattern struct for repeated tree structure. -pub struct PercentilesPattern { - pub cost_basis_pct05: MetricPattern4, - pub cost_basis_pct10: MetricPattern4, - pub cost_basis_pct15: MetricPattern4, - pub cost_basis_pct20: MetricPattern4, - pub cost_basis_pct25: MetricPattern4, - pub cost_basis_pct30: MetricPattern4, - pub cost_basis_pct35: MetricPattern4, - pub cost_basis_pct40: MetricPattern4, - pub cost_basis_pct45: MetricPattern4, - pub cost_basis_pct50: MetricPattern4, - pub cost_basis_pct55: MetricPattern4, - pub cost_basis_pct60: MetricPattern4, - pub cost_basis_pct65: MetricPattern4, - pub cost_basis_pct70: MetricPattern4, - pub cost_basis_pct75: MetricPattern4, - pub cost_basis_pct80: MetricPattern4, - pub cost_basis_pct85: MetricPattern4, - pub cost_basis_pct90: MetricPattern4, - pub cost_basis_pct95: MetricPattern4, -} - -impl PercentilesPattern { - /// Create a new pattern node with accumulated metric name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - cost_basis_pct05: MetricPattern4::new(client.clone(), _m(&acc, "pct05")), - cost_basis_pct10: MetricPattern4::new(client.clone(), _m(&acc, "pct10")), - cost_basis_pct15: MetricPattern4::new(client.clone(), _m(&acc, "pct15")), - cost_basis_pct20: MetricPattern4::new(client.clone(), _m(&acc, "pct20")), - cost_basis_pct25: MetricPattern4::new(client.clone(), _m(&acc, "pct25")), - cost_basis_pct30: MetricPattern4::new(client.clone(), _m(&acc, "pct30")), - cost_basis_pct35: MetricPattern4::new(client.clone(), _m(&acc, "pct35")), - cost_basis_pct40: MetricPattern4::new(client.clone(), _m(&acc, "pct40")), - cost_basis_pct45: MetricPattern4::new(client.clone(), _m(&acc, "pct45")), - cost_basis_pct50: MetricPattern4::new(client.clone(), _m(&acc, "pct50")), - cost_basis_pct55: MetricPattern4::new(client.clone(), _m(&acc, "pct55")), - cost_basis_pct60: MetricPattern4::new(client.clone(), _m(&acc, "pct60")), - cost_basis_pct65: MetricPattern4::new(client.clone(), _m(&acc, "pct65")), - cost_basis_pct70: MetricPattern4::new(client.clone(), _m(&acc, "pct70")), - cost_basis_pct75: MetricPattern4::new(client.clone(), _m(&acc, "pct75")), - cost_basis_pct80: MetricPattern4::new(client.clone(), _m(&acc, "pct80")), - cost_basis_pct85: MetricPattern4::new(client.clone(), _m(&acc, "pct85")), - cost_basis_pct90: MetricPattern4::new(client.clone(), _m(&acc, "pct90")), - cost_basis_pct95: MetricPattern4::new(client.clone(), _m(&acc, "pct95")), - } - } -} - /// Pattern struct for repeated tree structure. pub struct ActivePriceRatioPattern { pub ratio: MetricPattern4, @@ -2974,6 +2924,56 @@ impl ActivePriceRatioPattern { } } +/// Pattern struct for repeated tree structure. +pub struct PercentilesPattern { + pub cost_basis_pct05: MetricPattern4, + pub cost_basis_pct10: MetricPattern4, + pub cost_basis_pct15: MetricPattern4, + pub cost_basis_pct20: MetricPattern4, + pub cost_basis_pct25: MetricPattern4, + pub cost_basis_pct30: MetricPattern4, + pub cost_basis_pct35: MetricPattern4, + pub cost_basis_pct40: MetricPattern4, + pub cost_basis_pct45: MetricPattern4, + pub cost_basis_pct50: MetricPattern4, + pub cost_basis_pct55: MetricPattern4, + pub cost_basis_pct60: MetricPattern4, + pub cost_basis_pct65: MetricPattern4, + pub cost_basis_pct70: MetricPattern4, + pub cost_basis_pct75: MetricPattern4, + pub cost_basis_pct80: MetricPattern4, + pub cost_basis_pct85: MetricPattern4, + pub cost_basis_pct90: MetricPattern4, + pub cost_basis_pct95: MetricPattern4, +} + +impl PercentilesPattern { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + cost_basis_pct05: MetricPattern4::new(client.clone(), _m(&acc, "pct05")), + cost_basis_pct10: MetricPattern4::new(client.clone(), _m(&acc, "pct10")), + cost_basis_pct15: MetricPattern4::new(client.clone(), _m(&acc, "pct15")), + cost_basis_pct20: MetricPattern4::new(client.clone(), _m(&acc, "pct20")), + cost_basis_pct25: MetricPattern4::new(client.clone(), _m(&acc, "pct25")), + cost_basis_pct30: MetricPattern4::new(client.clone(), _m(&acc, "pct30")), + cost_basis_pct35: MetricPattern4::new(client.clone(), _m(&acc, "pct35")), + cost_basis_pct40: MetricPattern4::new(client.clone(), _m(&acc, "pct40")), + cost_basis_pct45: MetricPattern4::new(client.clone(), _m(&acc, "pct45")), + cost_basis_pct50: MetricPattern4::new(client.clone(), _m(&acc, "pct50")), + cost_basis_pct55: MetricPattern4::new(client.clone(), _m(&acc, "pct55")), + cost_basis_pct60: MetricPattern4::new(client.clone(), _m(&acc, "pct60")), + cost_basis_pct65: MetricPattern4::new(client.clone(), _m(&acc, "pct65")), + cost_basis_pct70: MetricPattern4::new(client.clone(), _m(&acc, "pct70")), + cost_basis_pct75: MetricPattern4::new(client.clone(), _m(&acc, "pct75")), + cost_basis_pct80: MetricPattern4::new(client.clone(), _m(&acc, "pct80")), + cost_basis_pct85: MetricPattern4::new(client.clone(), _m(&acc, "pct85")), + cost_basis_pct90: MetricPattern4::new(client.clone(), _m(&acc, "pct90")), + cost_basis_pct95: MetricPattern4::new(client.clone(), _m(&acc, "pct95")), + } + } +} + /// Pattern struct for repeated tree structure. pub struct RelativePattern5 { pub neg_unrealized_loss_rel_to_market_cap: MetricPattern1, @@ -3390,6 +3390,40 @@ impl PeriodAveragePricePattern { } } +/// Pattern struct for repeated tree structure. +pub struct FullnessPattern { + pub average: MetricPattern2, + pub base: MetricPattern11, + pub cumulative: MetricPattern2, + pub max: MetricPattern2, + pub median: MetricPattern6, + pub min: MetricPattern2, + pub pct10: MetricPattern6, + pub pct25: MetricPattern6, + pub pct75: MetricPattern6, + pub pct90: MetricPattern6, + pub sum: MetricPattern2, +} + +impl FullnessPattern { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + average: MetricPattern2::new(client.clone(), _m(&acc, "average")), + base: MetricPattern11::new(client.clone(), acc.clone()), + cumulative: MetricPattern2::new(client.clone(), _m(&acc, "cumulative")), + max: MetricPattern2::new(client.clone(), _m(&acc, "max")), + median: MetricPattern6::new(client.clone(), _m(&acc, "median")), + min: MetricPattern2::new(client.clone(), _m(&acc, "min")), + pct10: MetricPattern6::new(client.clone(), _m(&acc, "pct10")), + pct25: MetricPattern6::new(client.clone(), _m(&acc, "pct25")), + pct75: MetricPattern6::new(client.clone(), _m(&acc, "pct75")), + pct90: MetricPattern6::new(client.clone(), _m(&acc, "pct90")), + sum: MetricPattern2::new(client.clone(), _m(&acc, "sum")), + } + } +} + /// Pattern struct for repeated tree structure. pub struct ClassAveragePricePattern { pub _2015: MetricPattern4, @@ -3457,40 +3491,6 @@ impl DollarsPattern { } } -/// Pattern struct for repeated tree structure. -pub struct FullnessPattern { - pub average: MetricPattern2, - pub base: MetricPattern11, - pub cumulative: MetricPattern2, - pub max: MetricPattern2, - pub median: MetricPattern6, - pub min: MetricPattern2, - pub pct10: MetricPattern6, - pub pct25: MetricPattern6, - pub pct75: MetricPattern6, - pub pct90: MetricPattern6, - pub sum: MetricPattern2, -} - -impl FullnessPattern { - /// Create a new pattern node with accumulated metric name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - average: MetricPattern2::new(client.clone(), _m(&acc, "average")), - base: MetricPattern11::new(client.clone(), acc.clone()), - cumulative: MetricPattern2::new(client.clone(), _m(&acc, "cumulative")), - max: MetricPattern2::new(client.clone(), _m(&acc, "max")), - median: MetricPattern6::new(client.clone(), _m(&acc, "median")), - min: MetricPattern2::new(client.clone(), _m(&acc, "min")), - pct10: MetricPattern6::new(client.clone(), _m(&acc, "pct10")), - pct25: MetricPattern6::new(client.clone(), _m(&acc, "pct25")), - pct75: MetricPattern6::new(client.clone(), _m(&acc, "pct75")), - pct90: MetricPattern6::new(client.clone(), _m(&acc, "pct90")), - sum: MetricPattern2::new(client.clone(), _m(&acc, "sum")), - } - } -} - /// Pattern struct for repeated tree structure. pub struct RelativePattern2 { pub neg_unrealized_loss_rel_to_own_market_cap: MetricPattern1, @@ -3731,6 +3731,93 @@ impl _0satsPattern { } } +/// Pattern struct for repeated tree structure. +pub struct _10yTo12yPattern { + pub activity: ActivityPattern2, + pub cost_basis: CostBasisPattern2, + pub outputs: OutputsPattern, + pub realized: RealizedPattern2, + pub relative: RelativePattern2, + pub supply: SupplyPattern2, + pub unrealized: UnrealizedPattern, +} + +impl _10yTo12yPattern { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + activity: ActivityPattern2::new(client.clone(), acc.clone()), + cost_basis: CostBasisPattern2::new(client.clone(), acc.clone()), + outputs: OutputsPattern::new(client.clone(), acc.clone()), + realized: RealizedPattern2::new(client.clone(), acc.clone()), + relative: RelativePattern2::new(client.clone(), acc.clone()), + supply: SupplyPattern2::new(client.clone(), _m(&acc, "supply")), + unrealized: UnrealizedPattern::new(client.clone(), acc.clone()), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct _10yPattern { + pub activity: ActivityPattern2, + pub cost_basis: CostBasisPattern, + pub outputs: OutputsPattern, + pub realized: RealizedPattern4, + pub relative: RelativePattern, + pub supply: SupplyPattern2, + pub unrealized: UnrealizedPattern, +} + +impl _10yPattern { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + activity: ActivityPattern2::new(client.clone(), acc.clone()), + cost_basis: CostBasisPattern::new(client.clone(), acc.clone()), + outputs: OutputsPattern::new(client.clone(), acc.clone()), + realized: RealizedPattern4::new(client.clone(), acc.clone()), + relative: RelativePattern::new(client.clone(), acc.clone()), + supply: SupplyPattern2::new(client.clone(), _m(&acc, "supply")), + unrealized: UnrealizedPattern::new(client.clone(), acc.clone()), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct UnrealizedPattern { + pub neg_unrealized_loss: MetricPattern1, + pub net_unrealized_pnl: MetricPattern1, + pub supply_in_loss: ActiveSupplyPattern, + pub supply_in_profit: ActiveSupplyPattern, + pub total_unrealized_pnl: MetricPattern1, + pub unrealized_loss: MetricPattern1, + pub unrealized_profit: MetricPattern1, +} + +impl UnrealizedPattern { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + neg_unrealized_loss: MetricPattern1::new( + client.clone(), + _m(&acc, "neg_unrealized_loss"), + ), + net_unrealized_pnl: MetricPattern1::new(client.clone(), _m(&acc, "net_unrealized_pnl")), + supply_in_loss: ActiveSupplyPattern::new(client.clone(), _m(&acc, "supply_in_loss")), + supply_in_profit: ActiveSupplyPattern::new( + client.clone(), + _m(&acc, "supply_in_profit"), + ), + total_unrealized_pnl: MetricPattern1::new( + client.clone(), + _m(&acc, "total_unrealized_pnl"), + ), + unrealized_loss: MetricPattern1::new(client.clone(), _m(&acc, "unrealized_loss")), + unrealized_profit: MetricPattern1::new(client.clone(), _m(&acc, "unrealized_profit")), + } + } +} + /// Pattern struct for repeated tree structure. pub struct _0satsPattern2 { pub activity: ActivityPattern2, @@ -3783,32 +3870,6 @@ impl _100btcPattern { } } -/// Pattern struct for repeated tree structure. -pub struct _10yPattern { - pub activity: ActivityPattern2, - pub cost_basis: CostBasisPattern, - pub outputs: OutputsPattern, - pub realized: RealizedPattern4, - pub relative: RelativePattern, - pub supply: SupplyPattern2, - pub unrealized: UnrealizedPattern, -} - -impl _10yPattern { - /// Create a new pattern node with accumulated metric name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - activity: ActivityPattern2::new(client.clone(), acc.clone()), - cost_basis: CostBasisPattern::new(client.clone(), acc.clone()), - outputs: OutputsPattern::new(client.clone(), acc.clone()), - realized: RealizedPattern4::new(client.clone(), acc.clone()), - relative: RelativePattern::new(client.clone(), acc.clone()), - supply: SupplyPattern2::new(client.clone(), _m(&acc, "supply")), - unrealized: UnrealizedPattern::new(client.clone(), acc.clone()), - } - } -} - /// Pattern struct for repeated tree structure. pub struct PeriodCagrPattern { pub _10y: MetricPattern4, @@ -3884,67 +3945,6 @@ impl PeriodCagrPattern { } } -/// Pattern struct for repeated tree structure. -pub struct _10yTo12yPattern { - pub activity: ActivityPattern2, - pub cost_basis: CostBasisPattern2, - pub outputs: OutputsPattern, - pub realized: RealizedPattern2, - pub relative: RelativePattern2, - pub supply: SupplyPattern2, - pub unrealized: UnrealizedPattern, -} - -impl _10yTo12yPattern { - /// Create a new pattern node with accumulated metric name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - activity: ActivityPattern2::new(client.clone(), acc.clone()), - cost_basis: CostBasisPattern2::new(client.clone(), acc.clone()), - outputs: OutputsPattern::new(client.clone(), acc.clone()), - realized: RealizedPattern2::new(client.clone(), acc.clone()), - relative: RelativePattern2::new(client.clone(), acc.clone()), - supply: SupplyPattern2::new(client.clone(), _m(&acc, "supply")), - unrealized: UnrealizedPattern::new(client.clone(), acc.clone()), - } - } -} - -/// Pattern struct for repeated tree structure. -pub struct UnrealizedPattern { - pub neg_unrealized_loss: MetricPattern1, - pub net_unrealized_pnl: MetricPattern1, - pub supply_in_loss: ActiveSupplyPattern, - pub supply_in_profit: ActiveSupplyPattern, - pub total_unrealized_pnl: MetricPattern1, - pub unrealized_loss: MetricPattern1, - pub unrealized_profit: MetricPattern1, -} - -impl UnrealizedPattern { - /// Create a new pattern node with accumulated metric name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - neg_unrealized_loss: MetricPattern1::new( - client.clone(), - _m(&acc, "neg_unrealized_loss"), - ), - net_unrealized_pnl: MetricPattern1::new(client.clone(), _m(&acc, "net_unrealized_pnl")), - supply_in_loss: ActiveSupplyPattern::new(client.clone(), _m(&acc, "supply_in_loss")), - supply_in_profit: ActiveSupplyPattern::new( - client.clone(), - _m(&acc, "supply_in_profit"), - ), - total_unrealized_pnl: MetricPattern1::new( - client.clone(), - _m(&acc, "total_unrealized_pnl"), - ), - unrealized_loss: MetricPattern1::new(client.clone(), _m(&acc, "unrealized_loss")), - unrealized_profit: MetricPattern1::new(client.clone(), _m(&acc, "unrealized_profit")), - } - } -} - /// Pattern struct for repeated tree structure. pub struct ActivityPattern2 { pub coinblocks_destroyed: BlockCountPattern, @@ -3997,21 +3997,19 @@ impl SplitPattern2 { } /// Pattern struct for repeated tree structure. -pub struct CostBasisPattern2 { - pub max: MetricPattern1, - pub min: MetricPattern1, - pub percentiles: PercentilesPattern, +pub struct UnclaimedRewardsPattern { + pub bitcoin: BitcoinPattern, + pub dollars: BlockCountPattern, + pub sats: BlockCountPattern, } -impl CostBasisPattern2 { - pub fn new(client: Arc, base_path: String) -> Self { +impl UnclaimedRewardsPattern { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { Self { - max: MetricPattern1::new(client.clone(), format!("{base_path}_max")), - min: MetricPattern1::new(client.clone(), format!("{base_path}_min")), - percentiles: PercentilesPattern::new( - client.clone(), - format!("{base_path}_percentiles"), - ), + bitcoin: BitcoinPattern::new(client.clone(), _m(&acc, "btc")), + dollars: BlockCountPattern::new(client.clone(), _m(&acc, "usd")), + sats: BlockCountPattern::new(client.clone(), acc.clone()), } } } @@ -4034,42 +4032,6 @@ impl ActiveSupplyPattern { } } -/// Pattern struct for repeated tree structure. -pub struct _2015Pattern { - pub bitcoin: MetricPattern4, - pub dollars: MetricPattern4, - pub sats: MetricPattern4, -} - -impl _2015Pattern { - /// Create a new pattern node with accumulated metric name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - bitcoin: MetricPattern4::new(client.clone(), _m(&acc, "btc")), - dollars: MetricPattern4::new(client.clone(), _m(&acc, "usd")), - sats: MetricPattern4::new(client.clone(), acc.clone()), - } - } -} - -/// Pattern struct for repeated tree structure. -pub struct CoinbasePattern2 { - pub bitcoin: BlockCountPattern, - pub dollars: BlockCountPattern, - pub sats: BlockCountPattern, -} - -impl CoinbasePattern2 { - /// Create a new pattern node with accumulated metric name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - bitcoin: BlockCountPattern::new(client.clone(), _m(&acc, "btc")), - dollars: BlockCountPattern::new(client.clone(), _m(&acc, "usd")), - sats: BlockCountPattern::new(client.clone(), acc.clone()), - } - } -} - /// Pattern struct for repeated tree structure. pub struct CoinbasePattern { pub bitcoin: FullnessPattern, @@ -4107,23 +4069,61 @@ impl SegwitAdoptionPattern { } /// Pattern struct for repeated tree structure. -pub struct UnclaimedRewardsPattern { - pub bitcoin: BitcoinPattern, +pub struct _2015Pattern { + pub bitcoin: MetricPattern4, + pub dollars: MetricPattern4, + pub sats: MetricPattern4, +} + +impl _2015Pattern { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + bitcoin: MetricPattern4::new(client.clone(), _m(&acc, "btc")), + dollars: MetricPattern4::new(client.clone(), _m(&acc, "usd")), + sats: MetricPattern4::new(client.clone(), acc.clone()), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct CoinbasePattern2 { + pub bitcoin: BlockCountPattern, pub dollars: BlockCountPattern, pub sats: BlockCountPattern, } -impl UnclaimedRewardsPattern { +impl CoinbasePattern2 { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - bitcoin: BitcoinPattern::new(client.clone(), _m(&acc, "btc")), + bitcoin: BlockCountPattern::new(client.clone(), _m(&acc, "btc")), dollars: BlockCountPattern::new(client.clone(), _m(&acc, "usd")), sats: BlockCountPattern::new(client.clone(), acc.clone()), } } } +/// Pattern struct for repeated tree structure. +pub struct CostBasisPattern2 { + pub max: MetricPattern1, + pub min: MetricPattern1, + pub percentiles: PercentilesPattern, +} + +impl CostBasisPattern2 { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + max: MetricPattern1::new(client.clone(), format!("{base_path}_max")), + min: MetricPattern1::new(client.clone(), format!("{base_path}_min")), + percentiles: PercentilesPattern::new( + client.clone(), + format!("{base_path}_percentiles"), + ), + } + } +} + /// Pattern struct for repeated tree structure. pub struct CostBasisPattern { pub max: MetricPattern1, @@ -4156,6 +4156,22 @@ impl _1dReturns1mSdPattern { } } +/// Pattern struct for repeated tree structure. +pub struct SupplyPattern2 { + pub halved: ActiveSupplyPattern, + pub total: ActiveSupplyPattern, +} + +impl SupplyPattern2 { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + halved: ActiveSupplyPattern::new(client.clone(), _m(&acc, "half")), + total: ActiveSupplyPattern::new(client.clone(), acc.clone()), + } + } +} + /// Pattern struct for repeated tree structure. pub struct RelativePattern4 { pub supply_in_loss_rel_to_own_supply: MetricPattern1, @@ -4178,37 +4194,6 @@ impl RelativePattern4 { } } -/// Pattern struct for repeated tree structure. -pub struct SupplyPattern2 { - pub halved: ActiveSupplyPattern, - pub total: ActiveSupplyPattern, -} - -impl SupplyPattern2 { - /// Create a new pattern node with accumulated metric name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - halved: ActiveSupplyPattern::new(client.clone(), _m(&acc, "half")), - total: ActiveSupplyPattern::new(client.clone(), acc.clone()), - } - } -} - -/// Pattern struct for repeated tree structure. -pub struct SatsPattern { - pub ohlc: MetricPattern1, - pub split: SplitPattern2, -} - -impl SatsPattern { - pub fn new(client: Arc, base_path: String) -> Self { - Self { - ohlc: MetricPattern1::new(client.clone(), format!("{base_path}_ohlc")), - split: SplitPattern2::new(client.clone(), format!("{base_path}_split")), - } - } -} - /// Pattern struct for repeated tree structure. pub struct BitcoinPattern { pub cumulative: MetricPattern2, @@ -4241,6 +4226,21 @@ impl BlockCountPattern { } } +/// Pattern struct for repeated tree structure. +pub struct SatsPattern { + pub ohlc: MetricPattern1, + pub split: SplitPattern2, +} + +impl SatsPattern { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + ohlc: MetricPattern1::new(client.clone(), format!("{base_path}_ohlc")), + split: SplitPattern2::new(client.clone(), format!("{base_path}_split")), + } + } +} + /// Pattern struct for repeated tree structure. pub struct RealizedPriceExtraPattern { pub ratio: MetricPattern4, @@ -8128,7 +8128,11 @@ impl BrkClient { /// Address information /// - /// Retrieve comprehensive information about a Bitcoin address including balance, transaction history, UTXOs, and estimated investment metrics. Supports all standard Bitcoin address types (P2PKH, P2SH, P2WPKH, P2WSH, P2TR, etc.). + /// Retrieve address information including balance and transaction counts. Supports all standard Bitcoin address types (P2PKH, P2SH, P2WPKH, P2WSH, P2TR). + /// + /// *[Mempool.space docs](https://mempool.space/docs/api/rest#get-address)* + /// + /// Endpoint: `GET /api/address/{address}` pub fn get_address(&self, address: Address) -> Result { self.base.get_json(&format!("/api/address/{address}")) } @@ -8136,6 +8140,10 @@ impl BrkClient { /// Address transaction IDs /// /// Get transaction IDs for an address, newest first. Use after_txid for pagination. + /// + /// *[Mempool.space docs](https://mempool.space/docs/api/rest#get-address-transactions)* + /// + /// Endpoint: `GET /api/address/{address}/txs` pub fn get_address_txs( &self, address: Address, @@ -8161,7 +8169,11 @@ impl BrkClient { /// Address confirmed transactions /// /// Get confirmed transaction IDs for an address, 25 per page. Use ?after_txid= for pagination. - pub fn get_address_txs_chain( + /// + /// *[Mempool.space docs](https://mempool.space/docs/api/rest#get-address-transactions-chain)* + /// + /// Endpoint: `GET /api/address/{address}/txs/chain` + pub fn get_address_confirmed_txs( &self, address: Address, after_txid: Option<&str>, @@ -8186,69 +8198,101 @@ impl BrkClient { /// Address mempool transactions /// /// Get unconfirmed transaction IDs for an address from the mempool (up to 50). - pub fn get_address_txs_mempool(&self, address: Address) -> Result> { + /// + /// *[Mempool.space docs](https://mempool.space/docs/api/rest#get-address-transactions-mempool)* + /// + /// Endpoint: `GET /api/address/{address}/txs/mempool` + pub fn get_address_mempool_txs(&self, address: Address) -> Result> { self.base .get_json(&format!("/api/address/{address}/txs/mempool")) } /// Address UTXOs /// - /// Get unspent transaction outputs for an address. - pub fn get_address_utxo(&self, address: Address) -> Result> { + /// Get unspent transaction outputs (UTXOs) for an address. Returns txid, vout, value, and confirmation status for each UTXO. + /// + /// *[Mempool.space docs](https://mempool.space/docs/api/rest#get-address-utxo)* + /// + /// Endpoint: `GET /api/address/{address}/utxo` + pub fn get_address_utxos(&self, address: Address) -> Result> { self.base.get_json(&format!("/api/address/{address}/utxo")) } /// Block by height /// /// Retrieve block information by block height. Returns block metadata including hash, timestamp, difficulty, size, weight, and transaction count. - pub fn get_block_height(&self, height: Height) -> Result { + /// + /// *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-height)* + /// + /// Endpoint: `GET /api/block-height/{height}` + pub fn get_block_by_height(&self, height: Height) -> Result { self.base.get_json(&format!("/api/block-height/{height}")) } /// Block information /// /// Retrieve block information by block hash. Returns block metadata including height, timestamp, difficulty, size, weight, and transaction count. - pub fn get_block_by_hash(&self, hash: BlockHash) -> Result { + /// + /// *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block)* + /// + /// Endpoint: `GET /api/block/{hash}` + pub fn get_block(&self, hash: BlockHash) -> Result { self.base.get_json(&format!("/api/block/{hash}")) } /// Raw block /// /// Returns the raw block data in binary format. - pub fn get_block_by_hash_raw(&self, hash: BlockHash) -> Result> { + /// + /// *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-raw)* + /// + /// Endpoint: `GET /api/block/{hash}/raw` + pub fn get_block_raw(&self, hash: BlockHash) -> Result> { self.base.get_json(&format!("/api/block/{hash}/raw")) } /// Block status /// /// 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. - pub fn get_block_by_hash_status(&self, hash: BlockHash) -> Result { + /// + /// *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-status)* + /// + /// Endpoint: `GET /api/block/{hash}/status` + pub fn get_block_status(&self, hash: BlockHash) -> Result { self.base.get_json(&format!("/api/block/{hash}/status")) } /// Transaction ID at index /// /// Retrieve a single transaction ID at a specific index within a block. Returns plain text txid. - pub fn get_block_by_hash_txid_by_index(&self, hash: BlockHash, index: TxIndex) -> Result { + /// + /// *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-transaction-id)* + /// + /// Endpoint: `GET /api/block/{hash}/txid/{index}` + pub fn get_block_txid(&self, hash: BlockHash, index: TxIndex) -> Result { self.base .get_json(&format!("/api/block/{hash}/txid/{index}")) } /// Block transaction IDs /// - /// Retrieve all transaction IDs in a block by block hash. - pub fn get_block_by_hash_txids(&self, hash: BlockHash) -> Result> { + /// Retrieve all transaction IDs in a block. Returns an array of txids in block order. + /// + /// *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-transaction-ids)* + /// + /// Endpoint: `GET /api/block/{hash}/txids` + pub fn get_block_txids(&self, hash: BlockHash) -> Result> { self.base.get_json(&format!("/api/block/{hash}/txids")) } /// Block transactions (paginated) /// /// Retrieve transactions in a block by block hash, starting from the specified index. Returns up to 25 transactions at a time. - pub fn get_block_by_hash_txs_by_start_index( - &self, - hash: BlockHash, - start_index: TxIndex, - ) -> Result> { + /// + /// *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-transactions)* + /// + /// Endpoint: `GET /api/block/{hash}/txs/{start_index}` + pub fn get_block_txs(&self, hash: BlockHash, start_index: TxIndex) -> Result> { self.base .get_json(&format!("/api/block/{hash}/txs/{start_index}")) } @@ -8256,6 +8300,10 @@ impl BrkClient { /// Recent blocks /// /// Retrieve the last 10 blocks. Returns block metadata for each block. + /// + /// *[Mempool.space docs](https://mempool.space/docs/api/rest#get-blocks)* + /// + /// Endpoint: `GET /api/blocks` pub fn get_blocks(&self) -> Result> { self.base.get_json(&format!("/api/blocks")) } @@ -8263,35 +8311,51 @@ impl BrkClient { /// Blocks from height /// /// 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. - pub fn get_blocks_by_height(&self, height: Height) -> Result> { + /// + /// *[Mempool.space docs](https://mempool.space/docs/api/rest#get-blocks)* + /// + /// Endpoint: `GET /api/blocks/{height}` + pub fn get_blocks_from_height(&self, height: Height) -> Result> { self.base.get_json(&format!("/api/blocks/{height}")) } /// Mempool statistics /// /// Get current mempool statistics including transaction count, total vsize, and total fees. - pub fn get_mempool_info(&self) -> Result { + /// + /// *[Mempool.space docs](https://mempool.space/docs/api/rest#get-mempool)* + /// + /// Endpoint: `GET /api/mempool/info` + pub fn get_mempool(&self) -> Result { self.base.get_json(&format!("/api/mempool/info")) } /// Mempool transaction IDs /// /// Get all transaction IDs currently in the mempool. + /// + /// *[Mempool.space docs](https://mempool.space/docs/api/rest#get-mempool-transaction-ids)* + /// + /// Endpoint: `GET /api/mempool/txids` pub fn get_mempool_txids(&self) -> Result> { self.base.get_json(&format!("/api/mempool/txids")) } /// Get supported indexes for a metric /// - /// Returns the list of indexes are supported by the specified metric. For example, `realized_price` might be available on dateindex, weekindex, and monthindex. - pub fn get_metric(&self, metric: Metric) -> Result> { + /// Returns the list of indexes supported by the specified metric. For example, `realized_price` might be available on dateindex, weekindex, and monthindex. + /// + /// Endpoint: `GET /api/metric/{metric}` + pub fn get_metric_info(&self, metric: Metric) -> Result> { self.base.get_json(&format!("/api/metric/{metric}")) } /// Get metric data /// /// Fetch data for a specific metric at the given index. Use query parameters to filter by date range and format (json/csv). - pub fn get_metric_by_index( + /// + /// Endpoint: `GET /api/metric/{metric}/{index}` + pub fn get_metric( &self, metric: Metric, index: Index, @@ -8332,15 +8396,19 @@ impl BrkClient { /// Metrics catalog /// - /// Returns the complete hierarchical catalog of available metrics organized as a tree structure. Metrics are grouped by categories and subcategories. Best viewed in an interactive JSON viewer (e.g., Firefox's built-in JSON viewer) for easy navigation of the nested structure. - pub fn get_metrics(&self) -> Result { + /// Returns the complete hierarchical catalog of available metrics organized as a tree structure. Metrics are grouped by categories and subcategories. + /// + /// Endpoint: `GET /api/metrics` + pub fn get_metrics_tree(&self) -> Result { self.base.get_json(&format!("/api/metrics")) } /// Bulk metric data /// - /// Fetch multiple metrics in a single request. Supports filtering by index and date range. Returns an array of MetricData objects. - pub fn get_metrics_bulk( + /// Fetch multiple metrics in a single request. Supports filtering by index and date range. Returns an array of MetricData objects. For a single metric, use `get_metric` instead. + /// + /// Endpoint: `GET /api/metrics/bulk` + pub fn get_metrics( &self, metrics: Metrics, index: Index, @@ -8379,7 +8447,9 @@ impl BrkClient { /// Metric count /// - /// Current metric count + /// Returns the number of metrics available per index type. + /// + /// Endpoint: `GET /api/metrics/count` pub fn get_metrics_count(&self) -> Result> { self.base.get_json(&format!("/api/metrics/count")) } @@ -8387,14 +8457,18 @@ impl BrkClient { /// List available indexes /// /// Returns all available indexes with their accepted query aliases. Use any alias when querying metrics. - pub fn get_metrics_indexes(&self) -> Result> { + /// + /// Endpoint: `GET /api/metrics/indexes` + pub fn get_indexes(&self) -> Result> { self.base.get_json(&format!("/api/metrics/indexes")) } /// Metrics list /// - /// Paginated list of available metrics - pub fn get_metrics_list(&self, page: Option) -> Result { + /// Paginated flat list of all available metric names. Use `page` query param for pagination. + /// + /// Endpoint: `GET /api/metrics/list` + pub fn list_metrics(&self, page: Option) -> Result { let mut query = Vec::new(); if let Some(v) = page { query.push(format!("page={}", v)); @@ -8411,11 +8485,9 @@ impl BrkClient { /// Search metrics /// /// Fuzzy search for metrics by name. Supports partial matches and typos. - pub fn get_metrics_search_by_metric( - &self, - metric: Metric, - limit: Option, - ) -> Result> { + /// + /// Endpoint: `GET /api/metrics/search/{metric}` + pub fn search_metrics(&self, metric: Metric, limit: Option) -> Result> { let mut query = Vec::new(); if let Some(v) = limit { query.push(format!("limit={}", v)); @@ -8431,22 +8503,34 @@ impl BrkClient { /// Transaction information /// - /// Retrieve complete transaction data by transaction ID (txid). Returns the full transaction details including inputs, outputs, and metadata. The transaction data is read directly from the blockchain data files. - pub fn get_tx_by_txid(&self, txid: Txid) -> Result { + /// Retrieve complete transaction data by transaction ID (txid). Returns inputs, outputs, fee, size, and confirmation status. + /// + /// *[Mempool.space docs](https://mempool.space/docs/api/rest#get-transaction)* + /// + /// Endpoint: `GET /api/tx/{txid}` + pub fn get_tx(&self, txid: Txid) -> Result { self.base.get_json(&format!("/api/tx/{txid}")) } /// Transaction hex /// /// Retrieve the raw transaction as a hex-encoded string. Returns the serialized transaction in hexadecimal format. - pub fn get_tx_by_txid_hex(&self, txid: Txid) -> Result { + /// + /// *[Mempool.space docs](https://mempool.space/docs/api/rest#get-transaction-hex)* + /// + /// Endpoint: `GET /api/tx/{txid}/hex` + pub fn get_tx_hex(&self, txid: Txid) -> Result { self.base.get_json(&format!("/api/tx/{txid}/hex")) } /// Output spend status /// /// Get the spending status of a transaction output. Returns whether the output has been spent and, if so, the spending transaction details. - pub fn get_tx_by_txid_outspend_by_vout(&self, txid: Txid, vout: Vout) -> Result { + /// + /// *[Mempool.space docs](https://mempool.space/docs/api/rest#get-transaction-outspend)* + /// + /// Endpoint: `GET /api/tx/{txid}/outspend/{vout}` + pub fn get_tx_outspend(&self, txid: Txid, vout: Vout) -> Result { self.base .get_json(&format!("/api/tx/{txid}/outspend/{vout}")) } @@ -8454,21 +8538,33 @@ impl BrkClient { /// All output spend statuses /// /// Get the spending status of all outputs in a transaction. Returns an array with the spend status for each output. - pub fn get_tx_by_txid_outspends(&self, txid: Txid) -> Result> { + /// + /// *[Mempool.space docs](https://mempool.space/docs/api/rest#get-transaction-outspends)* + /// + /// Endpoint: `GET /api/tx/{txid}/outspends` + pub fn get_tx_outspends(&self, txid: Txid) -> Result> { self.base.get_json(&format!("/api/tx/{txid}/outspends")) } /// Transaction status /// /// Retrieve the confirmation status of a transaction. Returns whether the transaction is confirmed and, if so, the block height, hash, and timestamp. - pub fn get_tx_by_txid_status(&self, txid: Txid) -> Result { + /// + /// *[Mempool.space docs](https://mempool.space/docs/api/rest#get-transaction-status)* + /// + /// Endpoint: `GET /api/tx/{txid}/status` + pub fn get_tx_status(&self, txid: Txid) -> Result { self.base.get_json(&format!("/api/tx/{txid}/status")) } /// Difficulty adjustment /// /// Get current difficulty adjustment information including progress through the current epoch, estimated retarget date, and difficulty change prediction. - pub fn get_v1_difficulty_adjustment(&self) -> Result { + /// + /// *[Mempool.space docs](https://mempool.space/docs/api/rest#get-difficulty-adjustment)* + /// + /// Endpoint: `GET /api/v1/difficulty-adjustment` + pub fn get_difficulty_adjustment(&self) -> Result { self.base .get_json(&format!("/api/v1/difficulty-adjustment")) } @@ -8476,24 +8572,45 @@ impl BrkClient { /// Projected mempool blocks /// /// Get projected blocks from the mempool for fee estimation. Each block contains statistics about transactions that would be included if a block were mined now. - pub fn get_v1_fees_mempool_blocks(&self) -> Result> { + /// + /// *[Mempool.space docs](https://mempool.space/docs/api/rest#get-mempool-blocks-fees)* + /// + /// Endpoint: `GET /api/v1/fees/mempool-blocks` + pub fn get_mempool_blocks(&self) -> Result> { self.base.get_json(&format!("/api/v1/fees/mempool-blocks")) } /// Recommended fees /// /// Get recommended fee rates for different confirmation targets based on current mempool state. - pub fn get_v1_fees_recommended(&self) -> Result { + /// + /// *[Mempool.space docs](https://mempool.space/docs/api/rest#get-recommended-fees)* + /// + /// Endpoint: `GET /api/v1/fees/recommended` + pub fn get_recommended_fees(&self) -> Result { self.base.get_json(&format!("/api/v1/fees/recommended")) } + /// Block fee rates (WIP) + /// + /// **Work in progress.** Get block fee rate percentiles (min, 10th, 25th, median, 75th, 90th, max) for a time period. Valid periods: 24h, 3d, 1w, 1m, 3m, 6m, 1y, 2y, 3y + /// + /// *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-feerates)* + /// + /// Endpoint: `GET /api/v1/mining/blocks/fee-rates/{time_period}` + pub fn get_block_fee_rates(&self, time_period: TimePeriod) -> Result { + self.base + .get_json(&format!("/api/v1/mining/blocks/fee-rates/{time_period}")) + } + /// Block fees /// /// Get average block fees for a time period. Valid periods: 24h, 3d, 1w, 1m, 3m, 6m, 1y, 2y, 3y - pub fn get_v1_mining_blocks_fees_by_time_period( - &self, - time_period: TimePeriod, - ) -> Result> { + /// + /// *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-fees)* + /// + /// Endpoint: `GET /api/v1/mining/blocks/fees/{time_period}` + pub fn get_block_fees(&self, time_period: TimePeriod) -> Result> { self.base .get_json(&format!("/api/v1/mining/blocks/fees/{time_period}")) } @@ -8501,10 +8618,11 @@ impl BrkClient { /// Block rewards /// /// Get average block rewards (coinbase = subsidy + fees) for a time period. Valid periods: 24h, 3d, 1w, 1m, 3m, 6m, 1y, 2y, 3y - pub fn get_v1_mining_blocks_rewards_by_time_period( - &self, - time_period: TimePeriod, - ) -> Result> { + /// + /// *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-rewards)* + /// + /// Endpoint: `GET /api/v1/mining/blocks/rewards/{time_period}` + pub fn get_block_rewards(&self, time_period: TimePeriod) -> Result> { self.base .get_json(&format!("/api/v1/mining/blocks/rewards/{time_period}")) } @@ -8512,10 +8630,11 @@ impl BrkClient { /// Block sizes and weights /// /// Get average block sizes and weights for a time period. Valid periods: 24h, 3d, 1w, 1m, 3m, 6m, 1y, 2y, 3y - pub fn get_v1_mining_blocks_sizes_weights_by_time_period( - &self, - time_period: TimePeriod, - ) -> Result { + /// + /// *[Mempool.space docs](https://mempool.space/docs/api/rest#get-sizes-weights)* + /// + /// Endpoint: `GET /api/v1/mining/blocks/sizes-weights/{time_period}` + pub fn get_block_sizes_weights(&self, time_period: TimePeriod) -> Result { self.base.get_json(&format!( "/api/v1/mining/blocks/sizes-weights/{time_period}" )) @@ -8524,23 +8643,35 @@ impl BrkClient { /// Block by timestamp /// /// Find the block closest to a given UNIX timestamp. - pub fn get_v1_mining_blocks_timestamp(&self, timestamp: Timestamp) -> Result { + /// + /// *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-timestamp)* + /// + /// Endpoint: `GET /api/v1/mining/blocks/timestamp/{timestamp}` + pub fn get_block_by_timestamp(&self, timestamp: Timestamp) -> Result { self.base .get_json(&format!("/api/v1/mining/blocks/timestamp/{timestamp}")) } /// Difficulty adjustments (all time) /// - /// Get historical difficulty adjustments. Returns array of [timestamp, height, difficulty, change_percent]. - pub fn get_v1_mining_difficulty_adjustments(&self) -> Result> { + /// Get historical difficulty adjustments including timestamp, block height, difficulty value, and percentage change. + /// + /// *[Mempool.space docs](https://mempool.space/docs/api/rest#get-difficulty-adjustments)* + /// + /// Endpoint: `GET /api/v1/mining/difficulty-adjustments` + pub fn get_difficulty_adjustments(&self) -> Result> { self.base .get_json(&format!("/api/v1/mining/difficulty-adjustments")) } /// Difficulty adjustments /// - /// Get historical difficulty adjustments for a time period. Valid periods: 24h, 3d, 1w, 1m, 3m, 6m, 1y, 2y, 3y. Returns array of [timestamp, height, difficulty, change_percent]. - pub fn get_v1_mining_difficulty_adjustments_by_time_period( + /// Get historical difficulty adjustments for a time period. Valid periods: 24h, 3d, 1w, 1m, 3m, 6m, 1y, 2y, 3y. + /// + /// *[Mempool.space docs](https://mempool.space/docs/api/rest#get-difficulty-adjustments)* + /// + /// Endpoint: `GET /api/v1/mining/difficulty-adjustments/{time_period}` + pub fn get_difficulty_adjustments_by_period( &self, time_period: TimePeriod, ) -> Result> { @@ -8552,17 +8683,22 @@ impl BrkClient { /// Network hashrate (all time) /// /// Get network hashrate and difficulty data for all time. - pub fn get_v1_mining_hashrate(&self) -> Result { + /// + /// *[Mempool.space docs](https://mempool.space/docs/api/rest#get-hashrate)* + /// + /// Endpoint: `GET /api/v1/mining/hashrate` + pub fn get_hashrate(&self) -> Result { self.base.get_json(&format!("/api/v1/mining/hashrate")) } /// Network hashrate /// /// Get network hashrate and difficulty data for a time period. Valid periods: 24h, 3d, 1w, 1m, 3m, 6m, 1y, 2y, 3y - pub fn get_v1_mining_hashrate_by_time_period( - &self, - time_period: TimePeriod, - ) -> Result { + /// + /// *[Mempool.space docs](https://mempool.space/docs/api/rest#get-hashrate)* + /// + /// Endpoint: `GET /api/v1/mining/hashrate/{time_period}` + pub fn get_hashrate_by_period(&self, time_period: TimePeriod) -> Result { self.base .get_json(&format!("/api/v1/mining/hashrate/{time_period}")) } @@ -8570,24 +8706,33 @@ impl BrkClient { /// Mining pool details /// /// Get detailed information about a specific mining pool including block counts and shares for different time periods. - pub fn get_v1_mining_pool_by_slug(&self, slug: PoolSlug) -> Result { + /// + /// *[Mempool.space docs](https://mempool.space/docs/api/rest#get-mining-pool)* + /// + /// Endpoint: `GET /api/v1/mining/pool/{slug}` + pub fn get_pool(&self, slug: PoolSlug) -> Result { self.base.get_json(&format!("/api/v1/mining/pool/{slug}")) } /// List all mining pools /// /// Get list of all known mining pools with their identifiers. - pub fn get_v1_mining_pools(&self) -> Result> { + /// + /// *[Mempool.space docs](https://mempool.space/docs/api/rest#get-mining-pools)* + /// + /// Endpoint: `GET /api/v1/mining/pools` + pub fn get_pools(&self) -> Result> { self.base.get_json(&format!("/api/v1/mining/pools")) } /// Mining pool statistics /// /// Get mining pool statistics for a time period. Valid periods: 24h, 3d, 1w, 1m, 3m, 6m, 1y, 2y, 3y - pub fn get_v1_mining_pools_by_time_period( - &self, - time_period: TimePeriod, - ) -> Result { + /// + /// *[Mempool.space docs](https://mempool.space/docs/api/rest#get-mining-pools)* + /// + /// Endpoint: `GET /api/v1/mining/pools/{time_period}` + pub fn get_pool_stats(&self, time_period: TimePeriod) -> Result { self.base .get_json(&format!("/api/v1/mining/pools/{time_period}")) } @@ -8595,10 +8740,11 @@ impl BrkClient { /// Mining reward statistics /// /// Get mining reward statistics for the last N blocks including total rewards, fees, and transaction count. - pub fn get_v1_mining_reward_stats_by_block_count( - &self, - block_count: i64, - ) -> Result { + /// + /// *[Mempool.space docs](https://mempool.space/docs/api/rest#get-reward-stats)* + /// + /// Endpoint: `GET /api/v1/mining/reward-stats/{block_count}` + pub fn get_reward_stats(&self, block_count: i64) -> Result { self.base .get_json(&format!("/api/v1/mining/reward-stats/{block_count}")) } @@ -8606,7 +8752,11 @@ impl BrkClient { /// Validate address /// /// Validate a Bitcoin address and get information about its type and scriptPubKey. - pub fn get_v1_validate_address(&self, address: &str) -> Result { + /// + /// *[Mempool.space docs](https://mempool.space/docs/api/rest#get-address-validate)* + /// + /// Endpoint: `GET /api/v1/validate-address/{address}` + pub fn validate_address(&self, address: &str) -> Result { self.base .get_json(&format!("/api/v1/validate-address/{address}")) } @@ -8614,6 +8764,8 @@ impl BrkClient { /// Health check /// /// Returns the health status of the API server + /// + /// Endpoint: `GET /health` pub fn get_health(&self) -> Result { self.base.get_json(&format!("/health")) } @@ -8621,6 +8773,8 @@ impl BrkClient { /// API version /// /// Returns the current version of the API server + /// + /// Endpoint: `GET /version` pub fn get_version(&self) -> Result { self.base.get_json(&format!("/version")) } diff --git a/crates/brk_error/src/lib.rs b/crates/brk_error/src/lib.rs index e73da4316..d685367b7 100644 --- a/crates/brk_error/src/lib.rs +++ b/crates/brk_error/src/lib.rs @@ -124,6 +124,9 @@ pub enum Error { #[error("Fetch failed after retries: {0}")] FetchFailed(String), + #[error("HTTP {status}: {url}")] + HttpStatus { status: u16, url: String }, + #[error("Version mismatch at {path:?}: expected {expected}, found {found}")] VersionMismatch { path: PathBuf, @@ -141,6 +144,8 @@ impl Error { match self { Error::Minreq(e) => is_minreq_error_permanent(e), Error::IO(e) => is_io_error_permanent(e), + // 403 Forbidden suggests IP/geo blocking; 429 and 5xx are transient + Error::HttpStatus { status, .. } => *status == 403, // Other errors are data/parsing related, not network - treat as transient _ => false, } diff --git a/crates/brk_fetcher/src/binance.rs b/crates/brk_fetcher/src/binance.rs index 5f820c0fb..6a7ef63d6 100644 --- a/crates/brk_fetcher/src/binance.rs +++ b/crates/brk_fetcher/src/binance.rs @@ -11,7 +11,7 @@ use serde_json::Value; use tracing::info; use crate::{ - PriceSource, default_retry, + PriceSource, check_response, default_retry, ohlc::{compute_ohlc_from_range, date_from_timestamp, ohlc_from_array, timestamp_from_ms}, }; @@ -73,8 +73,8 @@ impl Binance { default_retry(|_| { let url = Self::url("interval=1m&limit=1000"); info!("Fetching {url} ..."); - let json: Value = - serde_json::from_slice(minreq::get(url).with_timeout(30).send()?.as_bytes())?; + let bytes = check_response(minreq::get(&url).with_timeout(30).send()?, &url)?; + let json: Value = serde_json::from_slice(&bytes)?; Self::parse_ohlc_array(&json) }) } @@ -96,8 +96,8 @@ impl Binance { default_retry(|_| { let url = Self::url("interval=1d"); info!("Fetching {url} ..."); - let json: Value = - serde_json::from_slice(minreq::get(url).with_timeout(30).send()?.as_bytes())?; + let bytes = check_response(minreq::get(&url).with_timeout(30).send()?, &url)?; + let json: Value = serde_json::from_slice(&bytes)?; Self::parse_date_ohlc_array(&json) }) } diff --git a/crates/brk_fetcher/src/brk.rs b/crates/brk_fetcher/src/brk.rs index efd0dd738..88f6437de 100644 --- a/crates/brk_fetcher/src/brk.rs +++ b/crates/brk_fetcher/src/brk.rs @@ -8,7 +8,7 @@ use brk_types::{ use serde_json::Value; use tracing::info; -use crate::{PriceSource, default_retry}; +use crate::{PriceSource, check_response, default_retry}; #[derive(Default, Clone)] #[allow(clippy::upper_case_acronyms)] @@ -49,8 +49,8 @@ impl BRK { ); info!("Fetching {url} ..."); - let body: Value = - serde_json::from_slice(minreq::get(url).with_timeout(30).send()?.as_bytes())?; + let bytes = check_response(minreq::get(&url).with_timeout(30).send()?, &url)?; + let body: Value = serde_json::from_slice(&bytes)?; body.as_array() .ok_or(Error::Parse("Expected JSON array".into()))? @@ -90,8 +90,8 @@ impl BRK { ); info!("Fetching {url}..."); - let body: Value = - serde_json::from_slice(minreq::get(url).with_timeout(30).send()?.as_bytes())?; + let bytes = check_response(minreq::get(&url).with_timeout(30).send()?, &url)?; + let body: Value = serde_json::from_slice(&bytes)?; body.as_array() .ok_or(Error::Parse("Expected JSON array".into()))? diff --git a/crates/brk_fetcher/src/kraken.rs b/crates/brk_fetcher/src/kraken.rs index 15e13ad55..ee20f8920 100644 --- a/crates/brk_fetcher/src/kraken.rs +++ b/crates/brk_fetcher/src/kraken.rs @@ -6,7 +6,7 @@ use serde_json::Value; use tracing::info; use crate::{ - PriceSource, default_retry, + PriceSource, check_response, default_retry, ohlc::{compute_ohlc_from_range, date_from_timestamp, ohlc_from_array, timestamp_from_secs}, }; @@ -39,8 +39,8 @@ impl Kraken { default_retry(|_| { let url = Self::url(1); info!("Fetching {url} ..."); - let json: Value = - serde_json::from_slice(minreq::get(url).with_timeout(30).send()?.as_bytes())?; + let bytes = check_response(minreq::get(&url).with_timeout(30).send()?, &url)?; + let json: Value = serde_json::from_slice(&bytes)?; Self::parse_ohlc_response(&json) }) } @@ -61,8 +61,8 @@ impl Kraken { default_retry(|_| { let url = Self::url(1440); info!("Fetching {url} ..."); - let json: Value = - serde_json::from_slice(minreq::get(url).with_timeout(30).send()?.as_bytes())?; + let bytes = check_response(minreq::get(&url).with_timeout(30).send()?, &url)?; + let json: Value = serde_json::from_slice(&bytes)?; Self::parse_date_ohlc_response(&json) }) } diff --git a/crates/brk_fetcher/src/lib.rs b/crates/brk_fetcher/src/lib.rs index c22190b56..a85e62b09 100644 --- a/crates/brk_fetcher/src/lib.rs +++ b/crates/brk_fetcher/src/lib.rs @@ -22,6 +22,19 @@ pub use source::{PriceSource, TrackedSource}; const MAX_RETRIES: usize = 12 * 60; // 12 hours of retrying +/// Check HTTP response status and return bytes or error +pub fn check_response(response: minreq::Response, url: &str) -> Result> { + let status = response.status_code as u16; + if (200..300).contains(&status) { + Ok(response.into_bytes()) + } else { + Err(Error::HttpStatus { + status, + url: url.to_string(), + }) + } +} + #[derive(Clone)] pub struct Fetcher { pub binance: Option>, diff --git a/crates/brk_fetcher/src/source.rs b/crates/brk_fetcher/src/source.rs index 042fef8c4..0d4c8f8ea 100644 --- a/crates/brk_fetcher/src/source.rs +++ b/crates/brk_fetcher/src/source.rs @@ -98,8 +98,8 @@ impl TrackedSource { self.name(), self.cooldown.as_secs() ); - self.unhealthy_since = Some(Instant::now()); } + self.unhealthy_since = Some(Instant::now()); } Err(_) => {} // Transient - no change } @@ -137,5 +137,6 @@ impl PriceSource for TrackedSource { fn clear(&mut self) { self.source.clear(); + self.reset_health(); } } diff --git a/crates/brk_server/src/api/addresses/mod.rs b/crates/brk_server/src/api/addresses/mod.rs index 04e886026..2421b7567 100644 --- a/crates/brk_server/src/api/addresses/mod.rs +++ b/crates/brk_server/src/api/addresses/mod.rs @@ -32,9 +32,10 @@ impl AddressRoutes for ApiRouter { | { state.cached_json(&headers, CacheStrategy::Height, move |q| q.address(path.address)).await }, |op| op + .id("get_address") .addresses_tag() .summary("Address information") - .description("Retrieve comprehensive information about a Bitcoin address including balance, transaction history, UTXOs, and estimated investment metrics. Supports all standard Bitcoin address types (P2PKH, P2SH, P2WPKH, P2WSH, P2TR, etc.).") + .description("Retrieve address information including balance and transaction counts. Supports all standard Bitcoin address types (P2PKH, P2SH, P2WPKH, P2WSH, P2TR).\n\n*[Mempool.space docs](https://mempool.space/docs/api/rest#get-address)*") .ok_response::() .not_modified() .bad_request() @@ -52,9 +53,10 @@ impl AddressRoutes for ApiRouter { | { state.cached_json(&headers, CacheStrategy::Height, move |q| q.address_txids(path.address, params.after_txid, params.limit)).await }, |op| op + .id("get_address_txs") .addresses_tag() .summary("Address transaction IDs") - .description("Get transaction IDs for an address, newest first. Use after_txid for pagination.") + .description("Get transaction IDs for an address, newest first. Use after_txid for pagination.\n\n*[Mempool.space docs](https://mempool.space/docs/api/rest#get-address-transactions)*") .ok_response::>() .not_modified() .bad_request() @@ -71,9 +73,10 @@ impl AddressRoutes for ApiRouter { | { state.cached_json(&headers, CacheStrategy::Height, move |q| q.address_utxos(path.address)).await }, |op| op + .id("get_address_utxos") .addresses_tag() .summary("Address UTXOs") - .description("Get unspent transaction outputs for an address.") + .description("Get unspent transaction outputs (UTXOs) for an address. Returns txid, vout, value, and confirmation status for each UTXO.\n\n*[Mempool.space docs](https://mempool.space/docs/api/rest#get-address-utxo)*") .ok_response::>() .not_modified() .bad_request() @@ -91,9 +94,10 @@ impl AddressRoutes for ApiRouter { // Mempool txs for an address - use MaxAge since it's volatile state.cached_json(&headers, CacheStrategy::MaxAge(5), move |q| q.address_mempool_txids(path.address)).await }, |op| op + .id("get_address_mempool_txs") .addresses_tag() .summary("Address mempool transactions") - .description("Get unconfirmed transaction IDs for an address from the mempool (up to 50).") + .description("Get unconfirmed transaction IDs for an address from the mempool (up to 50).\n\n*[Mempool.space docs](https://mempool.space/docs/api/rest#get-address-transactions-mempool)*") .ok_response::>() .bad_request() .not_found() @@ -110,9 +114,10 @@ impl AddressRoutes for ApiRouter { | { state.cached_json(&headers, CacheStrategy::Height, move |q| q.address_txids(path.address, params.after_txid, 25)).await }, |op| op + .id("get_address_confirmed_txs") .addresses_tag() .summary("Address confirmed transactions") - .description("Get confirmed transaction IDs for an address, 25 per page. Use ?after_txid= for pagination.") + .description("Get confirmed transaction IDs for an address, 25 per page. Use ?after_txid= for pagination.\n\n*[Mempool.space docs](https://mempool.space/docs/api/rest#get-address-transactions-chain)*") .ok_response::>() .not_modified() .bad_request() @@ -129,9 +134,10 @@ impl AddressRoutes for ApiRouter { | { state.cached_json(&headers, CacheStrategy::Static, move |_q| Ok(AddressValidation::from_address(&path.address))).await }, |op| op + .id("validate_address") .addresses_tag() .summary("Validate address") - .description("Validate a Bitcoin address and get information about its type and scriptPubKey.") + .description("Validate a Bitcoin address and get information about its type and scriptPubKey.\n\n*[Mempool.space docs](https://mempool.space/docs/api/rest#get-address-validate)*") .ok_response::() .not_modified() ), diff --git a/crates/brk_server/src/api/blocks/mod.rs b/crates/brk_server/src/api/blocks/mod.rs index b95fd0446..14a004977 100644 --- a/crates/brk_server/src/api/blocks/mod.rs +++ b/crates/brk_server/src/api/blocks/mod.rs @@ -28,9 +28,10 @@ impl BlockRoutes for ApiRouter { .await }, |op| { - op.blocks_tag() + op.id("get_blocks") + .blocks_tag() .summary("Recent blocks") - .description("Retrieve the last 10 blocks. Returns block metadata for each block.") + .description("Retrieve the last 10 blocks. Returns block metadata for each block.\n\n*[Mempool.space docs](https://mempool.space/docs/api/rest#get-blocks)*") .ok_response::>() .not_modified() .server_error() @@ -46,10 +47,11 @@ impl BlockRoutes for ApiRouter { state.cached_json(&headers, CacheStrategy::Height, move |q| q.block(&path.hash)).await }, |op| { - op.blocks_tag() + op.id("get_block") + .blocks_tag() .summary("Block information") .description( - "Retrieve block information by block hash. Returns block metadata including height, timestamp, difficulty, size, weight, and transaction count.", + "Retrieve block information by block hash. Returns block metadata including height, timestamp, difficulty, size, weight, and transaction count.\n\n*[Mempool.space docs](https://mempool.space/docs/api/rest#get-block)*", ) .ok_response::() .not_modified() @@ -68,10 +70,11 @@ impl BlockRoutes for ApiRouter { state.cached_json(&headers, CacheStrategy::Height, move |q| q.block_status(&path.hash)).await }, |op| { - op.blocks_tag() + op.id("get_block_status") + .blocks_tag() .summary("Block status") .description( - "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.", + "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.\n\n*[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-status)*", ) .ok_response::() .not_modified() @@ -90,10 +93,11 @@ impl BlockRoutes for ApiRouter { state.cached_json(&headers, CacheStrategy::Height, move |q| q.block_by_height(path.height)).await }, |op| { - op.blocks_tag() + op.id("get_block_by_height") + .blocks_tag() .summary("Block by height") .description( - "Retrieve block information by block height. Returns block metadata including hash, timestamp, difficulty, size, weight, and transaction count.", + "Retrieve block information by block height. Returns block metadata including hash, timestamp, difficulty, size, weight, and transaction count.\n\n*[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-height)*", ) .ok_response::() .not_modified() @@ -112,10 +116,11 @@ impl BlockRoutes for ApiRouter { state.cached_json(&headers, CacheStrategy::Height, move |q| q.blocks(Some(path.height))).await }, |op| { - op.blocks_tag() + op.id("get_blocks_from_height") + .blocks_tag() .summary("Blocks from height") .description( - "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.", + "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.\n\n*[Mempool.space docs](https://mempool.space/docs/api/rest#get-blocks)*", ) .ok_response::>() .not_modified() @@ -133,10 +138,11 @@ impl BlockRoutes for ApiRouter { state.cached_json(&headers, CacheStrategy::Height, move |q| q.block_txids(&path.hash)).await }, |op| { - op.blocks_tag() + op.id("get_block_txids") + .blocks_tag() .summary("Block transaction IDs") .description( - "Retrieve all transaction IDs in a block by block hash.", + "Retrieve all transaction IDs in a block. Returns an array of txids in block order.\n\n*[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-transaction-ids)*", ) .ok_response::>() .not_modified() @@ -155,10 +161,11 @@ impl BlockRoutes for ApiRouter { state.cached_json(&headers, CacheStrategy::Height, move |q| q.block_txs(&path.hash, path.start_index)).await }, |op| { - op.blocks_tag() + op.id("get_block_txs") + .blocks_tag() .summary("Block transactions (paginated)") .description(&format!( - "Retrieve transactions in a block by block hash, starting from the specified index. Returns up to {} transactions at a time.", + "Retrieve transactions in a block by block hash, starting from the specified index. Returns up to {} transactions at a time.\n\n*[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-transactions)*", BLOCK_TXS_PAGE_SIZE )) .ok_response::>() @@ -178,10 +185,11 @@ impl BlockRoutes for ApiRouter { state.cached_text(&headers, CacheStrategy::Height, move |q| q.block_txid_at_index(&path.hash, path.index).map(|t| t.to_string())).await }, |op| { - op.blocks_tag() + op.id("get_block_txid") + .blocks_tag() .summary("Transaction ID at index") .description( - "Retrieve a single transaction ID at a specific index within a block. Returns plain text txid.", + "Retrieve a single transaction ID at a specific index within a block. Returns plain text txid.\n\n*[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-transaction-id)*", ) .ok_response::() .not_modified() @@ -200,9 +208,10 @@ impl BlockRoutes for ApiRouter { state.cached_json(&headers, CacheStrategy::Height, move |q| q.block_by_timestamp(path.timestamp)).await }, |op| { - op.blocks_tag() + op.id("get_block_by_timestamp") + .blocks_tag() .summary("Block by timestamp") - .description("Find the block closest to a given UNIX timestamp.") + .description("Find the block closest to a given UNIX timestamp.\n\n*[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-timestamp)*") .ok_response::() .not_modified() .bad_request() @@ -220,10 +229,11 @@ impl BlockRoutes for ApiRouter { state.cached_bytes(&headers, CacheStrategy::Height, move |q| q.block_raw(&path.hash)).await }, |op| { - op.blocks_tag() + op.id("get_block_raw") + .blocks_tag() .summary("Raw block") .description( - "Returns the raw block data in binary format.", + "Returns the raw block data in binary format.\n\n*[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-raw)*", ) .ok_response::>() .not_modified() diff --git a/crates/brk_server/src/api/mempool/mod.rs b/crates/brk_server/src/api/mempool/mod.rs index 0d0a5c001..d02b1fe7f 100644 --- a/crates/brk_server/src/api/mempool/mod.rs +++ b/crates/brk_server/src/api/mempool/mod.rs @@ -26,9 +26,10 @@ impl MempoolRoutes for ApiRouter { state.cached_json(&headers, CacheStrategy::MaxAge(5), |q| q.mempool_info()).await }, |op| { - op.mempool_tag() + op.id("get_mempool") + .mempool_tag() .summary("Mempool statistics") - .description("Get current mempool statistics including transaction count, total vsize, and total fees.") + .description("Get current mempool statistics including transaction count, total vsize, and total fees.\n\n*[Mempool.space docs](https://mempool.space/docs/api/rest#get-mempool)*") .ok_response::() .server_error() }, @@ -41,9 +42,10 @@ impl MempoolRoutes for ApiRouter { state.cached_json(&headers, CacheStrategy::MaxAge(5), |q| q.mempool_txids()).await }, |op| { - op.mempool_tag() + op.id("get_mempool_txids") + .mempool_tag() .summary("Mempool transaction IDs") - .description("Get all transaction IDs currently in the mempool.") + .description("Get all transaction IDs currently in the mempool.\n\n*[Mempool.space docs](https://mempool.space/docs/api/rest#get-mempool-transaction-ids)*") .ok_response::>() .server_error() }, @@ -56,9 +58,10 @@ impl MempoolRoutes for ApiRouter { state.cached_json(&headers, CacheStrategy::MaxAge(3), |q| q.recommended_fees()).await }, |op| { - op.mempool_tag() + op.id("get_recommended_fees") + .mempool_tag() .summary("Recommended fees") - .description("Get recommended fee rates for different confirmation targets based on current mempool state.") + .description("Get recommended fee rates for different confirmation targets based on current mempool state.\n\n*[Mempool.space docs](https://mempool.space/docs/api/rest#get-recommended-fees)*") .ok_response::() .server_error() }, @@ -71,9 +74,10 @@ impl MempoolRoutes for ApiRouter { state.cached_json(&headers, CacheStrategy::MaxAge(5), |q| q.mempool_blocks()).await }, |op| { - op.mempool_tag() + op.id("get_mempool_blocks") + .mempool_tag() .summary("Projected mempool blocks") - .description("Get projected blocks from the mempool for fee estimation. Each block contains statistics about transactions that would be included if a block were mined now.") + .description("Get projected blocks from the mempool for fee estimation. Each block contains statistics about transactions that would be included if a block were mined now.\n\n*[Mempool.space docs](https://mempool.space/docs/api/rest#get-mempool-blocks-fees)*") .ok_response::>() .server_error() }, diff --git a/crates/brk_server/src/api/metrics/mod.rs b/crates/brk_server/src/api/metrics/mod.rs index 765bd6e35..126d94707 100644 --- a/crates/brk_server/src/api/metrics/mod.rs +++ b/crates/brk_server/src/api/metrics/mod.rs @@ -37,10 +37,12 @@ impl ApiMetricsRoutes for ApiRouter { state.cached_json(&headers, CacheStrategy::Static, |q| Ok(q.metrics_catalog().clone())).await }, |op| op + .id("get_metrics_tree") .metrics_tag() .summary("Metrics catalog") .description( - "Returns the complete hierarchical catalog of available metrics organized as a tree structure. Metrics are grouped by categories and subcategories. Best viewed in an interactive JSON viewer (e.g., Firefox's built-in JSON viewer) for easy navigation of the nested structure." + "Returns the complete hierarchical catalog of available metrics organized as a tree structure. \ + Metrics are grouped by categories and subcategories." ) .ok_response::() .not_modified(), @@ -56,9 +58,10 @@ impl ApiMetricsRoutes for ApiRouter { state.cached_json(&headers, CacheStrategy::Static, |q| Ok(q.metric_count())).await }, |op| op + .id("get_metrics_count") .metrics_tag() .summary("Metric count") - .description("Current metric count") + .description("Returns the number of metrics available per index type.") .ok_response::>() .not_modified(), ), @@ -73,6 +76,7 @@ impl ApiMetricsRoutes for ApiRouter { state.cached_json(&headers, CacheStrategy::Static, |q| Ok(q.indexes().to_vec())).await }, |op| op + .id("get_indexes") .metrics_tag() .summary("List available indexes") .description( @@ -93,9 +97,10 @@ impl ApiMetricsRoutes for ApiRouter { state.cached_json(&headers, CacheStrategy::Static, move |q| Ok(q.metrics(pagination))).await }, |op| op + .id("list_metrics") .metrics_tag() .summary("Metrics list") - .description("Paginated list of available metrics") + .description("Paginated flat list of all available metric names. Use `page` query param for pagination.") .ok_response::() .not_modified(), ), @@ -112,6 +117,7 @@ impl ApiMetricsRoutes for ApiRouter { state.cached_json(&headers, CacheStrategy::Static, move |q| Ok(q.match_metric(&path.metric, query.limit))).await }, |op| op + .id("search_metrics") .metrics_tag() .summary("Search metrics") .description("Fuzzy search for metrics by name. Supports partial matches and typos.") @@ -136,10 +142,11 @@ impl ApiMetricsRoutes for ApiRouter { }).await }, |op| op + .id("get_metric_info") .metrics_tag() .summary("Get supported indexes for a metric") .description( - "Returns the list of indexes are supported by the specified metric. \ + "Returns the list of indexes supported by the specified metric. \ For example, `realized_price` might be available on dateindex, weekindex, and monthindex." ) .ok_response::>() @@ -166,6 +173,7 @@ impl ApiMetricsRoutes for ApiRouter { .await }, |op| op + .id("get_metric") .metrics_tag() .summary("Get metric data") .description( @@ -183,11 +191,12 @@ impl ApiMetricsRoutes for ApiRouter { get_with( bulk::handler, |op| op + .id("get_metrics") .metrics_tag() .summary("Bulk metric data") .description( "Fetch multiple metrics in a single request. Supports filtering by index and date range. \ - Returns an array of MetricData objects." + Returns an array of MetricData objects. For a single metric, use `get_metric` instead." ) .ok_response::>() .csv_response() diff --git a/crates/brk_server/src/api/mining/mod.rs b/crates/brk_server/src/api/mining/mod.rs index 6cceef6a6..b9d02b6ab 100644 --- a/crates/brk_server/src/api/mining/mod.rs +++ b/crates/brk_server/src/api/mining/mod.rs @@ -32,9 +32,10 @@ impl MiningRoutes for ApiRouter { state.cached_json(&headers, CacheStrategy::Height, |q| q.difficulty_adjustment()).await }, |op| { - op.mining_tag() + op.id("get_difficulty_adjustment") + .mining_tag() .summary("Difficulty adjustment") - .description("Get current difficulty adjustment information including progress through the current epoch, estimated retarget date, and difficulty change prediction.") + .description("Get current difficulty adjustment information including progress through the current epoch, estimated retarget date, and difficulty change prediction.\n\n*[Mempool.space docs](https://mempool.space/docs/api/rest#get-difficulty-adjustment)*") .ok_response::() .not_modified() .server_error() @@ -49,9 +50,10 @@ impl MiningRoutes for ApiRouter { state.cached_json(&headers, CacheStrategy::Static, |q| Ok(q.all_pools())).await }, |op| { - op.mining_tag() + op.id("get_pools") + .mining_tag() .summary("List all mining pools") - .description("Get list of all known mining pools with their identifiers.") + .description("Get list of all known mining pools with their identifiers.\n\n*[Mempool.space docs](https://mempool.space/docs/api/rest#get-mining-pools)*") .ok_response::>() .not_modified() .server_error() @@ -65,9 +67,10 @@ impl MiningRoutes for ApiRouter { state.cached_json(&headers, CacheStrategy::height_with(format!("{:?}", path.time_period)), move |q| q.mining_pools(path.time_period)).await }, |op| { - op.mining_tag() + op.id("get_pool_stats") + .mining_tag() .summary("Mining pool statistics") - .description("Get mining pool statistics for a time period. Valid periods: 24h, 3d, 1w, 1m, 3m, 6m, 1y, 2y, 3y") + .description("Get mining pool statistics for a time period. Valid periods: 24h, 3d, 1w, 1m, 3m, 6m, 1y, 2y, 3y\n\n*[Mempool.space docs](https://mempool.space/docs/api/rest#get-mining-pools)*") .ok_response::() .not_modified() .server_error() @@ -81,9 +84,10 @@ impl MiningRoutes for ApiRouter { state.cached_json(&headers, CacheStrategy::height_with(path.slug), move |q| q.pool_detail(path.slug)).await }, |op| { - op.mining_tag() + op.id("get_pool") + .mining_tag() .summary("Mining pool details") - .description("Get detailed information about a specific mining pool including block counts and shares for different time periods.") + .description("Get detailed information about a specific mining pool including block counts and shares for different time periods.\n\n*[Mempool.space docs](https://mempool.space/docs/api/rest#get-mining-pool)*") .ok_response::() .not_modified() .not_found() @@ -98,9 +102,10 @@ impl MiningRoutes for ApiRouter { state.cached_json(&headers, CacheStrategy::height_with("hashrate"), |q| q.hashrate(None)).await }, |op| { - op.mining_tag() + op.id("get_hashrate") + .mining_tag() .summary("Network hashrate (all time)") - .description("Get network hashrate and difficulty data for all time.") + .description("Get network hashrate and difficulty data for all time.\n\n*[Mempool.space docs](https://mempool.space/docs/api/rest#get-hashrate)*") .ok_response::() .not_modified() .server_error() @@ -114,9 +119,10 @@ impl MiningRoutes for ApiRouter { state.cached_json(&headers, CacheStrategy::height_with(format!("hashrate-{:?}", path.time_period)), move |q| q.hashrate(Some(path.time_period))).await }, |op| { - op.mining_tag() + op.id("get_hashrate_by_period") + .mining_tag() .summary("Network hashrate") - .description("Get network hashrate and difficulty data for a time period. Valid periods: 24h, 3d, 1w, 1m, 3m, 6m, 1y, 2y, 3y") + .description("Get network hashrate and difficulty data for a time period. Valid periods: 24h, 3d, 1w, 1m, 3m, 6m, 1y, 2y, 3y\n\n*[Mempool.space docs](https://mempool.space/docs/api/rest#get-hashrate)*") .ok_response::() .not_modified() .server_error() @@ -130,9 +136,10 @@ impl MiningRoutes for ApiRouter { state.cached_json(&headers, CacheStrategy::height_with("diff-adj"), |q| q.difficulty_adjustments(None)).await }, |op| { - op.mining_tag() + op.id("get_difficulty_adjustments") + .mining_tag() .summary("Difficulty adjustments (all time)") - .description("Get historical difficulty adjustments. Returns array of [timestamp, height, difficulty, change_percent].") + .description("Get historical difficulty adjustments including timestamp, block height, difficulty value, and percentage change.\n\n*[Mempool.space docs](https://mempool.space/docs/api/rest#get-difficulty-adjustments)*") .ok_response::>() .not_modified() .server_error() @@ -146,9 +153,10 @@ impl MiningRoutes for ApiRouter { state.cached_json(&headers, CacheStrategy::height_with(format!("diff-adj-{:?}", path.time_period)), move |q| q.difficulty_adjustments(Some(path.time_period))).await }, |op| { - op.mining_tag() + op.id("get_difficulty_adjustments_by_period") + .mining_tag() .summary("Difficulty adjustments") - .description("Get historical difficulty adjustments for a time period. Valid periods: 24h, 3d, 1w, 1m, 3m, 6m, 1y, 2y, 3y. Returns array of [timestamp, height, difficulty, change_percent].") + .description("Get historical difficulty adjustments for a time period. Valid periods: 24h, 3d, 1w, 1m, 3m, 6m, 1y, 2y, 3y.\n\n*[Mempool.space docs](https://mempool.space/docs/api/rest#get-difficulty-adjustments)*") .ok_response::>() .not_modified() .server_error() @@ -162,9 +170,10 @@ impl MiningRoutes for ApiRouter { state.cached_json(&headers, CacheStrategy::height_with(format!("fees-{:?}", path.time_period)), move |q| q.block_fees(path.time_period)).await }, |op| { - op.mining_tag() + op.id("get_block_fees") + .mining_tag() .summary("Block fees") - .description("Get average block fees for a time period. Valid periods: 24h, 3d, 1w, 1m, 3m, 6m, 1y, 2y, 3y") + .description("Get average block fees for a time period. Valid periods: 24h, 3d, 1w, 1m, 3m, 6m, 1y, 2y, 3y\n\n*[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-fees)*") .ok_response::>() .not_modified() .server_error() @@ -178,32 +187,34 @@ impl MiningRoutes for ApiRouter { state.cached_json(&headers, CacheStrategy::height_with(format!("rewards-{:?}", path.time_period)), move |q| q.block_rewards(path.time_period)).await }, |op| { - op.mining_tag() + op.id("get_block_rewards") + .mining_tag() .summary("Block rewards") - .description("Get average block rewards (coinbase = subsidy + fees) for a time period. Valid periods: 24h, 3d, 1w, 1m, 3m, 6m, 1y, 2y, 3y") + .description("Get average block rewards (coinbase = subsidy + fees) for a time period. Valid periods: 24h, 3d, 1w, 1m, 3m, 6m, 1y, 2y, 3y\n\n*[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-rewards)*") .ok_response::>() .not_modified() .server_error() }, ), ) - // TODO: Disabled - dateindex doesn't have percentile fields (see block_fee_rates.rs) - // .api_route( - // "/api/v1/mining/blocks/fee-rates/{time_period}", - // get_with( - // async |headers: HeaderMap, Path(path): Path, State(state): State| { - // state.cached_json(&headers, CacheStrategy::height_with(format!("feerates-{:?}", path.time_period)), move |q| q.block_fee_rates(path.time_period)).await - // }, - // |op| { - // op.mining_tag() - // .summary("Block fee rates") - // .description("Get block fee rate percentiles (min, 10th, 25th, median, 75th, 90th, max) for a time period. Valid periods: 24h, 3d, 1w, 1m, 3m, 6m, 1y, 2y, 3y") - // .ok_response::>() - // .not_modified() - // .server_error() - // }, - // ), - // ) + .api_route( + "/api/v1/mining/blocks/fee-rates/{time_period}", + get_with( + async |Path(_path): Path| { + axum::Json(serde_json::json!({ + "status": "wip", + "message": "This endpoint is work in progress. Percentile fields are not yet available." + })) + }, + |op| { + op.id("get_block_fee_rates") + .mining_tag() + .summary("Block fee rates (WIP)") + .description("**Work in progress.** Get block fee rate percentiles (min, 10th, 25th, median, 75th, 90th, max) for a time period. Valid periods: 24h, 3d, 1w, 1m, 3m, 6m, 1y, 2y, 3y\n\n*[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-feerates)*") + .ok_response::() + }, + ), + ) .api_route( "/api/v1/mining/blocks/sizes-weights/{time_period}", get_with( @@ -211,9 +222,10 @@ impl MiningRoutes for ApiRouter { state.cached_json(&headers, CacheStrategy::height_with(format!("sizes-{:?}", path.time_period)), move |q| q.block_sizes_weights(path.time_period)).await }, |op| { - op.mining_tag() + op.id("get_block_sizes_weights") + .mining_tag() .summary("Block sizes and weights") - .description("Get average block sizes and weights for a time period. Valid periods: 24h, 3d, 1w, 1m, 3m, 6m, 1y, 2y, 3y") + .description("Get average block sizes and weights for a time period. Valid periods: 24h, 3d, 1w, 1m, 3m, 6m, 1y, 2y, 3y\n\n*[Mempool.space docs](https://mempool.space/docs/api/rest#get-sizes-weights)*") .ok_response::() .not_modified() .server_error() @@ -227,9 +239,10 @@ impl MiningRoutes for ApiRouter { state.cached_json(&headers, CacheStrategy::height_with(format!("reward-stats-{}", path.block_count)), move |q| q.reward_stats(path.block_count)).await }, |op| { - op.mining_tag() + op.id("get_reward_stats") + .mining_tag() .summary("Mining reward statistics") - .description("Get mining reward statistics for the last N blocks including total rewards, fees, and transaction count.") + .description("Get mining reward statistics for the last N blocks including total rewards, fees, and transaction count.\n\n*[Mempool.space docs](https://mempool.space/docs/api/rest#get-reward-stats)*") .ok_response::() .not_modified() .server_error() diff --git a/crates/brk_server/src/api/mod.rs b/crates/brk_server/src/api/mod.rs index e9021f795..a109bc2ef 100644 --- a/crates/brk_server/src/api/mod.rs +++ b/crates/brk_server/src/api/mod.rs @@ -58,7 +58,8 @@ impl ApiRoutes for ApiRouter { .await }, |op| { - op.server_tag() + op.id("get_version") + .server_tag() .summary("API version") .description("Returns the current version of the API server") .ok_response::() @@ -77,7 +78,8 @@ impl ApiRoutes for ApiRouter { }) }, |op| { - op.server_tag() + op.id("get_health") + .server_tag() .summary("Health check") .description("Returns the health status of the API server") .ok_response::() diff --git a/crates/brk_server/src/api/openapi.rs b/crates/brk_server/src/api/openapi.rs index 754fbe5c7..7718990f3 100644 --- a/crates/brk_server/src/api/openapi.rs +++ b/crates/brk_server/src/api/openapi.rs @@ -1,4 +1,4 @@ -use aide::openapi::{Info, OpenApi, Tag}; +use aide::openapi::{Contact, Info, License, OpenApi, Tag}; // // https://docs.rs/schemars/latest/schemars/derive.JsonSchema.html @@ -18,10 +18,40 @@ pub fn create_openapi() -> OpenApi { let info = Info { title: "Bitcoin Research Kit".to_string(), description: Some( - "API for querying Bitcoin blockchain data including addresses, transactions, and chain statistics. This API provides low-level access to indexed blockchain data with advanced analytics capabilities." + r#"API for querying Bitcoin blockchain data and on-chain metrics. + +### Features + +- **Metrics**: Thousands of time-series metrics across multiple indexes (date, block height, etc.) +- **[Mempool.space](https://mempool.space/docs/api/rest) compatible** (WIP): Most non-metrics endpoints follow the mempool.space API format +- **Multiple formats**: JSON and CSV output + +### Client Libraries + +- [JavaScript/TypeScript](https://www.npmjs.com/package/brk-client) +- [Python](https://pypi.org/project/brk-client/) +- [Rust](https://crates.io/crates/brk_client) + +### Links + +- [GitHub](https://github.com/bitcoinresearchkit/brk) +- [Bitview](https://bitview.space) - Web app built on this API"# .to_string(), ), version: format!("v{VERSION}"), + contact: Some(Contact { + name: Some("Bitcoin Research Kit".to_string()), + url: Some("https://github.com/bitcoinresearchkit/brk".to_string()), + email: Some("hello@bitcoinresearchkit.org".to_string()), + ..Contact::default() + }), + license: Some(License { + name: "MIT".to_string(), + url: Some( + "https://github.com/bitcoinresearchkit/brk/blob/main/docs/LICENSE.md".to_string(), + ), + ..License::default() + }), ..Info::default() }; @@ -29,8 +59,8 @@ pub fn create_openapi() -> OpenApi { Tag { name: "Metrics".to_string(), description: Some( - "Access Bitcoin network metrics and time-series data. Query historical statistics \ - across various indexes with JSON or CSV output." + "Access thousands of Bitcoin network metrics and time-series data. Query historical statistics \ + across various indexes (date, week, month, block height) with JSON or CSV output." .to_string(), ), ..Default::default() @@ -39,7 +69,8 @@ pub fn create_openapi() -> OpenApi { name: "Blocks".to_string(), description: Some( "Retrieve block data by hash or height. Access block headers, transaction lists, \ - and raw block bytes." + and raw block bytes.\n\n\ + *[Mempool.space](https://mempool.space/docs/api/rest) compatible (WIP).*" .to_string(), ), ..Default::default() @@ -48,7 +79,8 @@ pub fn create_openapi() -> OpenApi { name: "Transactions".to_string(), description: Some( "Retrieve transaction data by txid. Access full transaction details, confirmation \ - status, raw hex, and output spend information." + status, raw hex, and output spend information.\n\n\ + *[Mempool.space](https://mempool.space/docs/api/rest) compatible (WIP).*" .to_string(), ), ..Default::default() @@ -57,7 +89,8 @@ pub fn create_openapi() -> OpenApi { name: "Addresses".to_string(), description: Some( "Query Bitcoin address data including balances, transaction history, and UTXOs. \ - Supports all address types: P2PKH, P2SH, P2WPKH, P2WSH, and P2TR." + Supports all address types: P2PKH, P2SH, P2WPKH, P2WSH, and P2TR.\n\n\ + *[Mempool.space](https://mempool.space/docs/api/rest) compatible (WIP).*" .to_string(), ), ..Default::default() @@ -66,7 +99,8 @@ pub fn create_openapi() -> OpenApi { name: "Mempool".to_string(), description: Some( "Monitor unconfirmed transactions and fee estimates. Get mempool statistics, \ - transaction IDs, and recommended fee rates for different confirmation targets." + transaction IDs, and recommended fee rates for different confirmation targets.\n\n\ + *[Mempool.space](https://mempool.space/docs/api/rest) compatible (WIP).*" .to_string(), ), ..Default::default() @@ -75,7 +109,8 @@ pub fn create_openapi() -> OpenApi { name: "Mining".to_string(), description: Some( "Mining statistics including pool distribution, hashrate, difficulty adjustments, \ - block rewards, and fee rates across configurable time periods." + block rewards, and fee rates across configurable time periods.\n\n\ + *[Mempool.space](https://mempool.space/docs/api/rest) compatible (WIP).*" .to_string(), ), ..Default::default() diff --git a/crates/brk_server/src/api/transactions/mod.rs b/crates/brk_server/src/api/transactions/mod.rs index b03195f23..f6e2c44fa 100644 --- a/crates/brk_server/src/api/transactions/mod.rs +++ b/crates/brk_server/src/api/transactions/mod.rs @@ -31,10 +31,11 @@ impl TxRoutes for ApiRouter { state.cached_json(&headers, CacheStrategy::Height, move |q| q.transaction(txid)).await }, |op| op + .id("get_tx") .transactions_tag() .summary("Transaction information") .description( - "Retrieve complete transaction data by transaction ID (txid). Returns the full transaction details including inputs, outputs, and metadata. The transaction data is read directly from the blockchain data files.", + "Retrieve complete transaction data by transaction ID (txid). Returns inputs, outputs, fee, size, and confirmation status.\n\n*[Mempool.space docs](https://mempool.space/docs/api/rest#get-transaction)*", ) .ok_response::() .not_modified() @@ -54,10 +55,11 @@ impl TxRoutes for ApiRouter { state.cached_json(&headers, CacheStrategy::Height, move |q| q.transaction_status(txid)).await }, |op| op + .id("get_tx_status") .transactions_tag() .summary("Transaction status") .description( - "Retrieve the confirmation status of a transaction. Returns whether the transaction is confirmed and, if so, the block height, hash, and timestamp.", + "Retrieve the confirmation status of a transaction. Returns whether the transaction is confirmed and, if so, the block height, hash, and timestamp.\n\n*[Mempool.space docs](https://mempool.space/docs/api/rest#get-transaction-status)*", ) .ok_response::() .not_modified() @@ -77,10 +79,11 @@ impl TxRoutes for ApiRouter { state.cached_text(&headers, CacheStrategy::Height, move |q| q.transaction_hex(txid)).await }, |op| op + .id("get_tx_hex") .transactions_tag() .summary("Transaction hex") .description( - "Retrieve the raw transaction as a hex-encoded string. Returns the serialized transaction in hexadecimal format.", + "Retrieve the raw transaction as a hex-encoded string. Returns the serialized transaction in hexadecimal format.\n\n*[Mempool.space docs](https://mempool.space/docs/api/rest#get-transaction-hex)*", ) .ok_response::() .not_modified() @@ -101,10 +104,11 @@ impl TxRoutes for ApiRouter { state.cached_json(&headers, CacheStrategy::Height, move |q| q.outspend(txid, path.vout)).await }, |op| op + .id("get_tx_outspend") .transactions_tag() .summary("Output spend status") .description( - "Get the spending status of a transaction output. Returns whether the output has been spent and, if so, the spending transaction details.", + "Get the spending status of a transaction output. Returns whether the output has been spent and, if so, the spending transaction details.\n\n*[Mempool.space docs](https://mempool.space/docs/api/rest#get-transaction-outspend)*", ) .ok_response::() .not_modified() @@ -124,10 +128,11 @@ impl TxRoutes for ApiRouter { state.cached_json(&headers, CacheStrategy::Height, move |q| q.outspends(txid)).await }, |op| op + .id("get_tx_outspends") .transactions_tag() .summary("All output spend statuses") .description( - "Get the spending status of all outputs in a transaction. Returns an array with the spend status for each output.", + "Get the spending status of all outputs in a transaction. Returns an array with the spend status for each output.\n\n*[Mempool.space docs](https://mempool.space/docs/api/rest#get-transaction-outspends)*", ) .ok_response::>() .not_modified() diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md new file mode 100644 index 000000000..a3496619b --- /dev/null +++ b/docs/ARCHITECTURE.md @@ -0,0 +1,99 @@ +# Architecture + +## Overview + +``` +blk*.dat ──▶ Reader ──┐ + ├──▶ Indexer ──▶ Computer ──┐ + RPC Client ──┤ ├──▶ Query ──▶ Server + └──▶ Mempool ───────────────┘ +``` + +## Components + +### Reader (`brk_reader`) + +Parses Bitcoin Core's `blk*.dat` files directly, bypassing RPC for historical data. Supports parallel parsing and handles XOR-encoded blocks (Bitcoin Core 28+). + +### RPC Client (`brk_rpc`) + +Connects to Bitcoin Core for real-time data: new blocks, mempool transactions, and fee estimates. Thread-safe with automatic retries. + +### Indexer (`brk_indexer`) + +Builds lookup tables from parsed blocks: +- Transaction index (txid → block position) +- Address index (address → transactions, UTXOs) +- UTXO set tracking +- Output type classification (P2PKH, P2WPKH, P2TR, etc.) + +### Computer (`brk_computer`) + +Derives analytics from indexed data: +- Market metrics: realized cap, MVRV, SOPR, NVT +- Supply metrics: circulating, liquid, illiquid +- UTXO cohorts: by age, size, type +- Address cohorts: by balance, activity +- Pricing models: thermocap, realized price bands + +Metrics are computed across multiple time resolutions (daily, weekly, monthly, by block height). + +### Mempool (`brk_mempool`) + +Monitors unconfirmed transactions: +- Fee rate distribution and estimation +- Projected block templates +- Address mempool activity + +### Query (`brk_query`) + +Unified interface to all data sources: +- Block and transaction lookups +- Address balances and history +- Computed metrics with range queries +- Mempool state + +### Server (`brk_server`) + +REST API exposing Query functionality: +- OpenAPI documentation (Scalar UI) +- JSON and CSV output formats +- ETag caching +- mempool.space compatible endpoints + +## Data Flow + +**Initial sync:** +1. Reader parses all `blk*.dat` files in parallel +2. Indexer processes blocks sequentially, building indexes +3. Computer derives metrics from indexed data +4. Server starts accepting requests + +**Ongoing operation:** +1. RPC client polls for new blocks +2. Reader fetches block data +3. Indexer updates indexes +4. Computer recalculates affected metrics +5. Mempool monitors transaction pool + +## Storage + +Data is stored in `~/.brk/` (configurable): + +``` +~/.brk/ +├── indexer/ # Transaction and address indexes (fjall) +├── computer/ # Computed metrics (vecdb) +└── config.toml # Configuration +``` + +Disk usage scales with blockchain size. Full index with metrics: ~400 GB. + +## Dependencies + +Built on: +- [`rust-bitcoin`](https://github.com/rust-bitcoin/rust-bitcoin) - Bitcoin primitives +- [`fjall`](https://github.com/fjall-rs/fjall) - LSM-tree storage +- [`vecdb`](https://github.com/anydb-rs/anydb) - Vector storage +- [`axum`](https://github.com/tokio-rs/axum) - HTTP server +- [`aide`](https://github.com/tamasfe/aide) - OpenAPI generation diff --git a/docs/HOSTING.md b/docs/HOSTING.md index d070c9c40..a77455ea7 100644 --- a/docs/HOSTING.md +++ b/docs/HOSTING.md @@ -14,7 +14,7 @@ Requirements: - ~400 GB disk space - 12+ GB RAM recommended -See the [CLI README](../crates/brk_cli/README.md) for configuration options. +See the [CLI documentation](https://docs.rs/brk_cli) for configuration options. ## Professional Hosting diff --git a/docs/README.md b/docs/README.md index e382223b1..2312f288a 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,84 +1,43 @@ # Bitcoin Research Kit -
+**Open-source Bitcoin analytics infrastructure.** -

- A suite of Rust crates for working with Bitcoin data. -

+[![MIT Licensed](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/bitcoinresearchkit/brk/blob/main/docs/LICENSE.md) +[![Crates.io](https://img.shields.io/crates/v/brk.svg)](https://crates.io/crates/brk) +[![docs.rs](https://img.shields.io/docsrs/brk)](https://docs.rs/brk) +[![Discord](https://img.shields.io/discord/1350431684562124850?logo=discord)](https://discord.gg/WACpShCB7M) -

- MIT Licensed - Crates.io - docs.rs - Discord -

+[Homepage](https://bitcoinresearchkit.org) · [**Bitview**](https://bitview.space) · [API Reference](https://bitcoinresearchkit.org/api) -
+--- -[Homepage](https://bitcoinresearchkit.org) · [API Docs](https://bitcoinresearchkit.org/api) · [Charts](https://bitview.space) · [Changelog](https://github.com/bitcoinresearchkit/brk/blob/main/docs/CHANGELOG.md) +BRK parses, indexes, and analyzes Bitcoin blockchain data. It combines on-chain analytics (like [Glassnode](https://glassnode.com)), block exploration (like [mempool.space](https://mempool.space)), and address indexing (like [electrs](https://github.com/romanz/electrs)) into a single self-hostable package. -## About +## See It In Action -BRK is a toolkit for parsing, indexing, and analyzing Bitcoin blockchain data. It combines functionality similar to [Glassnode](https://glassnode.com) (on-chain analytics), [mempool.space](https://mempool.space) (block explorer), and [electrs](https://github.com/romanz/electrs) (address indexing) into a single self-hostable package. +[**Bitview**](https://bitview.space) is a web application built entirely on BRK. It offers interactive charts for exploring Bitcoin on-chain metrics—price models, supply dynamics, holder behavior, network activity, and more. Browse it to see what's possible with the data BRK provides. -- **Parse** blocks directly from Bitcoin Core's data files -- **Index** transactions, addresses, and UTXOs -- **Compute** derived metrics across multiple time resolutions -- **Monitor** mempool with fee estimation and projected block building -- **Serve** data via REST API and web interface -- **Query** addresses, transactions, blocks, and analytics +## What It Provides -The crates can be used together as a complete solution, or independently for specific needs. +**On-Chain Metrics** — Thousands of derived metrics: market indicators (realized cap, MVRV, SOPR, NVT), supply analysis (circulating, liquid, illiquid), holder cohorts (by balance, age, address type), and pricing models. This is what sets BRK apart from typical block explorers. -Built on [`rust-bitcoin`], [`vecdb`], and [`fjall`]. +**Blockchain Data** — Blocks, transactions, addresses, UTXOs. The API follows mempool.space's format for compatibility with existing tools. -## Crates +**Multiple Indexes** — Query data by date, block height, halving epoch, address type, UTXO age, and more. Enables flexible time-series queries and cohort analysis. -**Entry Points** +**Mempool** — Real-time fee estimation, projected blocks, unconfirmed transaction tracking. -| Crate | Purpose | -|-------|---------| -| [`brk`](./crates/brk) | Umbrella crate, re-exports all components via feature flags | -| [`brk_cli`](./crates/brk_cli) | CLI binary (`cargo install --locked brk_cli`) | +**REST API** — JSON and CSV output with OpenAPI documentation. -**Core** +**MCP Server** — Model Context Protocol integration for AI assistants and LLMs. -| Crate | Purpose | -|-------|---------| -| [`brk_reader`](./crates/brk_reader) | Read blocks from `blk*.dat` with parallel parsing and XOR decoding | -| [`brk_indexer`](./crates/brk_indexer) | Index transactions, addresses, and UTXOs | -| [`brk_computer`](./crates/brk_computer) | Compute derived metrics (realized cap, MVRV, SOPR, cohorts, etc.) | -| [`brk_mempool`](./crates/brk_mempool) | Monitor mempool, estimate fees, project upcoming blocks | -| [`brk_query`](./crates/brk_query) | Query interface for indexed and computed data | -| [`brk_server`](./crates/brk_server) | REST API with OpenAPI docs | +## Get Started -**Data & Storage** +**Use the Public API** — Access data without running infrastructure. Client libraries available for [JavaScript](https://www.npmjs.com/package/brk-client), [Python](https://pypi.org/project/brk-client/), and [Rust](https://crates.io/crates/brk_client). See the [API reference](https://bitcoinresearchkit.org/api) for endpoints. -| Crate | Purpose | -|-------|---------| -| [`brk_types`](./crates/brk_types) | Domain types: `Height`, `Sats`, `Txid`, addresses, etc. | -| [`brk_store`](./crates/brk_store) | Key-value storage (fjall wrapper) | -| [`brk_fetcher`](./crates/brk_fetcher) | Fetch price data from exchanges | -| [`brk_rpc`](./crates/brk_rpc) | Bitcoin Core RPC client | -| [`brk_iterator`](./crates/brk_iterator) | Unified block iteration with automatic source selection | -| [`brk_grouper`](./crates/brk_grouper) | UTXO and address cohort filtering | -| [`brk_traversable`](./crates/brk_traversable) | Navigate hierarchical data structures | +**Self-Host** — Run your own instance with Bitcoin Core. Install via `cargo install --locked brk_cli` or use [Docker](https://github.com/bitcoinresearchkit/brk/tree/main/docker). Requires ~400 GB disk and 12+ GB RAM. See the [hosting guide](./HOSTING.md). -**Clients & Integration** - -| Crate | Purpose | -|-------|---------| -| [`brk_mcp`](./crates/brk_mcp) | Model Context Protocol server for LLM integration | -| [`brk_binder`](./crates/brk_binder) | Generate typed clients (Rust, JavaScript, Python) | -| [`brk_client`](./crates/brk_client) | Generated Rust API client | - -**Internal** - -| Crate | Purpose | -|-------|---------| -| [`brk_error`](./crates/brk_error) | Error types | -| [`brk_logger`](./crates/brk_logger) | Logging infrastructure | -| [`brk_bencher`](./crates/brk_bencher) | Benchmarking utilities | +**Use as a Library** — Build custom tools with the Rust crates. Use individual components or the [umbrella crate](https://docs.rs/brk). See [architecture](./ARCHITECTURE.md) for how they fit together. ## Architecture @@ -89,51 +48,18 @@ blk*.dat ──▶ Reader ──┐ └──▶ Mempool ───────────────┘ ``` -- `Reader` parses `blk*.dat` files directly -- `RPC Client` connects to Bitcoin Core -- `Indexer` builds lookup tables from blocks -- `Computer` derives metrics from indexed data -- `Mempool` tracks unconfirmed transactions -- `Query` provides unified access to all data -- `Server` exposes `Query` as REST API +**Reader** parses Bitcoin Core's block files. **Indexer** builds lookup tables. **Computer** derives metrics. **Mempool** tracks unconfirmed transactions. **Query** provides unified data access. **Server** exposes the REST API. -## Usage +[Detailed architecture](./ARCHITECTURE.md) · [All crates](https://docs.rs/brk) -**As a library:** +## Links -```rust -use brk::{reader::Reader, indexer::Indexer, computer::Computer}; - -let reader = Reader::new(blocks_dir, &rpc); -let indexer = Indexer::forced_import(&brk_dir)?; -let computer = Computer::forced_import(&brk_dir, &indexer, None)?; -``` - -**As a CLI:** See [`brk_cli`](./crates/brk_cli) - -**Public API:** [bitcoinresearchkit.org/api](https://bitcoinresearchkit.org/api) - -## Documentation - -- [Changelog](./docs/CHANGELOG.md) -- [TODO](./docs/TODO.md) -- [Hosting](./docs/HOSTING.md) -- [Support](./docs/SUPPORT.md) - -## Contributing - -Contributions are welcome. See [open issues](https://github.com/bitcoinresearchkit/brk/issues). - -Join the discussion on [Discord](https://discord.gg/WACpShCB7M) or [Nostr](https://primal.net/p/nprofile1qqsfw5dacngjlahye34krvgz7u0yghhjgk7gxzl5ptm9v6n2y3sn03sqxu2e6). - -## Acknowledgments - -Development supported by [OpenSats](https://opensats.org/). +- [Changelog](./CHANGELOG.md) +- [Support](./SUPPORT.md) +- [Contributing](https://github.com/bitcoinresearchkit/brk/issues) +- Community: [Discord](https://discord.gg/WACpShCB7M) · [Nostr](https://primal.net/p/nprofile1qqsfw5dacngjlahye34krvgz7u0yghhjgk7gxzl5ptm9v6n2y3sn03sqxu2e6) +- Development supported by [OpenSats](https://opensats.org/) ## License -[MIT](https://github.com/bitcoinresearchkit/brk/blob/main/docs/LICENSE.md) - -[`rust-bitcoin`]: https://github.com/rust-bitcoin/rust-bitcoin -[`vecdb`]: https://github.com/anydb-rs/anydb -[`fjall`]: https://github.com/fjall-rs/fjall +[MIT](./LICENSE.md) diff --git a/modules/brk-client/index.js b/modules/brk-client/index.js index 672681dd4..412fae9a6 100644 --- a/modules/brk-client/index.js +++ b/modules/brk-client/index.js @@ -772,15 +772,23 @@ * @typedef {Object} BrkClientOptions * @property {string} baseUrl - Base URL for the API * @property {number} [timeout] - Request timeout in milliseconds + * @property {string|boolean} [cache] - Enable browser cache with default name (true), custom name (string), or disable (false). No effect in Node.js. Default: true */ -const _isBrowser = typeof window !== 'undefined' && 'caches' in window; -const _runIdle = (/** @type {VoidFunction} */ fn) => (globalThis.requestIdleCallback ?? setTimeout)(fn); +const _isBrowser = typeof window !== "undefined" && "caches" in window; +const _runIdle = (/** @type {VoidFunction} */ fn) => + (globalThis.requestIdleCallback ?? setTimeout)(fn); +const _defaultCacheName = "__BRK_CLIENT__"; -/** @type {Promise} */ -const _cachePromise = _isBrowser - ? caches.open('__BRK_CLIENT__').catch(() => null) - : Promise.resolve(null); +/** + * @param {string|boolean|undefined} cache + * @returns {Promise} + */ +const _openCache = (cache) => { + if (!_isBrowser || cache === false) return Promise.resolve(null); + const name = typeof cache === "string" ? cache : _defaultCacheName; + return caches.open(name).catch(() => null); +}; /** * Custom error class for BRK client errors @@ -792,7 +800,7 @@ class BrkError extends Error { */ constructor(message, status) { super(message); - this.name = 'BrkError'; + this.name = "BrkError"; this.status = status; } } @@ -841,12 +849,14 @@ function _endpoint(client, name, index) { get: (onUpdate) => client.getJson(p, onUpdate), range: (start, end, onUpdate) => { const params = new URLSearchParams(); - if (start !== undefined) params.set('start', String(start)); - if (end !== undefined) params.set('end', String(end)); + if (start !== undefined) params.set("start", String(start)); + if (end !== undefined) params.set("end", String(end)); const query = params.toString(); return client.getJson(query ? `${p}?${query}` : p, onUpdate); }, - get path() { return p; }, + get path() { + return p; + }, }; } @@ -858,9 +868,11 @@ class BrkClientBase { * @param {BrkClientOptions|string} options */ constructor(options) { - const isString = typeof options === 'string'; + const isString = typeof options === "string"; this.baseUrl = isString ? options : options.baseUrl; this.timeout = isString ? 5000 : (options.timeout ?? 5000); + /** @type {Promise} */ + this._cachePromise = _openCache(isString ? undefined : options.cache); } /** @@ -868,7 +880,9 @@ class BrkClientBase { * @returns {Promise} */ async get(path) { - const base = this.baseUrl.endsWith('/') ? this.baseUrl.slice(0, -1) : this.baseUrl; + const base = this.baseUrl.endsWith("/") + ? this.baseUrl.slice(0, -1) + : this.baseUrl; const url = `${base}${path}`; const res = await fetch(url, { signal: AbortSignal.timeout(this.timeout) }); if (!res.ok) throw new BrkError(`HTTP ${res.status}`, res.status); @@ -883,21 +897,24 @@ class BrkClientBase { * @returns {Promise} */ async getJson(path, onUpdate) { - const base = this.baseUrl.endsWith('/') ? this.baseUrl.slice(0, -1) : this.baseUrl; + const base = this.baseUrl.endsWith("/") + ? this.baseUrl.slice(0, -1) + : this.baseUrl; const url = `${base}${path}`; - const cache = await _cachePromise; + const cache = await this._cachePromise; const cachedRes = await cache?.match(url); const cachedJson = cachedRes ? await cachedRes.json() : null; if (cachedJson) onUpdate?.(cachedJson); if (!globalThis.navigator?.onLine) { if (cachedJson) return cachedJson; - throw new BrkError('Offline and no cached data available'); + throw new BrkError("Offline and no cached data available"); } try { const res = await this.get(path); - if (cachedRes?.headers.get('ETag') === res.headers.get('ETag')) return cachedJson; + if (cachedRes?.headers.get("ETag") === res.headers.get("ETag")) + return cachedJson; const cloned = res.clone(); const json = await res.json(); @@ -927,8 +944,7 @@ class BrkClientBase { * @param {string} s - Metric suffix * @returns {string} */ -const _m = (acc, s) => acc ? `${acc}_${s}` : s; - +const _m = (acc, s) => (acc ? `${acc}_${s}` : s); // Index accessor factory functions @@ -948,24 +964,52 @@ function createMetricPattern1(client, name) { return { name, by: { - get dateindex() { return _endpoint(client, name, 'dateindex'); }, - get decadeindex() { return _endpoint(client, name, 'decadeindex'); }, - get difficultyepoch() { return _endpoint(client, name, 'difficultyepoch'); }, - get height() { return _endpoint(client, name, 'height'); }, - get monthindex() { return _endpoint(client, name, 'monthindex'); }, - get quarterindex() { return _endpoint(client, name, 'quarterindex'); }, - get semesterindex() { return _endpoint(client, name, 'semesterindex'); }, - get weekindex() { return _endpoint(client, name, 'weekindex'); }, - get yearindex() { return _endpoint(client, name, 'yearindex'); } + get dateindex() { + return _endpoint(client, name, "dateindex"); + }, + get decadeindex() { + return _endpoint(client, name, "decadeindex"); + }, + get difficultyepoch() { + return _endpoint(client, name, "difficultyepoch"); + }, + get height() { + return _endpoint(client, name, "height"); + }, + get monthindex() { + return _endpoint(client, name, "monthindex"); + }, + get quarterindex() { + return _endpoint(client, name, "quarterindex"); + }, + get semesterindex() { + return _endpoint(client, name, "semesterindex"); + }, + get weekindex() { + return _endpoint(client, name, "weekindex"); + }, + get yearindex() { + return _endpoint(client, name, "yearindex"); + }, }, indexes() { - return ['dateindex', 'decadeindex', 'difficultyepoch', 'height', 'monthindex', 'quarterindex', 'semesterindex', 'weekindex', 'yearindex']; + return [ + "dateindex", + "decadeindex", + "difficultyepoch", + "height", + "monthindex", + "quarterindex", + "semesterindex", + "weekindex", + "yearindex", + ]; }, get(index) { if (this.indexes().includes(index)) { return _endpoint(client, name, index); } - } + }, }; } @@ -985,23 +1029,48 @@ function createMetricPattern2(client, name) { return { name, by: { - get dateindex() { return _endpoint(client, name, 'dateindex'); }, - get decadeindex() { return _endpoint(client, name, 'decadeindex'); }, - get difficultyepoch() { return _endpoint(client, name, 'difficultyepoch'); }, - get monthindex() { return _endpoint(client, name, 'monthindex'); }, - get quarterindex() { return _endpoint(client, name, 'quarterindex'); }, - get semesterindex() { return _endpoint(client, name, 'semesterindex'); }, - get weekindex() { return _endpoint(client, name, 'weekindex'); }, - get yearindex() { return _endpoint(client, name, 'yearindex'); } + get dateindex() { + return _endpoint(client, name, "dateindex"); + }, + get decadeindex() { + return _endpoint(client, name, "decadeindex"); + }, + get difficultyepoch() { + return _endpoint(client, name, "difficultyepoch"); + }, + get monthindex() { + return _endpoint(client, name, "monthindex"); + }, + get quarterindex() { + return _endpoint(client, name, "quarterindex"); + }, + get semesterindex() { + return _endpoint(client, name, "semesterindex"); + }, + get weekindex() { + return _endpoint(client, name, "weekindex"); + }, + get yearindex() { + return _endpoint(client, name, "yearindex"); + }, }, indexes() { - return ['dateindex', 'decadeindex', 'difficultyepoch', 'monthindex', 'quarterindex', 'semesterindex', 'weekindex', 'yearindex']; + return [ + "dateindex", + "decadeindex", + "difficultyepoch", + "monthindex", + "quarterindex", + "semesterindex", + "weekindex", + "yearindex", + ]; }, get(index) { if (this.indexes().includes(index)) { return _endpoint(client, name, index); } - } + }, }; } @@ -1021,23 +1090,48 @@ function createMetricPattern3(client, name) { return { name, by: { - get dateindex() { return _endpoint(client, name, 'dateindex'); }, - get decadeindex() { return _endpoint(client, name, 'decadeindex'); }, - get height() { return _endpoint(client, name, 'height'); }, - get monthindex() { return _endpoint(client, name, 'monthindex'); }, - get quarterindex() { return _endpoint(client, name, 'quarterindex'); }, - get semesterindex() { return _endpoint(client, name, 'semesterindex'); }, - get weekindex() { return _endpoint(client, name, 'weekindex'); }, - get yearindex() { return _endpoint(client, name, 'yearindex'); } + get dateindex() { + return _endpoint(client, name, "dateindex"); + }, + get decadeindex() { + return _endpoint(client, name, "decadeindex"); + }, + get height() { + return _endpoint(client, name, "height"); + }, + get monthindex() { + return _endpoint(client, name, "monthindex"); + }, + get quarterindex() { + return _endpoint(client, name, "quarterindex"); + }, + get semesterindex() { + return _endpoint(client, name, "semesterindex"); + }, + get weekindex() { + return _endpoint(client, name, "weekindex"); + }, + get yearindex() { + return _endpoint(client, name, "yearindex"); + }, }, indexes() { - return ['dateindex', 'decadeindex', 'height', 'monthindex', 'quarterindex', 'semesterindex', 'weekindex', 'yearindex']; + return [ + "dateindex", + "decadeindex", + "height", + "monthindex", + "quarterindex", + "semesterindex", + "weekindex", + "yearindex", + ]; }, get(index) { if (this.indexes().includes(index)) { return _endpoint(client, name, index); } - } + }, }; } @@ -1057,22 +1151,44 @@ function createMetricPattern4(client, name) { return { name, by: { - get dateindex() { return _endpoint(client, name, 'dateindex'); }, - get decadeindex() { return _endpoint(client, name, 'decadeindex'); }, - get monthindex() { return _endpoint(client, name, 'monthindex'); }, - get quarterindex() { return _endpoint(client, name, 'quarterindex'); }, - get semesterindex() { return _endpoint(client, name, 'semesterindex'); }, - get weekindex() { return _endpoint(client, name, 'weekindex'); }, - get yearindex() { return _endpoint(client, name, 'yearindex'); } + get dateindex() { + return _endpoint(client, name, "dateindex"); + }, + get decadeindex() { + return _endpoint(client, name, "decadeindex"); + }, + get monthindex() { + return _endpoint(client, name, "monthindex"); + }, + get quarterindex() { + return _endpoint(client, name, "quarterindex"); + }, + get semesterindex() { + return _endpoint(client, name, "semesterindex"); + }, + get weekindex() { + return _endpoint(client, name, "weekindex"); + }, + get yearindex() { + return _endpoint(client, name, "yearindex"); + }, }, indexes() { - return ['dateindex', 'decadeindex', 'monthindex', 'quarterindex', 'semesterindex', 'weekindex', 'yearindex']; + return [ + "dateindex", + "decadeindex", + "monthindex", + "quarterindex", + "semesterindex", + "weekindex", + "yearindex", + ]; }, get(index) { if (this.indexes().includes(index)) { return _endpoint(client, name, index); } - } + }, }; } @@ -1092,17 +1208,21 @@ function createMetricPattern5(client, name) { return { name, by: { - get dateindex() { return _endpoint(client, name, 'dateindex'); }, - get height() { return _endpoint(client, name, 'height'); } + get dateindex() { + return _endpoint(client, name, "dateindex"); + }, + get height() { + return _endpoint(client, name, "height"); + }, }, indexes() { - return ['dateindex', 'height']; + return ["dateindex", "height"]; }, get(index) { if (this.indexes().includes(index)) { return _endpoint(client, name, index); } - } + }, }; } @@ -1122,16 +1242,18 @@ function createMetricPattern6(client, name) { return { name, by: { - get dateindex() { return _endpoint(client, name, 'dateindex'); } + get dateindex() { + return _endpoint(client, name, "dateindex"); + }, }, indexes() { - return ['dateindex']; + return ["dateindex"]; }, get(index) { if (this.indexes().includes(index)) { return _endpoint(client, name, index); } - } + }, }; } @@ -1151,16 +1273,18 @@ function createMetricPattern7(client, name) { return { name, by: { - get decadeindex() { return _endpoint(client, name, 'decadeindex'); } + get decadeindex() { + return _endpoint(client, name, "decadeindex"); + }, }, indexes() { - return ['decadeindex']; + return ["decadeindex"]; }, get(index) { if (this.indexes().includes(index)) { return _endpoint(client, name, index); } - } + }, }; } @@ -1180,16 +1304,18 @@ function createMetricPattern8(client, name) { return { name, by: { - get difficultyepoch() { return _endpoint(client, name, 'difficultyepoch'); } + get difficultyepoch() { + return _endpoint(client, name, "difficultyepoch"); + }, }, indexes() { - return ['difficultyepoch']; + return ["difficultyepoch"]; }, get(index) { if (this.indexes().includes(index)) { return _endpoint(client, name, index); } - } + }, }; } @@ -1209,16 +1335,18 @@ function createMetricPattern9(client, name) { return { name, by: { - get emptyoutputindex() { return _endpoint(client, name, 'emptyoutputindex'); } + get emptyoutputindex() { + return _endpoint(client, name, "emptyoutputindex"); + }, }, indexes() { - return ['emptyoutputindex']; + return ["emptyoutputindex"]; }, get(index) { if (this.indexes().includes(index)) { return _endpoint(client, name, index); } - } + }, }; } @@ -1238,16 +1366,18 @@ function createMetricPattern10(client, name) { return { name, by: { - get halvingepoch() { return _endpoint(client, name, 'halvingepoch'); } + get halvingepoch() { + return _endpoint(client, name, "halvingepoch"); + }, }, indexes() { - return ['halvingepoch']; + return ["halvingepoch"]; }, get(index) { if (this.indexes().includes(index)) { return _endpoint(client, name, index); } - } + }, }; } @@ -1267,16 +1397,18 @@ function createMetricPattern11(client, name) { return { name, by: { - get height() { return _endpoint(client, name, 'height'); } + get height() { + return _endpoint(client, name, "height"); + }, }, indexes() { - return ['height']; + return ["height"]; }, get(index) { if (this.indexes().includes(index)) { return _endpoint(client, name, index); } - } + }, }; } @@ -1296,16 +1428,18 @@ function createMetricPattern12(client, name) { return { name, by: { - get txinindex() { return _endpoint(client, name, 'txinindex'); } + get txinindex() { + return _endpoint(client, name, "txinindex"); + }, }, indexes() { - return ['txinindex']; + return ["txinindex"]; }, get(index) { if (this.indexes().includes(index)) { return _endpoint(client, name, index); } - } + }, }; } @@ -1325,16 +1459,18 @@ function createMetricPattern13(client, name) { return { name, by: { - get monthindex() { return _endpoint(client, name, 'monthindex'); } + get monthindex() { + return _endpoint(client, name, "monthindex"); + }, }, indexes() { - return ['monthindex']; + return ["monthindex"]; }, get(index) { if (this.indexes().includes(index)) { return _endpoint(client, name, index); } - } + }, }; } @@ -1354,16 +1490,18 @@ function createMetricPattern14(client, name) { return { name, by: { - get opreturnindex() { return _endpoint(client, name, 'opreturnindex'); } + get opreturnindex() { + return _endpoint(client, name, "opreturnindex"); + }, }, indexes() { - return ['opreturnindex']; + return ["opreturnindex"]; }, get(index) { if (this.indexes().includes(index)) { return _endpoint(client, name, index); } - } + }, }; } @@ -1383,16 +1521,18 @@ function createMetricPattern15(client, name) { return { name, by: { - get txoutindex() { return _endpoint(client, name, 'txoutindex'); } + get txoutindex() { + return _endpoint(client, name, "txoutindex"); + }, }, indexes() { - return ['txoutindex']; + return ["txoutindex"]; }, get(index) { if (this.indexes().includes(index)) { return _endpoint(client, name, index); } - } + }, }; } @@ -1412,16 +1552,18 @@ function createMetricPattern16(client, name) { return { name, by: { - get p2aaddressindex() { return _endpoint(client, name, 'p2aaddressindex'); } + get p2aaddressindex() { + return _endpoint(client, name, "p2aaddressindex"); + }, }, indexes() { - return ['p2aaddressindex']; + return ["p2aaddressindex"]; }, get(index) { if (this.indexes().includes(index)) { return _endpoint(client, name, index); } - } + }, }; } @@ -1441,16 +1583,18 @@ function createMetricPattern17(client, name) { return { name, by: { - get p2msoutputindex() { return _endpoint(client, name, 'p2msoutputindex'); } + get p2msoutputindex() { + return _endpoint(client, name, "p2msoutputindex"); + }, }, indexes() { - return ['p2msoutputindex']; + return ["p2msoutputindex"]; }, get(index) { if (this.indexes().includes(index)) { return _endpoint(client, name, index); } - } + }, }; } @@ -1470,16 +1614,18 @@ function createMetricPattern18(client, name) { return { name, by: { - get p2pk33addressindex() { return _endpoint(client, name, 'p2pk33addressindex'); } + get p2pk33addressindex() { + return _endpoint(client, name, "p2pk33addressindex"); + }, }, indexes() { - return ['p2pk33addressindex']; + return ["p2pk33addressindex"]; }, get(index) { if (this.indexes().includes(index)) { return _endpoint(client, name, index); } - } + }, }; } @@ -1499,16 +1645,18 @@ function createMetricPattern19(client, name) { return { name, by: { - get p2pk65addressindex() { return _endpoint(client, name, 'p2pk65addressindex'); } + get p2pk65addressindex() { + return _endpoint(client, name, "p2pk65addressindex"); + }, }, indexes() { - return ['p2pk65addressindex']; + return ["p2pk65addressindex"]; }, get(index) { if (this.indexes().includes(index)) { return _endpoint(client, name, index); } - } + }, }; } @@ -1528,16 +1676,18 @@ function createMetricPattern20(client, name) { return { name, by: { - get p2pkhaddressindex() { return _endpoint(client, name, 'p2pkhaddressindex'); } + get p2pkhaddressindex() { + return _endpoint(client, name, "p2pkhaddressindex"); + }, }, indexes() { - return ['p2pkhaddressindex']; + return ["p2pkhaddressindex"]; }, get(index) { if (this.indexes().includes(index)) { return _endpoint(client, name, index); } - } + }, }; } @@ -1557,16 +1707,18 @@ function createMetricPattern21(client, name) { return { name, by: { - get p2shaddressindex() { return _endpoint(client, name, 'p2shaddressindex'); } + get p2shaddressindex() { + return _endpoint(client, name, "p2shaddressindex"); + }, }, indexes() { - return ['p2shaddressindex']; + return ["p2shaddressindex"]; }, get(index) { if (this.indexes().includes(index)) { return _endpoint(client, name, index); } - } + }, }; } @@ -1586,16 +1738,18 @@ function createMetricPattern22(client, name) { return { name, by: { - get p2traddressindex() { return _endpoint(client, name, 'p2traddressindex'); } + get p2traddressindex() { + return _endpoint(client, name, "p2traddressindex"); + }, }, indexes() { - return ['p2traddressindex']; + return ["p2traddressindex"]; }, get(index) { if (this.indexes().includes(index)) { return _endpoint(client, name, index); } - } + }, }; } @@ -1615,16 +1769,18 @@ function createMetricPattern23(client, name) { return { name, by: { - get p2wpkhaddressindex() { return _endpoint(client, name, 'p2wpkhaddressindex'); } + get p2wpkhaddressindex() { + return _endpoint(client, name, "p2wpkhaddressindex"); + }, }, indexes() { - return ['p2wpkhaddressindex']; + return ["p2wpkhaddressindex"]; }, get(index) { if (this.indexes().includes(index)) { return _endpoint(client, name, index); } - } + }, }; } @@ -1644,16 +1800,18 @@ function createMetricPattern24(client, name) { return { name, by: { - get p2wshaddressindex() { return _endpoint(client, name, 'p2wshaddressindex'); } + get p2wshaddressindex() { + return _endpoint(client, name, "p2wshaddressindex"); + }, }, indexes() { - return ['p2wshaddressindex']; + return ["p2wshaddressindex"]; }, get(index) { if (this.indexes().includes(index)) { return _endpoint(client, name, index); } - } + }, }; } @@ -1673,16 +1831,18 @@ function createMetricPattern25(client, name) { return { name, by: { - get quarterindex() { return _endpoint(client, name, 'quarterindex'); } + get quarterindex() { + return _endpoint(client, name, "quarterindex"); + }, }, indexes() { - return ['quarterindex']; + return ["quarterindex"]; }, get(index) { if (this.indexes().includes(index)) { return _endpoint(client, name, index); } - } + }, }; } @@ -1702,16 +1862,18 @@ function createMetricPattern26(client, name) { return { name, by: { - get semesterindex() { return _endpoint(client, name, 'semesterindex'); } + get semesterindex() { + return _endpoint(client, name, "semesterindex"); + }, }, indexes() { - return ['semesterindex']; + return ["semesterindex"]; }, get(index) { if (this.indexes().includes(index)) { return _endpoint(client, name, index); } - } + }, }; } @@ -1731,16 +1893,18 @@ function createMetricPattern27(client, name) { return { name, by: { - get txindex() { return _endpoint(client, name, 'txindex'); } + get txindex() { + return _endpoint(client, name, "txindex"); + }, }, indexes() { - return ['txindex']; + return ["txindex"]; }, get(index) { if (this.indexes().includes(index)) { return _endpoint(client, name, index); } - } + }, }; } @@ -1760,16 +1924,18 @@ function createMetricPattern28(client, name) { return { name, by: { - get unknownoutputindex() { return _endpoint(client, name, 'unknownoutputindex'); } + get unknownoutputindex() { + return _endpoint(client, name, "unknownoutputindex"); + }, }, indexes() { - return ['unknownoutputindex']; + return ["unknownoutputindex"]; }, get(index) { if (this.indexes().includes(index)) { return _endpoint(client, name, index); } - } + }, }; } @@ -1789,16 +1955,18 @@ function createMetricPattern29(client, name) { return { name, by: { - get weekindex() { return _endpoint(client, name, 'weekindex'); } + get weekindex() { + return _endpoint(client, name, "weekindex"); + }, }, indexes() { - return ['weekindex']; + return ["weekindex"]; }, get(index) { if (this.indexes().includes(index)) { return _endpoint(client, name, index); } - } + }, }; } @@ -1818,16 +1986,18 @@ function createMetricPattern30(client, name) { return { name, by: { - get yearindex() { return _endpoint(client, name, 'yearindex'); } + get yearindex() { + return _endpoint(client, name, "yearindex"); + }, }, indexes() { - return ['yearindex']; + return ["yearindex"]; }, get(index) { if (this.indexes().includes(index)) { return _endpoint(client, name, index); } - } + }, }; } @@ -1847,16 +2017,18 @@ function createMetricPattern31(client, name) { return { name, by: { - get loadedaddressindex() { return _endpoint(client, name, 'loadedaddressindex'); } + get loadedaddressindex() { + return _endpoint(client, name, "loadedaddressindex"); + }, }, indexes() { - return ['loadedaddressindex']; + return ["loadedaddressindex"]; }, get(index) { if (this.indexes().includes(index)) { return _endpoint(client, name, index); } - } + }, }; } @@ -1876,16 +2048,18 @@ function createMetricPattern32(client, name) { return { name, by: { - get emptyaddressindex() { return _endpoint(client, name, 'emptyaddressindex'); } + get emptyaddressindex() { + return _endpoint(client, name, "emptyaddressindex"); + }, }, indexes() { - return ['emptyaddressindex']; + return ["emptyaddressindex"]; }, get(index) { if (this.indexes().includes(index)) { return _endpoint(client, name, index); } - } + }, }; } @@ -1935,38 +2109,95 @@ function createMetricPattern32(client, name) { */ function createRealizedPattern3(client, acc) { return { - adjustedSopr: createMetricPattern6(client, _m(acc, 'adjusted_sopr')), - adjustedSopr30dEma: createMetricPattern6(client, _m(acc, 'adjusted_sopr_30d_ema')), - adjustedSopr7dEma: createMetricPattern6(client, _m(acc, 'adjusted_sopr_7d_ema')), - adjustedValueCreated: createMetricPattern1(client, _m(acc, 'adjusted_value_created')), - adjustedValueDestroyed: createMetricPattern1(client, _m(acc, 'adjusted_value_destroyed')), - mvrv: createMetricPattern4(client, _m(acc, 'mvrv')), - negRealizedLoss: createBitcoinPattern(client, _m(acc, 'neg_realized_loss')), - netRealizedPnl: createBlockCountPattern(client, _m(acc, 'net_realized_pnl')), - netRealizedPnlCumulative30dDelta: createMetricPattern4(client, _m(acc, 'net_realized_pnl_cumulative_30d_delta')), - netRealizedPnlCumulative30dDeltaRelToMarketCap: createMetricPattern4(client, _m(acc, 'net_realized_pnl_cumulative_30d_delta_rel_to_market_cap')), - netRealizedPnlCumulative30dDeltaRelToRealizedCap: createMetricPattern4(client, _m(acc, 'net_realized_pnl_cumulative_30d_delta_rel_to_realized_cap')), - netRealizedPnlRelToRealizedCap: createBlockCountPattern(client, _m(acc, 'net_realized_pnl_rel_to_realized_cap')), - realizedCap: createMetricPattern1(client, _m(acc, 'realized_cap')), - realizedCap30dDelta: createMetricPattern4(client, _m(acc, 'realized_cap_30d_delta')), - realizedCapRelToOwnMarketCap: createMetricPattern1(client, _m(acc, 'realized_cap_rel_to_own_market_cap')), - realizedLoss: createBlockCountPattern(client, _m(acc, 'realized_loss')), - realizedLossRelToRealizedCap: createBlockCountPattern(client, _m(acc, 'realized_loss_rel_to_realized_cap')), - realizedPrice: createMetricPattern1(client, _m(acc, 'realized_price')), - realizedPriceExtra: createActivePriceRatioPattern(client, _m(acc, 'realized_price_ratio')), - realizedProfit: createBlockCountPattern(client, _m(acc, 'realized_profit')), - realizedProfitRelToRealizedCap: createBlockCountPattern(client, _m(acc, 'realized_profit_rel_to_realized_cap')), - realizedProfitToLossRatio: createMetricPattern6(client, _m(acc, 'realized_profit_to_loss_ratio')), - realizedValue: createMetricPattern1(client, _m(acc, 'realized_value')), - sellSideRiskRatio: createMetricPattern6(client, _m(acc, 'sell_side_risk_ratio')), - sellSideRiskRatio30dEma: createMetricPattern6(client, _m(acc, 'sell_side_risk_ratio_30d_ema')), - sellSideRiskRatio7dEma: createMetricPattern6(client, _m(acc, 'sell_side_risk_ratio_7d_ema')), - sopr: createMetricPattern6(client, _m(acc, 'sopr')), - sopr30dEma: createMetricPattern6(client, _m(acc, 'sopr_30d_ema')), - sopr7dEma: createMetricPattern6(client, _m(acc, 'sopr_7d_ema')), - totalRealizedPnl: createMetricPattern1(client, _m(acc, 'total_realized_pnl')), - valueCreated: createMetricPattern1(client, _m(acc, 'value_created')), - valueDestroyed: createMetricPattern1(client, _m(acc, 'value_destroyed')), + adjustedSopr: createMetricPattern6(client, _m(acc, "adjusted_sopr")), + adjustedSopr30dEma: createMetricPattern6( + client, + _m(acc, "adjusted_sopr_30d_ema"), + ), + adjustedSopr7dEma: createMetricPattern6( + client, + _m(acc, "adjusted_sopr_7d_ema"), + ), + adjustedValueCreated: createMetricPattern1( + client, + _m(acc, "adjusted_value_created"), + ), + adjustedValueDestroyed: createMetricPattern1( + client, + _m(acc, "adjusted_value_destroyed"), + ), + mvrv: createMetricPattern4(client, _m(acc, "mvrv")), + negRealizedLoss: createBitcoinPattern(client, _m(acc, "neg_realized_loss")), + netRealizedPnl: createBlockCountPattern( + client, + _m(acc, "net_realized_pnl"), + ), + netRealizedPnlCumulative30dDelta: createMetricPattern4( + client, + _m(acc, "net_realized_pnl_cumulative_30d_delta"), + ), + netRealizedPnlCumulative30dDeltaRelToMarketCap: createMetricPattern4( + client, + _m(acc, "net_realized_pnl_cumulative_30d_delta_rel_to_market_cap"), + ), + netRealizedPnlCumulative30dDeltaRelToRealizedCap: createMetricPattern4( + client, + _m(acc, "net_realized_pnl_cumulative_30d_delta_rel_to_realized_cap"), + ), + netRealizedPnlRelToRealizedCap: createBlockCountPattern( + client, + _m(acc, "net_realized_pnl_rel_to_realized_cap"), + ), + realizedCap: createMetricPattern1(client, _m(acc, "realized_cap")), + realizedCap30dDelta: createMetricPattern4( + client, + _m(acc, "realized_cap_30d_delta"), + ), + realizedCapRelToOwnMarketCap: createMetricPattern1( + client, + _m(acc, "realized_cap_rel_to_own_market_cap"), + ), + realizedLoss: createBlockCountPattern(client, _m(acc, "realized_loss")), + realizedLossRelToRealizedCap: createBlockCountPattern( + client, + _m(acc, "realized_loss_rel_to_realized_cap"), + ), + realizedPrice: createMetricPattern1(client, _m(acc, "realized_price")), + realizedPriceExtra: createActivePriceRatioPattern( + client, + _m(acc, "realized_price_ratio"), + ), + realizedProfit: createBlockCountPattern(client, _m(acc, "realized_profit")), + realizedProfitRelToRealizedCap: createBlockCountPattern( + client, + _m(acc, "realized_profit_rel_to_realized_cap"), + ), + realizedProfitToLossRatio: createMetricPattern6( + client, + _m(acc, "realized_profit_to_loss_ratio"), + ), + realizedValue: createMetricPattern1(client, _m(acc, "realized_value")), + sellSideRiskRatio: createMetricPattern6( + client, + _m(acc, "sell_side_risk_ratio"), + ), + sellSideRiskRatio30dEma: createMetricPattern6( + client, + _m(acc, "sell_side_risk_ratio_30d_ema"), + ), + sellSideRiskRatio7dEma: createMetricPattern6( + client, + _m(acc, "sell_side_risk_ratio_7d_ema"), + ), + sopr: createMetricPattern6(client, _m(acc, "sopr")), + sopr30dEma: createMetricPattern6(client, _m(acc, "sopr_30d_ema")), + sopr7dEma: createMetricPattern6(client, _m(acc, "sopr_7d_ema")), + totalRealizedPnl: createMetricPattern1( + client, + _m(acc, "total_realized_pnl"), + ), + valueCreated: createMetricPattern1(client, _m(acc, "value_created")), + valueDestroyed: createMetricPattern1(client, _m(acc, "value_destroyed")), }; } @@ -2012,36 +2243,87 @@ function createRealizedPattern3(client, acc) { */ function createRealizedPattern4(client, acc) { return { - adjustedSopr: createMetricPattern6(client, _m(acc, 'adjusted_sopr')), - adjustedSopr30dEma: createMetricPattern6(client, _m(acc, 'adjusted_sopr_30d_ema')), - adjustedSopr7dEma: createMetricPattern6(client, _m(acc, 'adjusted_sopr_7d_ema')), - adjustedValueCreated: createMetricPattern1(client, _m(acc, 'adjusted_value_created')), - adjustedValueDestroyed: createMetricPattern1(client, _m(acc, 'adjusted_value_destroyed')), - mvrv: createMetricPattern4(client, _m(acc, 'mvrv')), - negRealizedLoss: createBitcoinPattern(client, _m(acc, 'neg_realized_loss')), - netRealizedPnl: createBlockCountPattern(client, _m(acc, 'net_realized_pnl')), - netRealizedPnlCumulative30dDelta: createMetricPattern4(client, _m(acc, 'net_realized_pnl_cumulative_30d_delta')), - netRealizedPnlCumulative30dDeltaRelToMarketCap: createMetricPattern4(client, _m(acc, 'net_realized_pnl_cumulative_30d_delta_rel_to_market_cap')), - netRealizedPnlCumulative30dDeltaRelToRealizedCap: createMetricPattern4(client, _m(acc, 'net_realized_pnl_cumulative_30d_delta_rel_to_realized_cap')), - netRealizedPnlRelToRealizedCap: createBlockCountPattern(client, _m(acc, 'net_realized_pnl_rel_to_realized_cap')), - realizedCap: createMetricPattern1(client, _m(acc, 'realized_cap')), - realizedCap30dDelta: createMetricPattern4(client, _m(acc, 'realized_cap_30d_delta')), - realizedLoss: createBlockCountPattern(client, _m(acc, 'realized_loss')), - realizedLossRelToRealizedCap: createBlockCountPattern(client, _m(acc, 'realized_loss_rel_to_realized_cap')), - realizedPrice: createMetricPattern1(client, _m(acc, 'realized_price')), - realizedPriceExtra: createRealizedPriceExtraPattern(client, _m(acc, 'realized_price')), - realizedProfit: createBlockCountPattern(client, _m(acc, 'realized_profit')), - realizedProfitRelToRealizedCap: createBlockCountPattern(client, _m(acc, 'realized_profit_rel_to_realized_cap')), - realizedValue: createMetricPattern1(client, _m(acc, 'realized_value')), - sellSideRiskRatio: createMetricPattern6(client, _m(acc, 'sell_side_risk_ratio')), - sellSideRiskRatio30dEma: createMetricPattern6(client, _m(acc, 'sell_side_risk_ratio_30d_ema')), - sellSideRiskRatio7dEma: createMetricPattern6(client, _m(acc, 'sell_side_risk_ratio_7d_ema')), - sopr: createMetricPattern6(client, _m(acc, 'sopr')), - sopr30dEma: createMetricPattern6(client, _m(acc, 'sopr_30d_ema')), - sopr7dEma: createMetricPattern6(client, _m(acc, 'sopr_7d_ema')), - totalRealizedPnl: createMetricPattern1(client, _m(acc, 'total_realized_pnl')), - valueCreated: createMetricPattern1(client, _m(acc, 'value_created')), - valueDestroyed: createMetricPattern1(client, _m(acc, 'value_destroyed')), + adjustedSopr: createMetricPattern6(client, _m(acc, "adjusted_sopr")), + adjustedSopr30dEma: createMetricPattern6( + client, + _m(acc, "adjusted_sopr_30d_ema"), + ), + adjustedSopr7dEma: createMetricPattern6( + client, + _m(acc, "adjusted_sopr_7d_ema"), + ), + adjustedValueCreated: createMetricPattern1( + client, + _m(acc, "adjusted_value_created"), + ), + adjustedValueDestroyed: createMetricPattern1( + client, + _m(acc, "adjusted_value_destroyed"), + ), + mvrv: createMetricPattern4(client, _m(acc, "mvrv")), + negRealizedLoss: createBitcoinPattern(client, _m(acc, "neg_realized_loss")), + netRealizedPnl: createBlockCountPattern( + client, + _m(acc, "net_realized_pnl"), + ), + netRealizedPnlCumulative30dDelta: createMetricPattern4( + client, + _m(acc, "net_realized_pnl_cumulative_30d_delta"), + ), + netRealizedPnlCumulative30dDeltaRelToMarketCap: createMetricPattern4( + client, + _m(acc, "net_realized_pnl_cumulative_30d_delta_rel_to_market_cap"), + ), + netRealizedPnlCumulative30dDeltaRelToRealizedCap: createMetricPattern4( + client, + _m(acc, "net_realized_pnl_cumulative_30d_delta_rel_to_realized_cap"), + ), + netRealizedPnlRelToRealizedCap: createBlockCountPattern( + client, + _m(acc, "net_realized_pnl_rel_to_realized_cap"), + ), + realizedCap: createMetricPattern1(client, _m(acc, "realized_cap")), + realizedCap30dDelta: createMetricPattern4( + client, + _m(acc, "realized_cap_30d_delta"), + ), + realizedLoss: createBlockCountPattern(client, _m(acc, "realized_loss")), + realizedLossRelToRealizedCap: createBlockCountPattern( + client, + _m(acc, "realized_loss_rel_to_realized_cap"), + ), + realizedPrice: createMetricPattern1(client, _m(acc, "realized_price")), + realizedPriceExtra: createRealizedPriceExtraPattern( + client, + _m(acc, "realized_price"), + ), + realizedProfit: createBlockCountPattern(client, _m(acc, "realized_profit")), + realizedProfitRelToRealizedCap: createBlockCountPattern( + client, + _m(acc, "realized_profit_rel_to_realized_cap"), + ), + realizedValue: createMetricPattern1(client, _m(acc, "realized_value")), + sellSideRiskRatio: createMetricPattern6( + client, + _m(acc, "sell_side_risk_ratio"), + ), + sellSideRiskRatio30dEma: createMetricPattern6( + client, + _m(acc, "sell_side_risk_ratio_30d_ema"), + ), + sellSideRiskRatio7dEma: createMetricPattern6( + client, + _m(acc, "sell_side_risk_ratio_7d_ema"), + ), + sopr: createMetricPattern6(client, _m(acc, "sopr")), + sopr30dEma: createMetricPattern6(client, _m(acc, "sopr_30d_ema")), + sopr7dEma: createMetricPattern6(client, _m(acc, "sopr_7d_ema")), + totalRealizedPnl: createMetricPattern1( + client, + _m(acc, "total_realized_pnl"), + ), + valueCreated: createMetricPattern1(client, _m(acc, "value_created")), + valueDestroyed: createMetricPattern1(client, _m(acc, "value_destroyed")), }; } @@ -2085,34 +2367,34 @@ function createRealizedPattern4(client, acc) { */ function createRatio1ySdPattern(client, acc) { return { - _0sdUsd: createMetricPattern4(client, _m(acc, '0sd_usd')), - m05sd: createMetricPattern4(client, _m(acc, 'm0_5sd')), - m05sdUsd: createMetricPattern4(client, _m(acc, 'm0_5sd_usd')), - m15sd: createMetricPattern4(client, _m(acc, 'm1_5sd')), - m15sdUsd: createMetricPattern4(client, _m(acc, 'm1_5sd_usd')), - m1sd: createMetricPattern4(client, _m(acc, 'm1sd')), - m1sdUsd: createMetricPattern4(client, _m(acc, 'm1sd_usd')), - m25sd: createMetricPattern4(client, _m(acc, 'm2_5sd')), - m25sdUsd: createMetricPattern4(client, _m(acc, 'm2_5sd_usd')), - m2sd: createMetricPattern4(client, _m(acc, 'm2sd')), - m2sdUsd: createMetricPattern4(client, _m(acc, 'm2sd_usd')), - m3sd: createMetricPattern4(client, _m(acc, 'm3sd')), - m3sdUsd: createMetricPattern4(client, _m(acc, 'm3sd_usd')), - p05sd: createMetricPattern4(client, _m(acc, 'p0_5sd')), - p05sdUsd: createMetricPattern4(client, _m(acc, 'p0_5sd_usd')), - p15sd: createMetricPattern4(client, _m(acc, 'p1_5sd')), - p15sdUsd: createMetricPattern4(client, _m(acc, 'p1_5sd_usd')), - p1sd: createMetricPattern4(client, _m(acc, 'p1sd')), - p1sdUsd: createMetricPattern4(client, _m(acc, 'p1sd_usd')), - p25sd: createMetricPattern4(client, _m(acc, 'p2_5sd')), - p25sdUsd: createMetricPattern4(client, _m(acc, 'p2_5sd_usd')), - p2sd: createMetricPattern4(client, _m(acc, 'p2sd')), - p2sdUsd: createMetricPattern4(client, _m(acc, 'p2sd_usd')), - p3sd: createMetricPattern4(client, _m(acc, 'p3sd')), - p3sdUsd: createMetricPattern4(client, _m(acc, 'p3sd_usd')), - sd: createMetricPattern4(client, _m(acc, 'sd')), - sma: createMetricPattern4(client, _m(acc, 'sma')), - zscore: createMetricPattern4(client, _m(acc, 'zscore')), + _0sdUsd: createMetricPattern4(client, _m(acc, "0sd_usd")), + m05sd: createMetricPattern4(client, _m(acc, "m0_5sd")), + m05sdUsd: createMetricPattern4(client, _m(acc, "m0_5sd_usd")), + m15sd: createMetricPattern4(client, _m(acc, "m1_5sd")), + m15sdUsd: createMetricPattern4(client, _m(acc, "m1_5sd_usd")), + m1sd: createMetricPattern4(client, _m(acc, "m1sd")), + m1sdUsd: createMetricPattern4(client, _m(acc, "m1sd_usd")), + m25sd: createMetricPattern4(client, _m(acc, "m2_5sd")), + m25sdUsd: createMetricPattern4(client, _m(acc, "m2_5sd_usd")), + m2sd: createMetricPattern4(client, _m(acc, "m2sd")), + m2sdUsd: createMetricPattern4(client, _m(acc, "m2sd_usd")), + m3sd: createMetricPattern4(client, _m(acc, "m3sd")), + m3sdUsd: createMetricPattern4(client, _m(acc, "m3sd_usd")), + p05sd: createMetricPattern4(client, _m(acc, "p0_5sd")), + p05sdUsd: createMetricPattern4(client, _m(acc, "p0_5sd_usd")), + p15sd: createMetricPattern4(client, _m(acc, "p1_5sd")), + p15sdUsd: createMetricPattern4(client, _m(acc, "p1_5sd_usd")), + p1sd: createMetricPattern4(client, _m(acc, "p1sd")), + p1sdUsd: createMetricPattern4(client, _m(acc, "p1sd_usd")), + p25sd: createMetricPattern4(client, _m(acc, "p2_5sd")), + p25sdUsd: createMetricPattern4(client, _m(acc, "p2_5sd_usd")), + p2sd: createMetricPattern4(client, _m(acc, "p2sd")), + p2sdUsd: createMetricPattern4(client, _m(acc, "p2sd_usd")), + p3sd: createMetricPattern4(client, _m(acc, "p3sd")), + p3sdUsd: createMetricPattern4(client, _m(acc, "p3sd_usd")), + sd: createMetricPattern4(client, _m(acc, "sd")), + sma: createMetricPattern4(client, _m(acc, "sma")), + zscore: createMetricPattern4(client, _m(acc, "zscore")), }; } @@ -2155,33 +2437,78 @@ function createRatio1ySdPattern(client, acc) { */ function createRealizedPattern2(client, acc) { return { - mvrv: createMetricPattern4(client, _m(acc, 'mvrv')), - negRealizedLoss: createBitcoinPattern(client, _m(acc, 'neg_realized_loss')), - netRealizedPnl: createBlockCountPattern(client, _m(acc, 'net_realized_pnl')), - netRealizedPnlCumulative30dDelta: createMetricPattern4(client, _m(acc, 'net_realized_pnl_cumulative_30d_delta')), - netRealizedPnlCumulative30dDeltaRelToMarketCap: createMetricPattern4(client, _m(acc, 'net_realized_pnl_cumulative_30d_delta_rel_to_market_cap')), - netRealizedPnlCumulative30dDeltaRelToRealizedCap: createMetricPattern4(client, _m(acc, 'net_realized_pnl_cumulative_30d_delta_rel_to_realized_cap')), - netRealizedPnlRelToRealizedCap: createBlockCountPattern(client, _m(acc, 'net_realized_pnl_rel_to_realized_cap')), - realizedCap: createMetricPattern1(client, _m(acc, 'realized_cap')), - realizedCap30dDelta: createMetricPattern4(client, _m(acc, 'realized_cap_30d_delta')), - realizedCapRelToOwnMarketCap: createMetricPattern1(client, _m(acc, 'realized_cap_rel_to_own_market_cap')), - realizedLoss: createBlockCountPattern(client, _m(acc, 'realized_loss')), - realizedLossRelToRealizedCap: createBlockCountPattern(client, _m(acc, 'realized_loss_rel_to_realized_cap')), - realizedPrice: createMetricPattern1(client, _m(acc, 'realized_price')), - realizedPriceExtra: createActivePriceRatioPattern(client, _m(acc, 'realized_price_ratio')), - realizedProfit: createBlockCountPattern(client, _m(acc, 'realized_profit')), - realizedProfitRelToRealizedCap: createBlockCountPattern(client, _m(acc, 'realized_profit_rel_to_realized_cap')), - realizedProfitToLossRatio: createMetricPattern6(client, _m(acc, 'realized_profit_to_loss_ratio')), - realizedValue: createMetricPattern1(client, _m(acc, 'realized_value')), - sellSideRiskRatio: createMetricPattern6(client, _m(acc, 'sell_side_risk_ratio')), - sellSideRiskRatio30dEma: createMetricPattern6(client, _m(acc, 'sell_side_risk_ratio_30d_ema')), - sellSideRiskRatio7dEma: createMetricPattern6(client, _m(acc, 'sell_side_risk_ratio_7d_ema')), - sopr: createMetricPattern6(client, _m(acc, 'sopr')), - sopr30dEma: createMetricPattern6(client, _m(acc, 'sopr_30d_ema')), - sopr7dEma: createMetricPattern6(client, _m(acc, 'sopr_7d_ema')), - totalRealizedPnl: createMetricPattern1(client, _m(acc, 'total_realized_pnl')), - valueCreated: createMetricPattern1(client, _m(acc, 'value_created')), - valueDestroyed: createMetricPattern1(client, _m(acc, 'value_destroyed')), + mvrv: createMetricPattern4(client, _m(acc, "mvrv")), + negRealizedLoss: createBitcoinPattern(client, _m(acc, "neg_realized_loss")), + netRealizedPnl: createBlockCountPattern( + client, + _m(acc, "net_realized_pnl"), + ), + netRealizedPnlCumulative30dDelta: createMetricPattern4( + client, + _m(acc, "net_realized_pnl_cumulative_30d_delta"), + ), + netRealizedPnlCumulative30dDeltaRelToMarketCap: createMetricPattern4( + client, + _m(acc, "net_realized_pnl_cumulative_30d_delta_rel_to_market_cap"), + ), + netRealizedPnlCumulative30dDeltaRelToRealizedCap: createMetricPattern4( + client, + _m(acc, "net_realized_pnl_cumulative_30d_delta_rel_to_realized_cap"), + ), + netRealizedPnlRelToRealizedCap: createBlockCountPattern( + client, + _m(acc, "net_realized_pnl_rel_to_realized_cap"), + ), + realizedCap: createMetricPattern1(client, _m(acc, "realized_cap")), + realizedCap30dDelta: createMetricPattern4( + client, + _m(acc, "realized_cap_30d_delta"), + ), + realizedCapRelToOwnMarketCap: createMetricPattern1( + client, + _m(acc, "realized_cap_rel_to_own_market_cap"), + ), + realizedLoss: createBlockCountPattern(client, _m(acc, "realized_loss")), + realizedLossRelToRealizedCap: createBlockCountPattern( + client, + _m(acc, "realized_loss_rel_to_realized_cap"), + ), + realizedPrice: createMetricPattern1(client, _m(acc, "realized_price")), + realizedPriceExtra: createActivePriceRatioPattern( + client, + _m(acc, "realized_price_ratio"), + ), + realizedProfit: createBlockCountPattern(client, _m(acc, "realized_profit")), + realizedProfitRelToRealizedCap: createBlockCountPattern( + client, + _m(acc, "realized_profit_rel_to_realized_cap"), + ), + realizedProfitToLossRatio: createMetricPattern6( + client, + _m(acc, "realized_profit_to_loss_ratio"), + ), + realizedValue: createMetricPattern1(client, _m(acc, "realized_value")), + sellSideRiskRatio: createMetricPattern6( + client, + _m(acc, "sell_side_risk_ratio"), + ), + sellSideRiskRatio30dEma: createMetricPattern6( + client, + _m(acc, "sell_side_risk_ratio_30d_ema"), + ), + sellSideRiskRatio7dEma: createMetricPattern6( + client, + _m(acc, "sell_side_risk_ratio_7d_ema"), + ), + sopr: createMetricPattern6(client, _m(acc, "sopr")), + sopr30dEma: createMetricPattern6(client, _m(acc, "sopr_30d_ema")), + sopr7dEma: createMetricPattern6(client, _m(acc, "sopr_7d_ema")), + totalRealizedPnl: createMetricPattern1( + client, + _m(acc, "total_realized_pnl"), + ), + valueCreated: createMetricPattern1(client, _m(acc, "value_created")), + valueDestroyed: createMetricPattern1(client, _m(acc, "value_destroyed")), }; } @@ -2222,31 +2549,70 @@ function createRealizedPattern2(client, acc) { */ function createRealizedPattern(client, acc) { return { - mvrv: createMetricPattern4(client, _m(acc, 'mvrv')), - negRealizedLoss: createBitcoinPattern(client, _m(acc, 'neg_realized_loss')), - netRealizedPnl: createBlockCountPattern(client, _m(acc, 'net_realized_pnl')), - netRealizedPnlCumulative30dDelta: createMetricPattern4(client, _m(acc, 'net_realized_pnl_cumulative_30d_delta')), - netRealizedPnlCumulative30dDeltaRelToMarketCap: createMetricPattern4(client, _m(acc, 'net_realized_pnl_cumulative_30d_delta_rel_to_market_cap')), - netRealizedPnlCumulative30dDeltaRelToRealizedCap: createMetricPattern4(client, _m(acc, 'net_realized_pnl_cumulative_30d_delta_rel_to_realized_cap')), - netRealizedPnlRelToRealizedCap: createBlockCountPattern(client, _m(acc, 'net_realized_pnl_rel_to_realized_cap')), - realizedCap: createMetricPattern1(client, _m(acc, 'realized_cap')), - realizedCap30dDelta: createMetricPattern4(client, _m(acc, 'realized_cap_30d_delta')), - realizedLoss: createBlockCountPattern(client, _m(acc, 'realized_loss')), - realizedLossRelToRealizedCap: createBlockCountPattern(client, _m(acc, 'realized_loss_rel_to_realized_cap')), - realizedPrice: createMetricPattern1(client, _m(acc, 'realized_price')), - realizedPriceExtra: createRealizedPriceExtraPattern(client, _m(acc, 'realized_price')), - realizedProfit: createBlockCountPattern(client, _m(acc, 'realized_profit')), - realizedProfitRelToRealizedCap: createBlockCountPattern(client, _m(acc, 'realized_profit_rel_to_realized_cap')), - realizedValue: createMetricPattern1(client, _m(acc, 'realized_value')), - sellSideRiskRatio: createMetricPattern6(client, _m(acc, 'sell_side_risk_ratio')), - sellSideRiskRatio30dEma: createMetricPattern6(client, _m(acc, 'sell_side_risk_ratio_30d_ema')), - sellSideRiskRatio7dEma: createMetricPattern6(client, _m(acc, 'sell_side_risk_ratio_7d_ema')), - sopr: createMetricPattern6(client, _m(acc, 'sopr')), - sopr30dEma: createMetricPattern6(client, _m(acc, 'sopr_30d_ema')), - sopr7dEma: createMetricPattern6(client, _m(acc, 'sopr_7d_ema')), - totalRealizedPnl: createMetricPattern1(client, _m(acc, 'total_realized_pnl')), - valueCreated: createMetricPattern1(client, _m(acc, 'value_created')), - valueDestroyed: createMetricPattern1(client, _m(acc, 'value_destroyed')), + mvrv: createMetricPattern4(client, _m(acc, "mvrv")), + negRealizedLoss: createBitcoinPattern(client, _m(acc, "neg_realized_loss")), + netRealizedPnl: createBlockCountPattern( + client, + _m(acc, "net_realized_pnl"), + ), + netRealizedPnlCumulative30dDelta: createMetricPattern4( + client, + _m(acc, "net_realized_pnl_cumulative_30d_delta"), + ), + netRealizedPnlCumulative30dDeltaRelToMarketCap: createMetricPattern4( + client, + _m(acc, "net_realized_pnl_cumulative_30d_delta_rel_to_market_cap"), + ), + netRealizedPnlCumulative30dDeltaRelToRealizedCap: createMetricPattern4( + client, + _m(acc, "net_realized_pnl_cumulative_30d_delta_rel_to_realized_cap"), + ), + netRealizedPnlRelToRealizedCap: createBlockCountPattern( + client, + _m(acc, "net_realized_pnl_rel_to_realized_cap"), + ), + realizedCap: createMetricPattern1(client, _m(acc, "realized_cap")), + realizedCap30dDelta: createMetricPattern4( + client, + _m(acc, "realized_cap_30d_delta"), + ), + realizedLoss: createBlockCountPattern(client, _m(acc, "realized_loss")), + realizedLossRelToRealizedCap: createBlockCountPattern( + client, + _m(acc, "realized_loss_rel_to_realized_cap"), + ), + realizedPrice: createMetricPattern1(client, _m(acc, "realized_price")), + realizedPriceExtra: createRealizedPriceExtraPattern( + client, + _m(acc, "realized_price"), + ), + realizedProfit: createBlockCountPattern(client, _m(acc, "realized_profit")), + realizedProfitRelToRealizedCap: createBlockCountPattern( + client, + _m(acc, "realized_profit_rel_to_realized_cap"), + ), + realizedValue: createMetricPattern1(client, _m(acc, "realized_value")), + sellSideRiskRatio: createMetricPattern6( + client, + _m(acc, "sell_side_risk_ratio"), + ), + sellSideRiskRatio30dEma: createMetricPattern6( + client, + _m(acc, "sell_side_risk_ratio_30d_ema"), + ), + sellSideRiskRatio7dEma: createMetricPattern6( + client, + _m(acc, "sell_side_risk_ratio_7d_ema"), + ), + sopr: createMetricPattern6(client, _m(acc, "sopr")), + sopr30dEma: createMetricPattern6(client, _m(acc, "sopr_30d_ema")), + sopr7dEma: createMetricPattern6(client, _m(acc, "sopr_7d_ema")), + totalRealizedPnl: createMetricPattern1( + client, + _m(acc, "total_realized_pnl"), + ), + valueCreated: createMetricPattern1(client, _m(acc, "value_created")), + valueDestroyed: createMetricPattern1(client, _m(acc, "value_destroyed")), }; } @@ -2283,78 +2649,25 @@ function createRealizedPattern(client, acc) { function createPrice111dSmaPattern(client, acc) { return { price: createMetricPattern4(client, acc), - ratio: createMetricPattern4(client, _m(acc, 'ratio')), - ratio1mSma: createMetricPattern4(client, _m(acc, 'ratio_1m_sma')), - ratio1wSma: createMetricPattern4(client, _m(acc, 'ratio_1w_sma')), - ratio1ySd: createRatio1ySdPattern(client, _m(acc, 'ratio_1y')), - ratio2ySd: createRatio1ySdPattern(client, _m(acc, 'ratio_2y')), - ratio4ySd: createRatio1ySdPattern(client, _m(acc, 'ratio_4y')), - ratioPct1: createMetricPattern4(client, _m(acc, 'ratio_pct1')), - ratioPct1Usd: createMetricPattern4(client, _m(acc, 'ratio_pct1_usd')), - ratioPct2: createMetricPattern4(client, _m(acc, 'ratio_pct2')), - ratioPct2Usd: createMetricPattern4(client, _m(acc, 'ratio_pct2_usd')), - ratioPct5: createMetricPattern4(client, _m(acc, 'ratio_pct5')), - ratioPct5Usd: createMetricPattern4(client, _m(acc, 'ratio_pct5_usd')), - ratioPct95: createMetricPattern4(client, _m(acc, 'ratio_pct95')), - ratioPct95Usd: createMetricPattern4(client, _m(acc, 'ratio_pct95_usd')), - ratioPct98: createMetricPattern4(client, _m(acc, 'ratio_pct98')), - ratioPct98Usd: createMetricPattern4(client, _m(acc, 'ratio_pct98_usd')), - ratioPct99: createMetricPattern4(client, _m(acc, 'ratio_pct99')), - ratioPct99Usd: createMetricPattern4(client, _m(acc, 'ratio_pct99_usd')), - ratioSd: createRatio1ySdPattern(client, _m(acc, 'ratio')), - }; -} - -/** - * @typedef {Object} PercentilesPattern - * @property {MetricPattern4} costBasisPct05 - * @property {MetricPattern4} costBasisPct10 - * @property {MetricPattern4} costBasisPct15 - * @property {MetricPattern4} costBasisPct20 - * @property {MetricPattern4} costBasisPct25 - * @property {MetricPattern4} costBasisPct30 - * @property {MetricPattern4} costBasisPct35 - * @property {MetricPattern4} costBasisPct40 - * @property {MetricPattern4} costBasisPct45 - * @property {MetricPattern4} costBasisPct50 - * @property {MetricPattern4} costBasisPct55 - * @property {MetricPattern4} costBasisPct60 - * @property {MetricPattern4} costBasisPct65 - * @property {MetricPattern4} costBasisPct70 - * @property {MetricPattern4} costBasisPct75 - * @property {MetricPattern4} costBasisPct80 - * @property {MetricPattern4} costBasisPct85 - * @property {MetricPattern4} costBasisPct90 - * @property {MetricPattern4} costBasisPct95 - */ - -/** - * Create a PercentilesPattern pattern node - * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name - * @returns {PercentilesPattern} - */ -function createPercentilesPattern(client, acc) { - return { - costBasisPct05: createMetricPattern4(client, _m(acc, 'pct05')), - costBasisPct10: createMetricPattern4(client, _m(acc, 'pct10')), - costBasisPct15: createMetricPattern4(client, _m(acc, 'pct15')), - costBasisPct20: createMetricPattern4(client, _m(acc, 'pct20')), - costBasisPct25: createMetricPattern4(client, _m(acc, 'pct25')), - costBasisPct30: createMetricPattern4(client, _m(acc, 'pct30')), - costBasisPct35: createMetricPattern4(client, _m(acc, 'pct35')), - costBasisPct40: createMetricPattern4(client, _m(acc, 'pct40')), - costBasisPct45: createMetricPattern4(client, _m(acc, 'pct45')), - costBasisPct50: createMetricPattern4(client, _m(acc, 'pct50')), - costBasisPct55: createMetricPattern4(client, _m(acc, 'pct55')), - costBasisPct60: createMetricPattern4(client, _m(acc, 'pct60')), - costBasisPct65: createMetricPattern4(client, _m(acc, 'pct65')), - costBasisPct70: createMetricPattern4(client, _m(acc, 'pct70')), - costBasisPct75: createMetricPattern4(client, _m(acc, 'pct75')), - costBasisPct80: createMetricPattern4(client, _m(acc, 'pct80')), - costBasisPct85: createMetricPattern4(client, _m(acc, 'pct85')), - costBasisPct90: createMetricPattern4(client, _m(acc, 'pct90')), - costBasisPct95: createMetricPattern4(client, _m(acc, 'pct95')), + ratio: createMetricPattern4(client, _m(acc, "ratio")), + ratio1mSma: createMetricPattern4(client, _m(acc, "ratio_1m_sma")), + ratio1wSma: createMetricPattern4(client, _m(acc, "ratio_1w_sma")), + ratio1ySd: createRatio1ySdPattern(client, _m(acc, "ratio_1y")), + ratio2ySd: createRatio1ySdPattern(client, _m(acc, "ratio_2y")), + ratio4ySd: createRatio1ySdPattern(client, _m(acc, "ratio_4y")), + ratioPct1: createMetricPattern4(client, _m(acc, "ratio_pct1")), + ratioPct1Usd: createMetricPattern4(client, _m(acc, "ratio_pct1_usd")), + ratioPct2: createMetricPattern4(client, _m(acc, "ratio_pct2")), + ratioPct2Usd: createMetricPattern4(client, _m(acc, "ratio_pct2_usd")), + ratioPct5: createMetricPattern4(client, _m(acc, "ratio_pct5")), + ratioPct5Usd: createMetricPattern4(client, _m(acc, "ratio_pct5_usd")), + ratioPct95: createMetricPattern4(client, _m(acc, "ratio_pct95")), + ratioPct95Usd: createMetricPattern4(client, _m(acc, "ratio_pct95_usd")), + ratioPct98: createMetricPattern4(client, _m(acc, "ratio_pct98")), + ratioPct98Usd: createMetricPattern4(client, _m(acc, "ratio_pct98_usd")), + ratioPct99: createMetricPattern4(client, _m(acc, "ratio_pct99")), + ratioPct99Usd: createMetricPattern4(client, _m(acc, "ratio_pct99_usd")), + ratioSd: createRatio1ySdPattern(client, _m(acc, "ratio")), }; } @@ -2390,27 +2703,80 @@ function createPercentilesPattern(client, acc) { function createActivePriceRatioPattern(client, acc) { return { ratio: createMetricPattern4(client, acc), - ratio1mSma: createMetricPattern4(client, _m(acc, '1m_sma')), - ratio1wSma: createMetricPattern4(client, _m(acc, '1w_sma')), - ratio1ySd: createRatio1ySdPattern(client, _m(acc, '1y')), - ratio2ySd: createRatio1ySdPattern(client, _m(acc, '2y')), - ratio4ySd: createRatio1ySdPattern(client, _m(acc, '4y')), - ratioPct1: createMetricPattern4(client, _m(acc, 'pct1')), - ratioPct1Usd: createMetricPattern4(client, _m(acc, 'pct1_usd')), - ratioPct2: createMetricPattern4(client, _m(acc, 'pct2')), - ratioPct2Usd: createMetricPattern4(client, _m(acc, 'pct2_usd')), - ratioPct5: createMetricPattern4(client, _m(acc, 'pct5')), - ratioPct5Usd: createMetricPattern4(client, _m(acc, 'pct5_usd')), - ratioPct95: createMetricPattern4(client, _m(acc, 'pct95')), - ratioPct95Usd: createMetricPattern4(client, _m(acc, 'pct95_usd')), - ratioPct98: createMetricPattern4(client, _m(acc, 'pct98')), - ratioPct98Usd: createMetricPattern4(client, _m(acc, 'pct98_usd')), - ratioPct99: createMetricPattern4(client, _m(acc, 'pct99')), - ratioPct99Usd: createMetricPattern4(client, _m(acc, 'pct99_usd')), + ratio1mSma: createMetricPattern4(client, _m(acc, "1m_sma")), + ratio1wSma: createMetricPattern4(client, _m(acc, "1w_sma")), + ratio1ySd: createRatio1ySdPattern(client, _m(acc, "1y")), + ratio2ySd: createRatio1ySdPattern(client, _m(acc, "2y")), + ratio4ySd: createRatio1ySdPattern(client, _m(acc, "4y")), + ratioPct1: createMetricPattern4(client, _m(acc, "pct1")), + ratioPct1Usd: createMetricPattern4(client, _m(acc, "pct1_usd")), + ratioPct2: createMetricPattern4(client, _m(acc, "pct2")), + ratioPct2Usd: createMetricPattern4(client, _m(acc, "pct2_usd")), + ratioPct5: createMetricPattern4(client, _m(acc, "pct5")), + ratioPct5Usd: createMetricPattern4(client, _m(acc, "pct5_usd")), + ratioPct95: createMetricPattern4(client, _m(acc, "pct95")), + ratioPct95Usd: createMetricPattern4(client, _m(acc, "pct95_usd")), + ratioPct98: createMetricPattern4(client, _m(acc, "pct98")), + ratioPct98Usd: createMetricPattern4(client, _m(acc, "pct98_usd")), + ratioPct99: createMetricPattern4(client, _m(acc, "pct99")), + ratioPct99Usd: createMetricPattern4(client, _m(acc, "pct99_usd")), ratioSd: createRatio1ySdPattern(client, acc), }; } +/** + * @typedef {Object} PercentilesPattern + * @property {MetricPattern4} costBasisPct05 + * @property {MetricPattern4} costBasisPct10 + * @property {MetricPattern4} costBasisPct15 + * @property {MetricPattern4} costBasisPct20 + * @property {MetricPattern4} costBasisPct25 + * @property {MetricPattern4} costBasisPct30 + * @property {MetricPattern4} costBasisPct35 + * @property {MetricPattern4} costBasisPct40 + * @property {MetricPattern4} costBasisPct45 + * @property {MetricPattern4} costBasisPct50 + * @property {MetricPattern4} costBasisPct55 + * @property {MetricPattern4} costBasisPct60 + * @property {MetricPattern4} costBasisPct65 + * @property {MetricPattern4} costBasisPct70 + * @property {MetricPattern4} costBasisPct75 + * @property {MetricPattern4} costBasisPct80 + * @property {MetricPattern4} costBasisPct85 + * @property {MetricPattern4} costBasisPct90 + * @property {MetricPattern4} costBasisPct95 + */ + +/** + * Create a PercentilesPattern pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {PercentilesPattern} + */ +function createPercentilesPattern(client, acc) { + return { + costBasisPct05: createMetricPattern4(client, _m(acc, "pct05")), + costBasisPct10: createMetricPattern4(client, _m(acc, "pct10")), + costBasisPct15: createMetricPattern4(client, _m(acc, "pct15")), + costBasisPct20: createMetricPattern4(client, _m(acc, "pct20")), + costBasisPct25: createMetricPattern4(client, _m(acc, "pct25")), + costBasisPct30: createMetricPattern4(client, _m(acc, "pct30")), + costBasisPct35: createMetricPattern4(client, _m(acc, "pct35")), + costBasisPct40: createMetricPattern4(client, _m(acc, "pct40")), + costBasisPct45: createMetricPattern4(client, _m(acc, "pct45")), + costBasisPct50: createMetricPattern4(client, _m(acc, "pct50")), + costBasisPct55: createMetricPattern4(client, _m(acc, "pct55")), + costBasisPct60: createMetricPattern4(client, _m(acc, "pct60")), + costBasisPct65: createMetricPattern4(client, _m(acc, "pct65")), + costBasisPct70: createMetricPattern4(client, _m(acc, "pct70")), + costBasisPct75: createMetricPattern4(client, _m(acc, "pct75")), + costBasisPct80: createMetricPattern4(client, _m(acc, "pct80")), + costBasisPct85: createMetricPattern4(client, _m(acc, "pct85")), + costBasisPct90: createMetricPattern4(client, _m(acc, "pct90")), + costBasisPct95: createMetricPattern4(client, _m(acc, "pct95")), + }; +} + /** * @typedef {Object} RelativePattern5 * @property {MetricPattern1} negUnrealizedLossRelToMarketCap @@ -2441,24 +2807,75 @@ function createActivePriceRatioPattern(client, acc) { */ function createRelativePattern5(client, acc) { return { - negUnrealizedLossRelToMarketCap: createMetricPattern1(client, _m(acc, 'neg_unrealized_loss_rel_to_market_cap')), - negUnrealizedLossRelToOwnMarketCap: createMetricPattern1(client, _m(acc, 'neg_unrealized_loss_rel_to_own_market_cap')), - negUnrealizedLossRelToOwnTotalUnrealizedPnl: createMetricPattern1(client, _m(acc, 'neg_unrealized_loss_rel_to_own_total_unrealized_pnl')), - netUnrealizedPnlRelToMarketCap: createMetricPattern1(client, _m(acc, 'net_unrealized_pnl_rel_to_market_cap')), - netUnrealizedPnlRelToOwnMarketCap: createMetricPattern1(client, _m(acc, 'net_unrealized_pnl_rel_to_own_market_cap')), - netUnrealizedPnlRelToOwnTotalUnrealizedPnl: createMetricPattern1(client, _m(acc, 'net_unrealized_pnl_rel_to_own_total_unrealized_pnl')), - nupl: createMetricPattern1(client, _m(acc, 'nupl')), - supplyInLossRelToCirculatingSupply: createMetricPattern1(client, _m(acc, 'supply_in_loss_rel_to_circulating_supply')), - supplyInLossRelToOwnSupply: createMetricPattern1(client, _m(acc, 'supply_in_loss_rel_to_own_supply')), - supplyInProfitRelToCirculatingSupply: createMetricPattern1(client, _m(acc, 'supply_in_profit_rel_to_circulating_supply')), - supplyInProfitRelToOwnSupply: createMetricPattern1(client, _m(acc, 'supply_in_profit_rel_to_own_supply')), - supplyRelToCirculatingSupply: createMetricPattern4(client, _m(acc, 'supply_rel_to_circulating_supply')), - unrealizedLossRelToMarketCap: createMetricPattern1(client, _m(acc, 'unrealized_loss_rel_to_market_cap')), - unrealizedLossRelToOwnMarketCap: createMetricPattern1(client, _m(acc, 'unrealized_loss_rel_to_own_market_cap')), - unrealizedLossRelToOwnTotalUnrealizedPnl: createMetricPattern1(client, _m(acc, 'unrealized_loss_rel_to_own_total_unrealized_pnl')), - unrealizedProfitRelToMarketCap: createMetricPattern1(client, _m(acc, 'unrealized_profit_rel_to_market_cap')), - unrealizedProfitRelToOwnMarketCap: createMetricPattern1(client, _m(acc, 'unrealized_profit_rel_to_own_market_cap')), - unrealizedProfitRelToOwnTotalUnrealizedPnl: createMetricPattern1(client, _m(acc, 'unrealized_profit_rel_to_own_total_unrealized_pnl')), + negUnrealizedLossRelToMarketCap: createMetricPattern1( + client, + _m(acc, "neg_unrealized_loss_rel_to_market_cap"), + ), + negUnrealizedLossRelToOwnMarketCap: createMetricPattern1( + client, + _m(acc, "neg_unrealized_loss_rel_to_own_market_cap"), + ), + negUnrealizedLossRelToOwnTotalUnrealizedPnl: createMetricPattern1( + client, + _m(acc, "neg_unrealized_loss_rel_to_own_total_unrealized_pnl"), + ), + netUnrealizedPnlRelToMarketCap: createMetricPattern1( + client, + _m(acc, "net_unrealized_pnl_rel_to_market_cap"), + ), + netUnrealizedPnlRelToOwnMarketCap: createMetricPattern1( + client, + _m(acc, "net_unrealized_pnl_rel_to_own_market_cap"), + ), + netUnrealizedPnlRelToOwnTotalUnrealizedPnl: createMetricPattern1( + client, + _m(acc, "net_unrealized_pnl_rel_to_own_total_unrealized_pnl"), + ), + nupl: createMetricPattern1(client, _m(acc, "nupl")), + supplyInLossRelToCirculatingSupply: createMetricPattern1( + client, + _m(acc, "supply_in_loss_rel_to_circulating_supply"), + ), + supplyInLossRelToOwnSupply: createMetricPattern1( + client, + _m(acc, "supply_in_loss_rel_to_own_supply"), + ), + supplyInProfitRelToCirculatingSupply: createMetricPattern1( + client, + _m(acc, "supply_in_profit_rel_to_circulating_supply"), + ), + supplyInProfitRelToOwnSupply: createMetricPattern1( + client, + _m(acc, "supply_in_profit_rel_to_own_supply"), + ), + supplyRelToCirculatingSupply: createMetricPattern4( + client, + _m(acc, "supply_rel_to_circulating_supply"), + ), + unrealizedLossRelToMarketCap: createMetricPattern1( + client, + _m(acc, "unrealized_loss_rel_to_market_cap"), + ), + unrealizedLossRelToOwnMarketCap: createMetricPattern1( + client, + _m(acc, "unrealized_loss_rel_to_own_market_cap"), + ), + unrealizedLossRelToOwnTotalUnrealizedPnl: createMetricPattern1( + client, + _m(acc, "unrealized_loss_rel_to_own_total_unrealized_pnl"), + ), + unrealizedProfitRelToMarketCap: createMetricPattern1( + client, + _m(acc, "unrealized_profit_rel_to_market_cap"), + ), + unrealizedProfitRelToOwnMarketCap: createMetricPattern1( + client, + _m(acc, "unrealized_profit_rel_to_own_market_cap"), + ), + unrealizedProfitRelToOwnTotalUnrealizedPnl: createMetricPattern1( + client, + _m(acc, "unrealized_profit_rel_to_own_total_unrealized_pnl"), + ), }; } @@ -2488,20 +2905,20 @@ function createRelativePattern5(client, acc) { */ function createAaopoolPattern(client, acc) { return { - _1mBlocksMined: createMetricPattern1(client, _m(acc, '1m_blocks_mined')), - _1mDominance: createMetricPattern1(client, _m(acc, '1m_dominance')), - _1wBlocksMined: createMetricPattern1(client, _m(acc, '1w_blocks_mined')), - _1wDominance: createMetricPattern1(client, _m(acc, '1w_dominance')), - _1yBlocksMined: createMetricPattern1(client, _m(acc, '1y_blocks_mined')), - _1yDominance: createMetricPattern1(client, _m(acc, '1y_dominance')), - _24hBlocksMined: createMetricPattern1(client, _m(acc, '24h_blocks_mined')), - _24hDominance: createMetricPattern1(client, _m(acc, '24h_dominance')), - blocksMined: createBlockCountPattern(client, _m(acc, 'blocks_mined')), - coinbase: createCoinbasePattern2(client, _m(acc, 'coinbase')), - daysSinceBlock: createMetricPattern4(client, _m(acc, 'days_since_block')), - dominance: createMetricPattern1(client, _m(acc, 'dominance')), - fee: createUnclaimedRewardsPattern(client, _m(acc, 'fee')), - subsidy: createUnclaimedRewardsPattern(client, _m(acc, 'subsidy')), + _1mBlocksMined: createMetricPattern1(client, _m(acc, "1m_blocks_mined")), + _1mDominance: createMetricPattern1(client, _m(acc, "1m_dominance")), + _1wBlocksMined: createMetricPattern1(client, _m(acc, "1w_blocks_mined")), + _1wDominance: createMetricPattern1(client, _m(acc, "1w_dominance")), + _1yBlocksMined: createMetricPattern1(client, _m(acc, "1y_blocks_mined")), + _1yDominance: createMetricPattern1(client, _m(acc, "1y_dominance")), + _24hBlocksMined: createMetricPattern1(client, _m(acc, "24h_blocks_mined")), + _24hDominance: createMetricPattern1(client, _m(acc, "24h_dominance")), + blocksMined: createBlockCountPattern(client, _m(acc, "blocks_mined")), + coinbase: createCoinbasePattern2(client, _m(acc, "coinbase")), + daysSinceBlock: createMetricPattern4(client, _m(acc, "days_since_block")), + dominance: createMetricPattern1(client, _m(acc, "dominance")), + fee: createUnclaimedRewardsPattern(client, _m(acc, "fee")), + subsidy: createUnclaimedRewardsPattern(client, _m(acc, "subsidy")), }; } @@ -2572,18 +2989,18 @@ function createPriceAgoPattern(client, basePath) { */ function createPeriodLumpSumStackPattern(client, acc) { return { - _10y: create_2015Pattern(client, (acc ? `10y_${acc}` : '10y')), - _1m: create_2015Pattern(client, (acc ? `1m_${acc}` : '1m')), - _1w: create_2015Pattern(client, (acc ? `1w_${acc}` : '1w')), - _1y: create_2015Pattern(client, (acc ? `1y_${acc}` : '1y')), - _2y: create_2015Pattern(client, (acc ? `2y_${acc}` : '2y')), - _3m: create_2015Pattern(client, (acc ? `3m_${acc}` : '3m')), - _3y: create_2015Pattern(client, (acc ? `3y_${acc}` : '3y')), - _4y: create_2015Pattern(client, (acc ? `4y_${acc}` : '4y')), - _5y: create_2015Pattern(client, (acc ? `5y_${acc}` : '5y')), - _6m: create_2015Pattern(client, (acc ? `6m_${acc}` : '6m')), - _6y: create_2015Pattern(client, (acc ? `6y_${acc}` : '6y')), - _8y: create_2015Pattern(client, (acc ? `8y_${acc}` : '8y')), + _10y: create_2015Pattern(client, acc ? `10y_${acc}` : "10y"), + _1m: create_2015Pattern(client, acc ? `1m_${acc}` : "1m"), + _1w: create_2015Pattern(client, acc ? `1w_${acc}` : "1w"), + _1y: create_2015Pattern(client, acc ? `1y_${acc}` : "1y"), + _2y: create_2015Pattern(client, acc ? `2y_${acc}` : "2y"), + _3m: create_2015Pattern(client, acc ? `3m_${acc}` : "3m"), + _3y: create_2015Pattern(client, acc ? `3y_${acc}` : "3y"), + _4y: create_2015Pattern(client, acc ? `4y_${acc}` : "4y"), + _5y: create_2015Pattern(client, acc ? `5y_${acc}` : "5y"), + _6m: create_2015Pattern(client, acc ? `6m_${acc}` : "6m"), + _6y: create_2015Pattern(client, acc ? `6y_${acc}` : "6y"), + _8y: create_2015Pattern(client, acc ? `8y_${acc}` : "8y"), }; } @@ -2613,18 +3030,57 @@ function createPeriodLumpSumStackPattern(client, acc) { */ function createPeriodAveragePricePattern(client, acc) { return { - _10y: createMetricPattern4(client, (acc ? `10y_${acc}` : '10y')), - _1m: createMetricPattern4(client, (acc ? `1m_${acc}` : '1m')), - _1w: createMetricPattern4(client, (acc ? `1w_${acc}` : '1w')), - _1y: createMetricPattern4(client, (acc ? `1y_${acc}` : '1y')), - _2y: createMetricPattern4(client, (acc ? `2y_${acc}` : '2y')), - _3m: createMetricPattern4(client, (acc ? `3m_${acc}` : '3m')), - _3y: createMetricPattern4(client, (acc ? `3y_${acc}` : '3y')), - _4y: createMetricPattern4(client, (acc ? `4y_${acc}` : '4y')), - _5y: createMetricPattern4(client, (acc ? `5y_${acc}` : '5y')), - _6m: createMetricPattern4(client, (acc ? `6m_${acc}` : '6m')), - _6y: createMetricPattern4(client, (acc ? `6y_${acc}` : '6y')), - _8y: createMetricPattern4(client, (acc ? `8y_${acc}` : '8y')), + _10y: createMetricPattern4(client, acc ? `10y_${acc}` : "10y"), + _1m: createMetricPattern4(client, acc ? `1m_${acc}` : "1m"), + _1w: createMetricPattern4(client, acc ? `1w_${acc}` : "1w"), + _1y: createMetricPattern4(client, acc ? `1y_${acc}` : "1y"), + _2y: createMetricPattern4(client, acc ? `2y_${acc}` : "2y"), + _3m: createMetricPattern4(client, acc ? `3m_${acc}` : "3m"), + _3y: createMetricPattern4(client, acc ? `3y_${acc}` : "3y"), + _4y: createMetricPattern4(client, acc ? `4y_${acc}` : "4y"), + _5y: createMetricPattern4(client, acc ? `5y_${acc}` : "5y"), + _6m: createMetricPattern4(client, acc ? `6m_${acc}` : "6m"), + _6y: createMetricPattern4(client, acc ? `6y_${acc}` : "6y"), + _8y: createMetricPattern4(client, acc ? `8y_${acc}` : "8y"), + }; +} + +/** + * @template T + * @typedef {Object} FullnessPattern + * @property {MetricPattern2} average + * @property {MetricPattern11} base + * @property {MetricPattern2} cumulative + * @property {MetricPattern2} max + * @property {MetricPattern6} median + * @property {MetricPattern2} min + * @property {MetricPattern6} pct10 + * @property {MetricPattern6} pct25 + * @property {MetricPattern6} pct75 + * @property {MetricPattern6} pct90 + * @property {MetricPattern2} sum + */ + +/** + * Create a FullnessPattern pattern node + * @template T + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {FullnessPattern} + */ +function createFullnessPattern(client, acc) { + return { + average: createMetricPattern2(client, _m(acc, "average")), + base: createMetricPattern11(client, acc), + cumulative: createMetricPattern2(client, _m(acc, "cumulative")), + max: createMetricPattern2(client, _m(acc, "max")), + median: createMetricPattern6(client, _m(acc, "median")), + min: createMetricPattern2(client, _m(acc, "min")), + pct10: createMetricPattern6(client, _m(acc, "pct10")), + pct25: createMetricPattern6(client, _m(acc, "pct25")), + pct75: createMetricPattern6(client, _m(acc, "pct75")), + pct90: createMetricPattern6(client, _m(acc, "pct90")), + sum: createMetricPattern2(client, _m(acc, "sum")), }; } @@ -2692,56 +3148,17 @@ function createClassAveragePricePattern(client, basePath) { */ function createDollarsPattern(client, acc) { return { - average: createMetricPattern2(client, _m(acc, 'average')), + average: createMetricPattern2(client, _m(acc, "average")), base: createMetricPattern11(client, acc), - cumulative: createMetricPattern1(client, _m(acc, 'cumulative')), - max: createMetricPattern2(client, _m(acc, 'max')), - median: createMetricPattern6(client, _m(acc, 'median')), - min: createMetricPattern2(client, _m(acc, 'min')), - pct10: createMetricPattern6(client, _m(acc, 'pct10')), - pct25: createMetricPattern6(client, _m(acc, 'pct25')), - pct75: createMetricPattern6(client, _m(acc, 'pct75')), - pct90: createMetricPattern6(client, _m(acc, 'pct90')), - sum: createMetricPattern2(client, _m(acc, 'sum')), - }; -} - -/** - * @template T - * @typedef {Object} FullnessPattern - * @property {MetricPattern2} average - * @property {MetricPattern11} base - * @property {MetricPattern2} cumulative - * @property {MetricPattern2} max - * @property {MetricPattern6} median - * @property {MetricPattern2} min - * @property {MetricPattern6} pct10 - * @property {MetricPattern6} pct25 - * @property {MetricPattern6} pct75 - * @property {MetricPattern6} pct90 - * @property {MetricPattern2} sum - */ - -/** - * Create a FullnessPattern pattern node - * @template T - * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name - * @returns {FullnessPattern} - */ -function createFullnessPattern(client, acc) { - return { - average: createMetricPattern2(client, _m(acc, 'average')), - base: createMetricPattern11(client, acc), - cumulative: createMetricPattern2(client, _m(acc, 'cumulative')), - max: createMetricPattern2(client, _m(acc, 'max')), - median: createMetricPattern6(client, _m(acc, 'median')), - min: createMetricPattern2(client, _m(acc, 'min')), - pct10: createMetricPattern6(client, _m(acc, 'pct10')), - pct25: createMetricPattern6(client, _m(acc, 'pct25')), - pct75: createMetricPattern6(client, _m(acc, 'pct75')), - pct90: createMetricPattern6(client, _m(acc, 'pct90')), - sum: createMetricPattern2(client, _m(acc, 'sum')), + cumulative: createMetricPattern1(client, _m(acc, "cumulative")), + max: createMetricPattern2(client, _m(acc, "max")), + median: createMetricPattern6(client, _m(acc, "median")), + min: createMetricPattern2(client, _m(acc, "min")), + pct10: createMetricPattern6(client, _m(acc, "pct10")), + pct25: createMetricPattern6(client, _m(acc, "pct25")), + pct75: createMetricPattern6(client, _m(acc, "pct75")), + pct90: createMetricPattern6(client, _m(acc, "pct90")), + sum: createMetricPattern2(client, _m(acc, "sum")), }; } @@ -2767,16 +3184,46 @@ function createFullnessPattern(client, acc) { */ function createRelativePattern2(client, acc) { return { - negUnrealizedLossRelToOwnMarketCap: createMetricPattern1(client, _m(acc, 'neg_unrealized_loss_rel_to_own_market_cap')), - negUnrealizedLossRelToOwnTotalUnrealizedPnl: createMetricPattern1(client, _m(acc, 'neg_unrealized_loss_rel_to_own_total_unrealized_pnl')), - netUnrealizedPnlRelToOwnMarketCap: createMetricPattern1(client, _m(acc, 'net_unrealized_pnl_rel_to_own_market_cap')), - netUnrealizedPnlRelToOwnTotalUnrealizedPnl: createMetricPattern1(client, _m(acc, 'net_unrealized_pnl_rel_to_own_total_unrealized_pnl')), - supplyInLossRelToOwnSupply: createMetricPattern1(client, _m(acc, 'supply_in_loss_rel_to_own_supply')), - supplyInProfitRelToOwnSupply: createMetricPattern1(client, _m(acc, 'supply_in_profit_rel_to_own_supply')), - unrealizedLossRelToOwnMarketCap: createMetricPattern1(client, _m(acc, 'unrealized_loss_rel_to_own_market_cap')), - unrealizedLossRelToOwnTotalUnrealizedPnl: createMetricPattern1(client, _m(acc, 'unrealized_loss_rel_to_own_total_unrealized_pnl')), - unrealizedProfitRelToOwnMarketCap: createMetricPattern1(client, _m(acc, 'unrealized_profit_rel_to_own_market_cap')), - unrealizedProfitRelToOwnTotalUnrealizedPnl: createMetricPattern1(client, _m(acc, 'unrealized_profit_rel_to_own_total_unrealized_pnl')), + negUnrealizedLossRelToOwnMarketCap: createMetricPattern1( + client, + _m(acc, "neg_unrealized_loss_rel_to_own_market_cap"), + ), + negUnrealizedLossRelToOwnTotalUnrealizedPnl: createMetricPattern1( + client, + _m(acc, "neg_unrealized_loss_rel_to_own_total_unrealized_pnl"), + ), + netUnrealizedPnlRelToOwnMarketCap: createMetricPattern1( + client, + _m(acc, "net_unrealized_pnl_rel_to_own_market_cap"), + ), + netUnrealizedPnlRelToOwnTotalUnrealizedPnl: createMetricPattern1( + client, + _m(acc, "net_unrealized_pnl_rel_to_own_total_unrealized_pnl"), + ), + supplyInLossRelToOwnSupply: createMetricPattern1( + client, + _m(acc, "supply_in_loss_rel_to_own_supply"), + ), + supplyInProfitRelToOwnSupply: createMetricPattern1( + client, + _m(acc, "supply_in_profit_rel_to_own_supply"), + ), + unrealizedLossRelToOwnMarketCap: createMetricPattern1( + client, + _m(acc, "unrealized_loss_rel_to_own_market_cap"), + ), + unrealizedLossRelToOwnTotalUnrealizedPnl: createMetricPattern1( + client, + _m(acc, "unrealized_loss_rel_to_own_total_unrealized_pnl"), + ), + unrealizedProfitRelToOwnMarketCap: createMetricPattern1( + client, + _m(acc, "unrealized_profit_rel_to_own_market_cap"), + ), + unrealizedProfitRelToOwnTotalUnrealizedPnl: createMetricPattern1( + client, + _m(acc, "unrealized_profit_rel_to_own_total_unrealized_pnl"), + ), }; } @@ -2802,16 +3249,43 @@ function createRelativePattern2(client, acc) { */ function createRelativePattern(client, acc) { return { - negUnrealizedLossRelToMarketCap: createMetricPattern1(client, _m(acc, 'neg_unrealized_loss_rel_to_market_cap')), - netUnrealizedPnlRelToMarketCap: createMetricPattern1(client, _m(acc, 'net_unrealized_pnl_rel_to_market_cap')), - nupl: createMetricPattern1(client, _m(acc, 'nupl')), - supplyInLossRelToCirculatingSupply: createMetricPattern1(client, _m(acc, 'supply_in_loss_rel_to_circulating_supply')), - supplyInLossRelToOwnSupply: createMetricPattern1(client, _m(acc, 'supply_in_loss_rel_to_own_supply')), - supplyInProfitRelToCirculatingSupply: createMetricPattern1(client, _m(acc, 'supply_in_profit_rel_to_circulating_supply')), - supplyInProfitRelToOwnSupply: createMetricPattern1(client, _m(acc, 'supply_in_profit_rel_to_own_supply')), - supplyRelToCirculatingSupply: createMetricPattern4(client, _m(acc, 'supply_rel_to_circulating_supply')), - unrealizedLossRelToMarketCap: createMetricPattern1(client, _m(acc, 'unrealized_loss_rel_to_market_cap')), - unrealizedProfitRelToMarketCap: createMetricPattern1(client, _m(acc, 'unrealized_profit_rel_to_market_cap')), + negUnrealizedLossRelToMarketCap: createMetricPattern1( + client, + _m(acc, "neg_unrealized_loss_rel_to_market_cap"), + ), + netUnrealizedPnlRelToMarketCap: createMetricPattern1( + client, + _m(acc, "net_unrealized_pnl_rel_to_market_cap"), + ), + nupl: createMetricPattern1(client, _m(acc, "nupl")), + supplyInLossRelToCirculatingSupply: createMetricPattern1( + client, + _m(acc, "supply_in_loss_rel_to_circulating_supply"), + ), + supplyInLossRelToOwnSupply: createMetricPattern1( + client, + _m(acc, "supply_in_loss_rel_to_own_supply"), + ), + supplyInProfitRelToCirculatingSupply: createMetricPattern1( + client, + _m(acc, "supply_in_profit_rel_to_circulating_supply"), + ), + supplyInProfitRelToOwnSupply: createMetricPattern1( + client, + _m(acc, "supply_in_profit_rel_to_own_supply"), + ), + supplyRelToCirculatingSupply: createMetricPattern4( + client, + _m(acc, "supply_rel_to_circulating_supply"), + ), + unrealizedLossRelToMarketCap: createMetricPattern1( + client, + _m(acc, "unrealized_loss_rel_to_market_cap"), + ), + unrealizedProfitRelToMarketCap: createMetricPattern1( + client, + _m(acc, "unrealized_profit_rel_to_market_cap"), + ), }; } @@ -2839,16 +3313,16 @@ function createRelativePattern(client, acc) { */ function createCountPattern2(client, acc) { return { - average: createMetricPattern1(client, _m(acc, 'average')), - cumulative: createMetricPattern1(client, _m(acc, 'cumulative')), - max: createMetricPattern1(client, _m(acc, 'max')), - median: createMetricPattern11(client, _m(acc, 'median')), - min: createMetricPattern1(client, _m(acc, 'min')), - pct10: createMetricPattern11(client, _m(acc, 'pct10')), - pct25: createMetricPattern11(client, _m(acc, 'pct25')), - pct75: createMetricPattern11(client, _m(acc, 'pct75')), - pct90: createMetricPattern11(client, _m(acc, 'pct90')), - sum: createMetricPattern1(client, _m(acc, 'sum')), + average: createMetricPattern1(client, _m(acc, "average")), + cumulative: createMetricPattern1(client, _m(acc, "cumulative")), + max: createMetricPattern1(client, _m(acc, "max")), + median: createMetricPattern11(client, _m(acc, "median")), + min: createMetricPattern1(client, _m(acc, "min")), + pct10: createMetricPattern11(client, _m(acc, "pct10")), + pct25: createMetricPattern11(client, _m(acc, "pct25")), + pct75: createMetricPattern11(client, _m(acc, "pct75")), + pct90: createMetricPattern11(client, _m(acc, "pct90")), + sum: createMetricPattern1(client, _m(acc, "sum")), }; } @@ -2908,14 +3382,14 @@ function createAddrCountPattern(client, basePath) { */ function createFeeRatePattern(client, acc) { return { - average: createMetricPattern1(client, _m(acc, 'average')), - max: createMetricPattern1(client, _m(acc, 'max')), - median: createMetricPattern11(client, _m(acc, 'median')), - min: createMetricPattern1(client, _m(acc, 'min')), - pct10: createMetricPattern11(client, _m(acc, 'pct10')), - pct25: createMetricPattern11(client, _m(acc, 'pct25')), - pct75: createMetricPattern11(client, _m(acc, 'pct75')), - pct90: createMetricPattern11(client, _m(acc, 'pct90')), + average: createMetricPattern1(client, _m(acc, "average")), + max: createMetricPattern1(client, _m(acc, "max")), + median: createMetricPattern11(client, _m(acc, "median")), + min: createMetricPattern1(client, _m(acc, "min")), + pct10: createMetricPattern11(client, _m(acc, "pct10")), + pct25: createMetricPattern11(client, _m(acc, "pct25")), + pct75: createMetricPattern11(client, _m(acc, "pct75")), + pct90: createMetricPattern11(client, _m(acc, "pct90")), txindex: createMetricPattern27(client, acc), }; } @@ -2941,70 +3415,41 @@ function createFeeRatePattern(client, acc) { function create_0satsPattern(client, acc) { return { activity: createActivityPattern2(client, acc), - addrCount: createMetricPattern1(client, _m(acc, 'addr_count')), + addrCount: createMetricPattern1(client, _m(acc, "addr_count")), costBasis: createCostBasisPattern(client, acc), outputs: createOutputsPattern(client, acc), realized: createRealizedPattern(client, acc), relative: createRelativePattern(client, acc), - supply: createSupplyPattern2(client, _m(acc, 'supply')), + supply: createSupplyPattern2(client, _m(acc, "supply")), unrealized: createUnrealizedPattern(client, acc), }; } /** - * @typedef {Object} _0satsPattern2 + * @typedef {Object} _10yTo12yPattern * @property {ActivityPattern2} activity - * @property {CostBasisPattern} costBasis + * @property {CostBasisPattern2} costBasis * @property {OutputsPattern} outputs - * @property {RealizedPattern} realized - * @property {RelativePattern4} relative + * @property {RealizedPattern2} realized + * @property {RelativePattern2} relative * @property {SupplyPattern2} supply * @property {UnrealizedPattern} unrealized */ /** - * Create a _0satsPattern2 pattern node + * Create a _10yTo12yPattern pattern node * @param {BrkClientBase} client * @param {string} acc - Accumulated metric name - * @returns {_0satsPattern2} + * @returns {_10yTo12yPattern} */ -function create_0satsPattern2(client, acc) { +function create_10yTo12yPattern(client, acc) { return { activity: createActivityPattern2(client, acc), - costBasis: createCostBasisPattern(client, acc), + costBasis: createCostBasisPattern2(client, acc), outputs: createOutputsPattern(client, acc), - realized: createRealizedPattern(client, acc), - relative: createRelativePattern4(client, _m(acc, 'supply_in')), - supply: createSupplyPattern2(client, _m(acc, 'supply')), - unrealized: createUnrealizedPattern(client, acc), - }; -} - -/** - * @typedef {Object} _100btcPattern - * @property {ActivityPattern2} activity - * @property {CostBasisPattern} costBasis - * @property {OutputsPattern} outputs - * @property {RealizedPattern} realized - * @property {RelativePattern} relative - * @property {SupplyPattern2} supply - * @property {UnrealizedPattern} unrealized - */ - -/** - * Create a _100btcPattern pattern node - * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name - * @returns {_100btcPattern} - */ -function create_100btcPattern(client, acc) { - return { - activity: createActivityPattern2(client, acc), - costBasis: createCostBasisPattern(client, acc), - outputs: createOutputsPattern(client, acc), - realized: createRealizedPattern(client, acc), - relative: createRelativePattern(client, acc), - supply: createSupplyPattern2(client, _m(acc, 'supply')), + realized: createRealizedPattern2(client, acc), + relative: createRelativePattern2(client, acc), + supply: createSupplyPattern2(client, _m(acc, "supply")), unrealized: createUnrealizedPattern(client, acc), }; } @@ -3033,65 +3478,7 @@ function create_10yPattern(client, acc) { outputs: createOutputsPattern(client, acc), realized: createRealizedPattern4(client, acc), relative: createRelativePattern(client, acc), - supply: createSupplyPattern2(client, _m(acc, 'supply')), - unrealized: createUnrealizedPattern(client, acc), - }; -} - -/** - * @typedef {Object} PeriodCagrPattern - * @property {MetricPattern4} _10y - * @property {MetricPattern4} _2y - * @property {MetricPattern4} _3y - * @property {MetricPattern4} _4y - * @property {MetricPattern4} _5y - * @property {MetricPattern4} _6y - * @property {MetricPattern4} _8y - */ - -/** - * Create a PeriodCagrPattern pattern node - * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name - * @returns {PeriodCagrPattern} - */ -function createPeriodCagrPattern(client, acc) { - return { - _10y: createMetricPattern4(client, (acc ? `10y_${acc}` : '10y')), - _2y: createMetricPattern4(client, (acc ? `2y_${acc}` : '2y')), - _3y: createMetricPattern4(client, (acc ? `3y_${acc}` : '3y')), - _4y: createMetricPattern4(client, (acc ? `4y_${acc}` : '4y')), - _5y: createMetricPattern4(client, (acc ? `5y_${acc}` : '5y')), - _6y: createMetricPattern4(client, (acc ? `6y_${acc}` : '6y')), - _8y: createMetricPattern4(client, (acc ? `8y_${acc}` : '8y')), - }; -} - -/** - * @typedef {Object} _10yTo12yPattern - * @property {ActivityPattern2} activity - * @property {CostBasisPattern2} costBasis - * @property {OutputsPattern} outputs - * @property {RealizedPattern2} realized - * @property {RelativePattern2} relative - * @property {SupplyPattern2} supply - * @property {UnrealizedPattern} unrealized - */ - -/** - * Create a _10yTo12yPattern pattern node - * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name - * @returns {_10yTo12yPattern} - */ -function create_10yTo12yPattern(client, acc) { - return { - activity: createActivityPattern2(client, acc), - costBasis: createCostBasisPattern2(client, acc), - outputs: createOutputsPattern(client, acc), - realized: createRealizedPattern2(client, acc), - relative: createRelativePattern2(client, acc), - supply: createSupplyPattern2(client, _m(acc, 'supply')), + supply: createSupplyPattern2(client, _m(acc, "supply")), unrealized: createUnrealizedPattern(client, acc), }; } @@ -3115,13 +3502,115 @@ function create_10yTo12yPattern(client, acc) { */ function createUnrealizedPattern(client, acc) { return { - negUnrealizedLoss: createMetricPattern1(client, _m(acc, 'neg_unrealized_loss')), - netUnrealizedPnl: createMetricPattern1(client, _m(acc, 'net_unrealized_pnl')), - supplyInLoss: createActiveSupplyPattern(client, _m(acc, 'supply_in_loss')), - supplyInProfit: createActiveSupplyPattern(client, _m(acc, 'supply_in_profit')), - totalUnrealizedPnl: createMetricPattern1(client, _m(acc, 'total_unrealized_pnl')), - unrealizedLoss: createMetricPattern1(client, _m(acc, 'unrealized_loss')), - unrealizedProfit: createMetricPattern1(client, _m(acc, 'unrealized_profit')), + negUnrealizedLoss: createMetricPattern1( + client, + _m(acc, "neg_unrealized_loss"), + ), + netUnrealizedPnl: createMetricPattern1( + client, + _m(acc, "net_unrealized_pnl"), + ), + supplyInLoss: createActiveSupplyPattern(client, _m(acc, "supply_in_loss")), + supplyInProfit: createActiveSupplyPattern( + client, + _m(acc, "supply_in_profit"), + ), + totalUnrealizedPnl: createMetricPattern1( + client, + _m(acc, "total_unrealized_pnl"), + ), + unrealizedLoss: createMetricPattern1(client, _m(acc, "unrealized_loss")), + unrealizedProfit: createMetricPattern1( + client, + _m(acc, "unrealized_profit"), + ), + }; +} + +/** + * @typedef {Object} _0satsPattern2 + * @property {ActivityPattern2} activity + * @property {CostBasisPattern} costBasis + * @property {OutputsPattern} outputs + * @property {RealizedPattern} realized + * @property {RelativePattern4} relative + * @property {SupplyPattern2} supply + * @property {UnrealizedPattern} unrealized + */ + +/** + * Create a _0satsPattern2 pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {_0satsPattern2} + */ +function create_0satsPattern2(client, acc) { + return { + activity: createActivityPattern2(client, acc), + costBasis: createCostBasisPattern(client, acc), + outputs: createOutputsPattern(client, acc), + realized: createRealizedPattern(client, acc), + relative: createRelativePattern4(client, _m(acc, "supply_in")), + supply: createSupplyPattern2(client, _m(acc, "supply")), + unrealized: createUnrealizedPattern(client, acc), + }; +} + +/** + * @typedef {Object} _100btcPattern + * @property {ActivityPattern2} activity + * @property {CostBasisPattern} costBasis + * @property {OutputsPattern} outputs + * @property {RealizedPattern} realized + * @property {RelativePattern} relative + * @property {SupplyPattern2} supply + * @property {UnrealizedPattern} unrealized + */ + +/** + * Create a _100btcPattern pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {_100btcPattern} + */ +function create_100btcPattern(client, acc) { + return { + activity: createActivityPattern2(client, acc), + costBasis: createCostBasisPattern(client, acc), + outputs: createOutputsPattern(client, acc), + realized: createRealizedPattern(client, acc), + relative: createRelativePattern(client, acc), + supply: createSupplyPattern2(client, _m(acc, "supply")), + unrealized: createUnrealizedPattern(client, acc), + }; +} + +/** + * @typedef {Object} PeriodCagrPattern + * @property {MetricPattern4} _10y + * @property {MetricPattern4} _2y + * @property {MetricPattern4} _3y + * @property {MetricPattern4} _4y + * @property {MetricPattern4} _5y + * @property {MetricPattern4} _6y + * @property {MetricPattern4} _8y + */ + +/** + * Create a PeriodCagrPattern pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {PeriodCagrPattern} + */ +function createPeriodCagrPattern(client, acc) { + return { + _10y: createMetricPattern4(client, acc ? `10y_${acc}` : "10y"), + _2y: createMetricPattern4(client, acc ? `2y_${acc}` : "2y"), + _3y: createMetricPattern4(client, acc ? `3y_${acc}` : "3y"), + _4y: createMetricPattern4(client, acc ? `4y_${acc}` : "4y"), + _5y: createMetricPattern4(client, acc ? `5y_${acc}` : "5y"), + _6y: createMetricPattern4(client, acc ? `6y_${acc}` : "6y"), + _8y: createMetricPattern4(client, acc ? `8y_${acc}` : "8y"), }; } @@ -3142,11 +3631,23 @@ function createUnrealizedPattern(client, acc) { */ function createActivityPattern2(client, acc) { return { - coinblocksDestroyed: createBlockCountPattern(client, _m(acc, 'coinblocks_destroyed')), - coindaysDestroyed: createBlockCountPattern(client, _m(acc, 'coindays_destroyed')), - satblocksDestroyed: createMetricPattern11(client, _m(acc, 'satblocks_destroyed')), - satdaysDestroyed: createMetricPattern11(client, _m(acc, 'satdays_destroyed')), - sent: createUnclaimedRewardsPattern(client, _m(acc, 'sent')), + coinblocksDestroyed: createBlockCountPattern( + client, + _m(acc, "coinblocks_destroyed"), + ), + coindaysDestroyed: createBlockCountPattern( + client, + _m(acc, "coindays_destroyed"), + ), + satblocksDestroyed: createMetricPattern11( + client, + _m(acc, "satblocks_destroyed"), + ), + satdaysDestroyed: createMetricPattern11( + client, + _m(acc, "satdays_destroyed"), + ), + sent: createUnclaimedRewardsPattern(client, _m(acc, "sent")), }; } @@ -3168,10 +3669,136 @@ function createActivityPattern2(client, acc) { */ function createSplitPattern2(client, acc) { return { - close: createMetricPattern1(client, _m(acc, 'close')), - high: createMetricPattern1(client, _m(acc, 'high')), - low: createMetricPattern1(client, _m(acc, 'low')), - open: createMetricPattern1(client, _m(acc, 'open')), + close: createMetricPattern1(client, _m(acc, "close")), + high: createMetricPattern1(client, _m(acc, "high")), + low: createMetricPattern1(client, _m(acc, "low")), + open: createMetricPattern1(client, _m(acc, "open")), + }; +} + +/** + * @typedef {Object} UnclaimedRewardsPattern + * @property {BitcoinPattern} bitcoin + * @property {BlockCountPattern} dollars + * @property {BlockCountPattern} sats + */ + +/** + * Create a UnclaimedRewardsPattern pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {UnclaimedRewardsPattern} + */ +function createUnclaimedRewardsPattern(client, acc) { + return { + bitcoin: createBitcoinPattern(client, _m(acc, "btc")), + dollars: createBlockCountPattern(client, _m(acc, "usd")), + sats: createBlockCountPattern(client, acc), + }; +} + +/** + * @typedef {Object} ActiveSupplyPattern + * @property {MetricPattern1} bitcoin + * @property {MetricPattern1} dollars + * @property {MetricPattern1} sats + */ + +/** + * Create a ActiveSupplyPattern pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {ActiveSupplyPattern} + */ +function createActiveSupplyPattern(client, acc) { + return { + bitcoin: createMetricPattern1(client, _m(acc, "btc")), + dollars: createMetricPattern1(client, _m(acc, "usd")), + sats: createMetricPattern1(client, acc), + }; +} + +/** + * @typedef {Object} CoinbasePattern + * @property {FullnessPattern} bitcoin + * @property {DollarsPattern} dollars + * @property {DollarsPattern} sats + */ + +/** + * Create a CoinbasePattern pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {CoinbasePattern} + */ +function createCoinbasePattern(client, acc) { + return { + bitcoin: createFullnessPattern(client, _m(acc, "btc")), + dollars: createDollarsPattern(client, _m(acc, "usd")), + sats: createDollarsPattern(client, acc), + }; +} + +/** + * @typedef {Object} SegwitAdoptionPattern + * @property {MetricPattern11} base + * @property {MetricPattern2} cumulative + * @property {MetricPattern2} sum + */ + +/** + * Create a SegwitAdoptionPattern pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {SegwitAdoptionPattern} + */ +function createSegwitAdoptionPattern(client, acc) { + return { + base: createMetricPattern11(client, acc), + cumulative: createMetricPattern2(client, _m(acc, "cumulative")), + sum: createMetricPattern2(client, _m(acc, "sum")), + }; +} + +/** + * @typedef {Object} _2015Pattern + * @property {MetricPattern4} bitcoin + * @property {MetricPattern4} dollars + * @property {MetricPattern4} sats + */ + +/** + * Create a _2015Pattern pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {_2015Pattern} + */ +function create_2015Pattern(client, acc) { + return { + bitcoin: createMetricPattern4(client, _m(acc, "btc")), + dollars: createMetricPattern4(client, _m(acc, "usd")), + sats: createMetricPattern4(client, acc), + }; +} + +/** + * @typedef {Object} CoinbasePattern2 + * @property {BlockCountPattern} bitcoin + * @property {BlockCountPattern} dollars + * @property {BlockCountPattern} sats + */ + +/** + * Create a CoinbasePattern2 pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {CoinbasePattern2} + */ +function createCoinbasePattern2(client, acc) { + return { + bitcoin: createBlockCountPattern(client, _m(acc, "btc")), + dollars: createBlockCountPattern(client, _m(acc, "usd")), + sats: createBlockCountPattern(client, acc), }; } @@ -3196,132 +3823,6 @@ function createCostBasisPattern2(client, basePath) { }; } -/** - * @typedef {Object} ActiveSupplyPattern - * @property {MetricPattern1} bitcoin - * @property {MetricPattern1} dollars - * @property {MetricPattern1} sats - */ - -/** - * Create a ActiveSupplyPattern pattern node - * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name - * @returns {ActiveSupplyPattern} - */ -function createActiveSupplyPattern(client, acc) { - return { - bitcoin: createMetricPattern1(client, _m(acc, 'btc')), - dollars: createMetricPattern1(client, _m(acc, 'usd')), - sats: createMetricPattern1(client, acc), - }; -} - -/** - * @typedef {Object} _2015Pattern - * @property {MetricPattern4} bitcoin - * @property {MetricPattern4} dollars - * @property {MetricPattern4} sats - */ - -/** - * Create a _2015Pattern pattern node - * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name - * @returns {_2015Pattern} - */ -function create_2015Pattern(client, acc) { - return { - bitcoin: createMetricPattern4(client, _m(acc, 'btc')), - dollars: createMetricPattern4(client, _m(acc, 'usd')), - sats: createMetricPattern4(client, acc), - }; -} - -/** - * @typedef {Object} CoinbasePattern2 - * @property {BlockCountPattern} bitcoin - * @property {BlockCountPattern} dollars - * @property {BlockCountPattern} sats - */ - -/** - * Create a CoinbasePattern2 pattern node - * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name - * @returns {CoinbasePattern2} - */ -function createCoinbasePattern2(client, acc) { - return { - bitcoin: createBlockCountPattern(client, _m(acc, 'btc')), - dollars: createBlockCountPattern(client, _m(acc, 'usd')), - sats: createBlockCountPattern(client, acc), - }; -} - -/** - * @typedef {Object} CoinbasePattern - * @property {FullnessPattern} bitcoin - * @property {DollarsPattern} dollars - * @property {DollarsPattern} sats - */ - -/** - * Create a CoinbasePattern pattern node - * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name - * @returns {CoinbasePattern} - */ -function createCoinbasePattern(client, acc) { - return { - bitcoin: createFullnessPattern(client, _m(acc, 'btc')), - dollars: createDollarsPattern(client, _m(acc, 'usd')), - sats: createDollarsPattern(client, acc), - }; -} - -/** - * @typedef {Object} SegwitAdoptionPattern - * @property {MetricPattern11} base - * @property {MetricPattern2} cumulative - * @property {MetricPattern2} sum - */ - -/** - * Create a SegwitAdoptionPattern pattern node - * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name - * @returns {SegwitAdoptionPattern} - */ -function createSegwitAdoptionPattern(client, acc) { - return { - base: createMetricPattern11(client, acc), - cumulative: createMetricPattern2(client, _m(acc, 'cumulative')), - sum: createMetricPattern2(client, _m(acc, 'sum')), - }; -} - -/** - * @typedef {Object} UnclaimedRewardsPattern - * @property {BitcoinPattern} bitcoin - * @property {BlockCountPattern} dollars - * @property {BlockCountPattern} sats - */ - -/** - * Create a UnclaimedRewardsPattern pattern node - * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name - * @returns {UnclaimedRewardsPattern} - */ -function createUnclaimedRewardsPattern(client, acc) { - return { - bitcoin: createBitcoinPattern(client, _m(acc, 'btc')), - dollars: createBlockCountPattern(client, _m(acc, 'usd')), - sats: createBlockCountPattern(client, acc), - }; -} - /** * @typedef {Object} CostBasisPattern * @property {MetricPattern1} max @@ -3336,8 +3837,8 @@ function createUnclaimedRewardsPattern(client, acc) { */ function createCostBasisPattern(client, acc) { return { - max: createMetricPattern1(client, _m(acc, 'max_cost_basis')), - min: createMetricPattern1(client, _m(acc, 'min_cost_basis')), + max: createMetricPattern1(client, _m(acc, "max_cost_basis")), + min: createMetricPattern1(client, _m(acc, "min_cost_basis")), }; } @@ -3355,27 +3856,8 @@ function createCostBasisPattern(client, acc) { */ function create_1dReturns1mSdPattern(client, acc) { return { - sd: createMetricPattern4(client, _m(acc, 'sd')), - sma: createMetricPattern4(client, _m(acc, 'sma')), - }; -} - -/** - * @typedef {Object} RelativePattern4 - * @property {MetricPattern1} supplyInLossRelToOwnSupply - * @property {MetricPattern1} supplyInProfitRelToOwnSupply - */ - -/** - * Create a RelativePattern4 pattern node - * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name - * @returns {RelativePattern4} - */ -function createRelativePattern4(client, acc) { - return { - supplyInLossRelToOwnSupply: createMetricPattern1(client, _m(acc, 'loss_rel_to_own_supply')), - supplyInProfitRelToOwnSupply: createMetricPattern1(client, _m(acc, 'profit_rel_to_own_supply')), + sd: createMetricPattern4(client, _m(acc, "sd")), + sma: createMetricPattern4(client, _m(acc, "sma")), }; } @@ -3393,11 +3875,78 @@ function createRelativePattern4(client, acc) { */ function createSupplyPattern2(client, acc) { return { - halved: createActiveSupplyPattern(client, _m(acc, 'half')), + halved: createActiveSupplyPattern(client, _m(acc, "half")), total: createActiveSupplyPattern(client, acc), }; } +/** + * @typedef {Object} RelativePattern4 + * @property {MetricPattern1} supplyInLossRelToOwnSupply + * @property {MetricPattern1} supplyInProfitRelToOwnSupply + */ + +/** + * Create a RelativePattern4 pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {RelativePattern4} + */ +function createRelativePattern4(client, acc) { + return { + supplyInLossRelToOwnSupply: createMetricPattern1( + client, + _m(acc, "loss_rel_to_own_supply"), + ), + supplyInProfitRelToOwnSupply: createMetricPattern1( + client, + _m(acc, "profit_rel_to_own_supply"), + ), + }; +} + +/** + * @template T + * @typedef {Object} BitcoinPattern + * @property {MetricPattern2} cumulative + * @property {MetricPattern1} sum + */ + +/** + * Create a BitcoinPattern pattern node + * @template T + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {BitcoinPattern} + */ +function createBitcoinPattern(client, acc) { + return { + cumulative: createMetricPattern2(client, _m(acc, "cumulative")), + sum: createMetricPattern1(client, acc), + }; +} + +/** + * @template T + * @typedef {Object} BlockCountPattern + * @property {MetricPattern1} cumulative + * @property {MetricPattern1} sum + */ + +/** + * Create a BlockCountPattern pattern node + * @template T + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {BlockCountPattern} + */ +function createBlockCountPattern(client, acc) { + return { + cumulative: createMetricPattern1(client, _m(acc, "cumulative")), + sum: createMetricPattern1(client, acc), + }; +} + /** * @template T * @typedef {Object} SatsPattern @@ -3419,48 +3968,6 @@ function createSatsPattern(client, basePath) { }; } -/** - * @template T - * @typedef {Object} BitcoinPattern - * @property {MetricPattern2} cumulative - * @property {MetricPattern1} sum - */ - -/** - * Create a BitcoinPattern pattern node - * @template T - * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name - * @returns {BitcoinPattern} - */ -function createBitcoinPattern(client, acc) { - return { - cumulative: createMetricPattern2(client, _m(acc, 'cumulative')), - sum: createMetricPattern1(client, acc), - }; -} - -/** - * @template T - * @typedef {Object} BlockCountPattern - * @property {MetricPattern1} cumulative - * @property {MetricPattern1} sum - */ - -/** - * Create a BlockCountPattern pattern node - * @template T - * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name - * @returns {BlockCountPattern} - */ -function createBlockCountPattern(client, acc) { - return { - cumulative: createMetricPattern1(client, _m(acc, 'cumulative')), - sum: createMetricPattern1(client, acc), - }; -} - /** * @typedef {Object} RealizedPriceExtraPattern * @property {MetricPattern4} ratio @@ -3474,7 +3981,7 @@ function createBlockCountPattern(client, acc) { */ function createRealizedPriceExtraPattern(client, acc) { return { - ratio: createMetricPattern4(client, _m(acc, 'ratio')), + ratio: createMetricPattern4(client, _m(acc, "ratio")), }; } @@ -3491,7 +3998,7 @@ function createRealizedPriceExtraPattern(client, acc) { */ function createOutputsPattern(client, acc) { return { - utxoCount: createMetricPattern1(client, _m(acc, 'utxo_count')), + utxoCount: createMetricPattern1(client, _m(acc, "utxo_count")), }; } @@ -4943,868 +5450,868 @@ class BrkClient extends BrkClientBase { "weekindex", "yearindex", "loadedaddressindex", - "emptyaddressindex" + "emptyaddressindex", ]); POOL_ID_TO_POOL_NAME = /** @type {const} */ ({ - "unknown": "Unknown", - "blockfills": "BlockFills", - "ultimuspool": "ULTIMUSPOOL", - "terrapool": "Terra Pool", - "luxor": "Luxor", - "onethash": "1THash", - "btccom": "BTC.com", - "bitfarms": "Bitfarms", - "huobipool": "Huobi.pool", - "wayicn": "WAYI.CN", - "canoepool": "CanoePool", - "btctop": "BTC.TOP", - "bitcoincom": "Bitcoin.com", - "pool175btc": "175btc", - "gbminers": "GBMiners", - "axbt": "A-XBT", - "asicminer": "ASICMiner", - "bitminter": "BitMinter", - "bitcoinrussia": "BitcoinRussia", - "btcserv": "BTCServ", - "simplecoinus": "simplecoin.us", - "btcguild": "BTC Guild", - "eligius": "Eligius", - "ozcoin": "OzCoin", - "eclipsemc": "EclipseMC", - "maxbtc": "MaxBTC", - "triplemining": "TripleMining", - "coinlab": "CoinLab", - "pool50btc": "50BTC", - "ghashio": "GHash.IO", - "stminingcorp": "ST Mining Corp", - "bitparking": "Bitparking", - "mmpool": "mmpool", - "polmine": "Polmine", - "kncminer": "KnCMiner", - "bitalo": "Bitalo", - "f2pool": "F2Pool", - "hhtt": "HHTT", - "megabigpower": "MegaBigPower", - "mtred": "Mt Red", - "nmcbit": "NMCbit", - "yourbtcnet": "Yourbtc.net", - "givemecoins": "Give Me Coins", - "braiinspool": "Braiins Pool", - "antpool": "AntPool", - "multicoinco": "MultiCoin.co", - "bcpoolio": "bcpool.io", - "cointerra": "Cointerra", - "kanopool": "KanoPool", - "solock": "Solo CK", - "ckpool": "CKPool", - "nicehash": "NiceHash", - "bitclub": "BitClub", - "bitcoinaffiliatenetwork": "Bitcoin Affiliate Network", - "btcc": "BTCC", - "bwpool": "BWPool", - "exxbw": "EXX&BW", - "bitsolo": "Bitsolo", - "bitfury": "BitFury", - "twentyoneinc": "21 Inc.", - "digitalbtc": "digitalBTC", - "eightbaochi": "8baochi", - "mybtccoinpool": "myBTCcoin Pool", - "tbdice": "TBDice", - "hashpool": "HASHPOOL", - "nexious": "Nexious", - "bravomining": "Bravo Mining", - "hotpool": "HotPool", - "okexpool": "OKExPool", - "bcmonster": "BCMonster", - "onehash": "1Hash", - "bixin": "Bixin", - "tatmaspool": "TATMAS Pool", - "viabtc": "ViaBTC", - "connectbtc": "ConnectBTC", - "batpool": "BATPOOL", - "waterhole": "Waterhole", - "dcexploration": "DCExploration", - "dcex": "DCEX", - "btpool": "BTPOOL", - "fiftyeightcoin": "58COIN", - "bitcoinindia": "Bitcoin India", - "shawnp0wers": "shawnp0wers", - "phashio": "PHash.IO", - "rigpool": "RigPool", - "haozhuzhu": "HAOZHUZHU", - "sevenpool": "7pool", - "miningkings": "MiningKings", - "hashbx": "HashBX", - "dpool": "DPOOL", - "rawpool": "Rawpool", - "haominer": "haominer", - "helix": "Helix", - "bitcoinukraine": "Bitcoin-Ukraine", - "poolin": "Poolin", - "secretsuperstar": "SecretSuperstar", - "tigerpoolnet": "tigerpool.net", - "sigmapoolcom": "Sigmapool.com", - "okpooltop": "okpool.top", - "hummerpool": "Hummerpool", - "tangpool": "Tangpool", - "bytepool": "BytePool", - "spiderpool": "SpiderPool", - "novablock": "NovaBlock", - "miningcity": "MiningCity", - "binancepool": "Binance Pool", - "minerium": "Minerium", - "lubiancom": "Lubian.com", - "okkong": "OKKONG", - "aaopool": "AAO Pool", - "emcdpool": "EMCDPool", - "foundryusa": "Foundry USA", - "sbicrypto": "SBI Crypto", - "arkpool": "ArkPool", - "purebtccom": "PureBTC.COM", - "marapool": "MARA Pool", - "kucoinpool": "KuCoinPool", - "entrustcharitypool": "Entrust Charity Pool", - "okminer": "OKMINER", - "titan": "Titan", - "pegapool": "PEGA Pool", - "btcnuggets": "BTC Nuggets", - "cloudhashing": "CloudHashing", - "digitalxmintsy": "digitalX Mintsy", - "telco214": "Telco 214", - "btcpoolparty": "BTC Pool Party", - "multipool": "Multipool", - "transactioncoinmining": "transactioncoinmining", - "btcdig": "BTCDig", - "trickysbtcpool": "Tricky's BTC Pool", - "btcmp": "BTCMP", - "eobot": "Eobot", - "unomp": "UNOMP", - "patels": "Patels", - "gogreenlight": "GoGreenLight", - "ekanembtc": "EkanemBTC", - "canoe": "CANOE", - "tiger": "tiger", - "onem1x": "1M1X", - "zulupool": "Zulupool", - "secpool": "SECPOOL", - "ocean": "OCEAN", - "whitepool": "WhitePool", - "wk057": "wk057", - "futurebitapollosolo": "FutureBit Apollo Solo", - "carbonnegative": "Carbon Negative", - "portlandhodl": "Portland.HODL", - "phoenix": "Phoenix", - "neopool": "Neopool", - "maxipool": "MaxiPool", - "bitfufupool": "BitFuFuPool", - "luckypool": "luckyPool", - "miningdutch": "Mining-Dutch", - "publicpool": "Public Pool", - "miningsquared": "Mining Squared", - "innopolistech": "Innopolis Tech", - "btclab": "BTCLab", - "parasite": "Parasite" + unknown: "Unknown", + blockfills: "BlockFills", + ultimuspool: "ULTIMUSPOOL", + terrapool: "Terra Pool", + luxor: "Luxor", + onethash: "1THash", + btccom: "BTC.com", + bitfarms: "Bitfarms", + huobipool: "Huobi.pool", + wayicn: "WAYI.CN", + canoepool: "CanoePool", + btctop: "BTC.TOP", + bitcoincom: "Bitcoin.com", + pool175btc: "175btc", + gbminers: "GBMiners", + axbt: "A-XBT", + asicminer: "ASICMiner", + bitminter: "BitMinter", + bitcoinrussia: "BitcoinRussia", + btcserv: "BTCServ", + simplecoinus: "simplecoin.us", + btcguild: "BTC Guild", + eligius: "Eligius", + ozcoin: "OzCoin", + eclipsemc: "EclipseMC", + maxbtc: "MaxBTC", + triplemining: "TripleMining", + coinlab: "CoinLab", + pool50btc: "50BTC", + ghashio: "GHash.IO", + stminingcorp: "ST Mining Corp", + bitparking: "Bitparking", + mmpool: "mmpool", + polmine: "Polmine", + kncminer: "KnCMiner", + bitalo: "Bitalo", + f2pool: "F2Pool", + hhtt: "HHTT", + megabigpower: "MegaBigPower", + mtred: "Mt Red", + nmcbit: "NMCbit", + yourbtcnet: "Yourbtc.net", + givemecoins: "Give Me Coins", + braiinspool: "Braiins Pool", + antpool: "AntPool", + multicoinco: "MultiCoin.co", + bcpoolio: "bcpool.io", + cointerra: "Cointerra", + kanopool: "KanoPool", + solock: "Solo CK", + ckpool: "CKPool", + nicehash: "NiceHash", + bitclub: "BitClub", + bitcoinaffiliatenetwork: "Bitcoin Affiliate Network", + btcc: "BTCC", + bwpool: "BWPool", + exxbw: "EXX&BW", + bitsolo: "Bitsolo", + bitfury: "BitFury", + twentyoneinc: "21 Inc.", + digitalbtc: "digitalBTC", + eightbaochi: "8baochi", + mybtccoinpool: "myBTCcoin Pool", + tbdice: "TBDice", + hashpool: "HASHPOOL", + nexious: "Nexious", + bravomining: "Bravo Mining", + hotpool: "HotPool", + okexpool: "OKExPool", + bcmonster: "BCMonster", + onehash: "1Hash", + bixin: "Bixin", + tatmaspool: "TATMAS Pool", + viabtc: "ViaBTC", + connectbtc: "ConnectBTC", + batpool: "BATPOOL", + waterhole: "Waterhole", + dcexploration: "DCExploration", + dcex: "DCEX", + btpool: "BTPOOL", + fiftyeightcoin: "58COIN", + bitcoinindia: "Bitcoin India", + shawnp0wers: "shawnp0wers", + phashio: "PHash.IO", + rigpool: "RigPool", + haozhuzhu: "HAOZHUZHU", + sevenpool: "7pool", + miningkings: "MiningKings", + hashbx: "HashBX", + dpool: "DPOOL", + rawpool: "Rawpool", + haominer: "haominer", + helix: "Helix", + bitcoinukraine: "Bitcoin-Ukraine", + poolin: "Poolin", + secretsuperstar: "SecretSuperstar", + tigerpoolnet: "tigerpool.net", + sigmapoolcom: "Sigmapool.com", + okpooltop: "okpool.top", + hummerpool: "Hummerpool", + tangpool: "Tangpool", + bytepool: "BytePool", + spiderpool: "SpiderPool", + novablock: "NovaBlock", + miningcity: "MiningCity", + binancepool: "Binance Pool", + minerium: "Minerium", + lubiancom: "Lubian.com", + okkong: "OKKONG", + aaopool: "AAO Pool", + emcdpool: "EMCDPool", + foundryusa: "Foundry USA", + sbicrypto: "SBI Crypto", + arkpool: "ArkPool", + purebtccom: "PureBTC.COM", + marapool: "MARA Pool", + kucoinpool: "KuCoinPool", + entrustcharitypool: "Entrust Charity Pool", + okminer: "OKMINER", + titan: "Titan", + pegapool: "PEGA Pool", + btcnuggets: "BTC Nuggets", + cloudhashing: "CloudHashing", + digitalxmintsy: "digitalX Mintsy", + telco214: "Telco 214", + btcpoolparty: "BTC Pool Party", + multipool: "Multipool", + transactioncoinmining: "transactioncoinmining", + btcdig: "BTCDig", + trickysbtcpool: "Tricky's BTC Pool", + btcmp: "BTCMP", + eobot: "Eobot", + unomp: "UNOMP", + patels: "Patels", + gogreenlight: "GoGreenLight", + ekanembtc: "EkanemBTC", + canoe: "CANOE", + tiger: "tiger", + onem1x: "1M1X", + zulupool: "Zulupool", + secpool: "SECPOOL", + ocean: "OCEAN", + whitepool: "WhitePool", + wk057: "wk057", + futurebitapollosolo: "FutureBit Apollo Solo", + carbonnegative: "Carbon Negative", + portlandhodl: "Portland.HODL", + phoenix: "Phoenix", + neopool: "Neopool", + maxipool: "MaxiPool", + bitfufupool: "BitFuFuPool", + luckypool: "luckyPool", + miningdutch: "Mining-Dutch", + publicpool: "Public Pool", + miningsquared: "Mining Squared", + innopolistech: "Innopolis Tech", + btclab: "BTCLab", + parasite: "Parasite", }); TERM_NAMES = /** @type {const} */ ({ - "short": { - "id": "sth", - "short": "STH", - "long": "Short Term Holders" + short: { + id: "sth", + short: "STH", + long: "Short Term Holders", + }, + long: { + id: "lth", + short: "LTH", + long: "Long Term Holders", }, - "long": { - "id": "lth", - "short": "LTH", - "long": "Long Term Holders" - } }); EPOCH_NAMES = /** @type {const} */ ({ - "_0": { - "id": "epoch_0", - "short": "Epoch 0", - "long": "Epoch 0" + _0: { + id: "epoch_0", + short: "Epoch 0", + long: "Epoch 0", }, - "_1": { - "id": "epoch_1", - "short": "Epoch 1", - "long": "Epoch 1" + _1: { + id: "epoch_1", + short: "Epoch 1", + long: "Epoch 1", }, - "_2": { - "id": "epoch_2", - "short": "Epoch 2", - "long": "Epoch 2" + _2: { + id: "epoch_2", + short: "Epoch 2", + long: "Epoch 2", }, - "_3": { - "id": "epoch_3", - "short": "Epoch 3", - "long": "Epoch 3" + _3: { + id: "epoch_3", + short: "Epoch 3", + long: "Epoch 3", + }, + _4: { + id: "epoch_4", + short: "Epoch 4", + long: "Epoch 4", }, - "_4": { - "id": "epoch_4", - "short": "Epoch 4", - "long": "Epoch 4" - } }); YEAR_NAMES = /** @type {const} */ ({ - "_2009": { - "id": "year_2009", - "short": "2009", - "long": "Year 2009" + _2009: { + id: "year_2009", + short: "2009", + long: "Year 2009", }, - "_2010": { - "id": "year_2010", - "short": "2010", - "long": "Year 2010" + _2010: { + id: "year_2010", + short: "2010", + long: "Year 2010", }, - "_2011": { - "id": "year_2011", - "short": "2011", - "long": "Year 2011" + _2011: { + id: "year_2011", + short: "2011", + long: "Year 2011", }, - "_2012": { - "id": "year_2012", - "short": "2012", - "long": "Year 2012" + _2012: { + id: "year_2012", + short: "2012", + long: "Year 2012", }, - "_2013": { - "id": "year_2013", - "short": "2013", - "long": "Year 2013" + _2013: { + id: "year_2013", + short: "2013", + long: "Year 2013", }, - "_2014": { - "id": "year_2014", - "short": "2014", - "long": "Year 2014" + _2014: { + id: "year_2014", + short: "2014", + long: "Year 2014", }, - "_2015": { - "id": "year_2015", - "short": "2015", - "long": "Year 2015" + _2015: { + id: "year_2015", + short: "2015", + long: "Year 2015", }, - "_2016": { - "id": "year_2016", - "short": "2016", - "long": "Year 2016" + _2016: { + id: "year_2016", + short: "2016", + long: "Year 2016", }, - "_2017": { - "id": "year_2017", - "short": "2017", - "long": "Year 2017" + _2017: { + id: "year_2017", + short: "2017", + long: "Year 2017", }, - "_2018": { - "id": "year_2018", - "short": "2018", - "long": "Year 2018" + _2018: { + id: "year_2018", + short: "2018", + long: "Year 2018", }, - "_2019": { - "id": "year_2019", - "short": "2019", - "long": "Year 2019" + _2019: { + id: "year_2019", + short: "2019", + long: "Year 2019", }, - "_2020": { - "id": "year_2020", - "short": "2020", - "long": "Year 2020" + _2020: { + id: "year_2020", + short: "2020", + long: "Year 2020", }, - "_2021": { - "id": "year_2021", - "short": "2021", - "long": "Year 2021" + _2021: { + id: "year_2021", + short: "2021", + long: "Year 2021", }, - "_2022": { - "id": "year_2022", - "short": "2022", - "long": "Year 2022" + _2022: { + id: "year_2022", + short: "2022", + long: "Year 2022", }, - "_2023": { - "id": "year_2023", - "short": "2023", - "long": "Year 2023" + _2023: { + id: "year_2023", + short: "2023", + long: "Year 2023", }, - "_2024": { - "id": "year_2024", - "short": "2024", - "long": "Year 2024" + _2024: { + id: "year_2024", + short: "2024", + long: "Year 2024", }, - "_2025": { - "id": "year_2025", - "short": "2025", - "long": "Year 2025" + _2025: { + id: "year_2025", + short: "2025", + long: "Year 2025", + }, + _2026: { + id: "year_2026", + short: "2026", + long: "Year 2026", }, - "_2026": { - "id": "year_2026", - "short": "2026", - "long": "Year 2026" - } }); SPENDABLE_TYPE_NAMES = /** @type {const} */ ({ - "p2pk65": { - "id": "p2pk65", - "short": "P2PK65", - "long": "Pay to Public Key (65 bytes)" + p2pk65: { + id: "p2pk65", + short: "P2PK65", + long: "Pay to Public Key (65 bytes)", }, - "p2pk33": { - "id": "p2pk33", - "short": "P2PK33", - "long": "Pay to Public Key (33 bytes)" + p2pk33: { + id: "p2pk33", + short: "P2PK33", + long: "Pay to Public Key (33 bytes)", }, - "p2pkh": { - "id": "p2pkh", - "short": "P2PKH", - "long": "Pay to Public Key Hash" + p2pkh: { + id: "p2pkh", + short: "P2PKH", + long: "Pay to Public Key Hash", }, - "p2ms": { - "id": "p2ms", - "short": "P2MS", - "long": "Pay to Multisig" + p2ms: { + id: "p2ms", + short: "P2MS", + long: "Pay to Multisig", }, - "p2sh": { - "id": "p2sh", - "short": "P2SH", - "long": "Pay to Script Hash" + p2sh: { + id: "p2sh", + short: "P2SH", + long: "Pay to Script Hash", }, - "p2wpkh": { - "id": "p2wpkh", - "short": "P2WPKH", - "long": "Pay to Witness Public Key Hash" + p2wpkh: { + id: "p2wpkh", + short: "P2WPKH", + long: "Pay to Witness Public Key Hash", }, - "p2wsh": { - "id": "p2wsh", - "short": "P2WSH", - "long": "Pay to Witness Script Hash" + p2wsh: { + id: "p2wsh", + short: "P2WSH", + long: "Pay to Witness Script Hash", }, - "p2tr": { - "id": "p2tr", - "short": "P2TR", - "long": "Pay to Taproot" + p2tr: { + id: "p2tr", + short: "P2TR", + long: "Pay to Taproot", }, - "p2a": { - "id": "p2a", - "short": "P2A", - "long": "Pay to Anchor" + p2a: { + id: "p2a", + short: "P2A", + long: "Pay to Anchor", }, - "unknown": { - "id": "unknown_outputs", - "short": "Unknown", - "long": "Unknown Output Type" + unknown: { + id: "unknown_outputs", + short: "Unknown", + long: "Unknown Output Type", + }, + empty: { + id: "empty_outputs", + short: "Empty", + long: "Empty Output", }, - "empty": { - "id": "empty_outputs", - "short": "Empty", - "long": "Empty Output" - } }); AGE_RANGE_NAMES = /** @type {const} */ ({ - "upTo1h": { - "id": "up_to_1h_old", - "short": "<1h", - "long": "Up to 1 Hour Old" + upTo1h: { + id: "up_to_1h_old", + short: "<1h", + long: "Up to 1 Hour Old", }, - "_1hTo1d": { - "id": "at_least_1h_up_to_1d_old", - "short": "1h-1d", - "long": "1 Hour to 1 Day Old" + _1hTo1d: { + id: "at_least_1h_up_to_1d_old", + short: "1h-1d", + long: "1 Hour to 1 Day Old", }, - "_1dTo1w": { - "id": "at_least_1d_up_to_1w_old", - "short": "1d-1w", - "long": "1 Day to 1 Week Old" + _1dTo1w: { + id: "at_least_1d_up_to_1w_old", + short: "1d-1w", + long: "1 Day to 1 Week Old", }, - "_1wTo1m": { - "id": "at_least_1w_up_to_1m_old", - "short": "1w-1m", - "long": "1 Week to 1 Month Old" + _1wTo1m: { + id: "at_least_1w_up_to_1m_old", + short: "1w-1m", + long: "1 Week to 1 Month Old", }, - "_1mTo2m": { - "id": "at_least_1m_up_to_2m_old", - "short": "1m-2m", - "long": "1 to 2 Months Old" + _1mTo2m: { + id: "at_least_1m_up_to_2m_old", + short: "1m-2m", + long: "1 to 2 Months Old", }, - "_2mTo3m": { - "id": "at_least_2m_up_to_3m_old", - "short": "2m-3m", - "long": "2 to 3 Months Old" + _2mTo3m: { + id: "at_least_2m_up_to_3m_old", + short: "2m-3m", + long: "2 to 3 Months Old", }, - "_3mTo4m": { - "id": "at_least_3m_up_to_4m_old", - "short": "3m-4m", - "long": "3 to 4 Months Old" + _3mTo4m: { + id: "at_least_3m_up_to_4m_old", + short: "3m-4m", + long: "3 to 4 Months Old", }, - "_4mTo5m": { - "id": "at_least_4m_up_to_5m_old", - "short": "4m-5m", - "long": "4 to 5 Months Old" + _4mTo5m: { + id: "at_least_4m_up_to_5m_old", + short: "4m-5m", + long: "4 to 5 Months Old", }, - "_5mTo6m": { - "id": "at_least_5m_up_to_6m_old", - "short": "5m-6m", - "long": "5 to 6 Months Old" + _5mTo6m: { + id: "at_least_5m_up_to_6m_old", + short: "5m-6m", + long: "5 to 6 Months Old", }, - "_6mTo1y": { - "id": "at_least_6m_up_to_1y_old", - "short": "6m-1y", - "long": "6 Months to 1 Year Old" + _6mTo1y: { + id: "at_least_6m_up_to_1y_old", + short: "6m-1y", + long: "6 Months to 1 Year Old", }, - "_1yTo2y": { - "id": "at_least_1y_up_to_2y_old", - "short": "1y-2y", - "long": "1 to 2 Years Old" + _1yTo2y: { + id: "at_least_1y_up_to_2y_old", + short: "1y-2y", + long: "1 to 2 Years Old", }, - "_2yTo3y": { - "id": "at_least_2y_up_to_3y_old", - "short": "2y-3y", - "long": "2 to 3 Years Old" + _2yTo3y: { + id: "at_least_2y_up_to_3y_old", + short: "2y-3y", + long: "2 to 3 Years Old", }, - "_3yTo4y": { - "id": "at_least_3y_up_to_4y_old", - "short": "3y-4y", - "long": "3 to 4 Years Old" + _3yTo4y: { + id: "at_least_3y_up_to_4y_old", + short: "3y-4y", + long: "3 to 4 Years Old", }, - "_4yTo5y": { - "id": "at_least_4y_up_to_5y_old", - "short": "4y-5y", - "long": "4 to 5 Years Old" + _4yTo5y: { + id: "at_least_4y_up_to_5y_old", + short: "4y-5y", + long: "4 to 5 Years Old", }, - "_5yTo6y": { - "id": "at_least_5y_up_to_6y_old", - "short": "5y-6y", - "long": "5 to 6 Years Old" + _5yTo6y: { + id: "at_least_5y_up_to_6y_old", + short: "5y-6y", + long: "5 to 6 Years Old", }, - "_6yTo7y": { - "id": "at_least_6y_up_to_7y_old", - "short": "6y-7y", - "long": "6 to 7 Years Old" + _6yTo7y: { + id: "at_least_6y_up_to_7y_old", + short: "6y-7y", + long: "6 to 7 Years Old", }, - "_7yTo8y": { - "id": "at_least_7y_up_to_8y_old", - "short": "7y-8y", - "long": "7 to 8 Years Old" + _7yTo8y: { + id: "at_least_7y_up_to_8y_old", + short: "7y-8y", + long: "7 to 8 Years Old", }, - "_8yTo10y": { - "id": "at_least_8y_up_to_10y_old", - "short": "8y-10y", - "long": "8 to 10 Years Old" + _8yTo10y: { + id: "at_least_8y_up_to_10y_old", + short: "8y-10y", + long: "8 to 10 Years Old", }, - "_10yTo12y": { - "id": "at_least_10y_up_to_12y_old", - "short": "10y-12y", - "long": "10 to 12 Years Old" + _10yTo12y: { + id: "at_least_10y_up_to_12y_old", + short: "10y-12y", + long: "10 to 12 Years Old", }, - "_12yTo15y": { - "id": "at_least_12y_up_to_15y_old", - "short": "12y-15y", - "long": "12 to 15 Years Old" + _12yTo15y: { + id: "at_least_12y_up_to_15y_old", + short: "12y-15y", + long: "12 to 15 Years Old", + }, + from15y: { + id: "at_least_15y_old", + short: "15y+", + long: "15+ Years Old", }, - "from15y": { - "id": "at_least_15y_old", - "short": "15y+", - "long": "15+ Years Old" - } }); MAX_AGE_NAMES = /** @type {const} */ ({ - "_1w": { - "id": "up_to_1w_old", - "short": "<1w", - "long": "Up to 1 Week Old" + _1w: { + id: "up_to_1w_old", + short: "<1w", + long: "Up to 1 Week Old", }, - "_1m": { - "id": "up_to_1m_old", - "short": "<1m", - "long": "Up to 1 Month Old" + _1m: { + id: "up_to_1m_old", + short: "<1m", + long: "Up to 1 Month Old", }, - "_2m": { - "id": "up_to_2m_old", - "short": "<2m", - "long": "Up to 2 Months Old" + _2m: { + id: "up_to_2m_old", + short: "<2m", + long: "Up to 2 Months Old", }, - "_3m": { - "id": "up_to_3m_old", - "short": "<3m", - "long": "Up to 3 Months Old" + _3m: { + id: "up_to_3m_old", + short: "<3m", + long: "Up to 3 Months Old", }, - "_4m": { - "id": "up_to_4m_old", - "short": "<4m", - "long": "Up to 4 Months Old" + _4m: { + id: "up_to_4m_old", + short: "<4m", + long: "Up to 4 Months Old", }, - "_5m": { - "id": "up_to_5m_old", - "short": "<5m", - "long": "Up to 5 Months Old" + _5m: { + id: "up_to_5m_old", + short: "<5m", + long: "Up to 5 Months Old", }, - "_6m": { - "id": "up_to_6m_old", - "short": "<6m", - "long": "Up to 6 Months Old" + _6m: { + id: "up_to_6m_old", + short: "<6m", + long: "Up to 6 Months Old", }, - "_1y": { - "id": "up_to_1y_old", - "short": "<1y", - "long": "Up to 1 Year Old" + _1y: { + id: "up_to_1y_old", + short: "<1y", + long: "Up to 1 Year Old", }, - "_2y": { - "id": "up_to_2y_old", - "short": "<2y", - "long": "Up to 2 Years Old" + _2y: { + id: "up_to_2y_old", + short: "<2y", + long: "Up to 2 Years Old", }, - "_3y": { - "id": "up_to_3y_old", - "short": "<3y", - "long": "Up to 3 Years Old" + _3y: { + id: "up_to_3y_old", + short: "<3y", + long: "Up to 3 Years Old", }, - "_4y": { - "id": "up_to_4y_old", - "short": "<4y", - "long": "Up to 4 Years Old" + _4y: { + id: "up_to_4y_old", + short: "<4y", + long: "Up to 4 Years Old", }, - "_5y": { - "id": "up_to_5y_old", - "short": "<5y", - "long": "Up to 5 Years Old" + _5y: { + id: "up_to_5y_old", + short: "<5y", + long: "Up to 5 Years Old", }, - "_6y": { - "id": "up_to_6y_old", - "short": "<6y", - "long": "Up to 6 Years Old" + _6y: { + id: "up_to_6y_old", + short: "<6y", + long: "Up to 6 Years Old", }, - "_7y": { - "id": "up_to_7y_old", - "short": "<7y", - "long": "Up to 7 Years Old" + _7y: { + id: "up_to_7y_old", + short: "<7y", + long: "Up to 7 Years Old", }, - "_8y": { - "id": "up_to_8y_old", - "short": "<8y", - "long": "Up to 8 Years Old" + _8y: { + id: "up_to_8y_old", + short: "<8y", + long: "Up to 8 Years Old", }, - "_10y": { - "id": "up_to_10y_old", - "short": "<10y", - "long": "Up to 10 Years Old" + _10y: { + id: "up_to_10y_old", + short: "<10y", + long: "Up to 10 Years Old", }, - "_12y": { - "id": "up_to_12y_old", - "short": "<12y", - "long": "Up to 12 Years Old" + _12y: { + id: "up_to_12y_old", + short: "<12y", + long: "Up to 12 Years Old", + }, + _15y: { + id: "up_to_15y_old", + short: "<15y", + long: "Up to 15 Years Old", }, - "_15y": { - "id": "up_to_15y_old", - "short": "<15y", - "long": "Up to 15 Years Old" - } }); MIN_AGE_NAMES = /** @type {const} */ ({ - "_1d": { - "id": "at_least_1d_old", - "short": "1d+", - "long": "At Least 1 Day Old" + _1d: { + id: "at_least_1d_old", + short: "1d+", + long: "At Least 1 Day Old", }, - "_1w": { - "id": "at_least_1w_old", - "short": "1w+", - "long": "At Least 1 Week Old" + _1w: { + id: "at_least_1w_old", + short: "1w+", + long: "At Least 1 Week Old", }, - "_1m": { - "id": "at_least_1m_old", - "short": "1m+", - "long": "At Least 1 Month Old" + _1m: { + id: "at_least_1m_old", + short: "1m+", + long: "At Least 1 Month Old", }, - "_2m": { - "id": "at_least_2m_old", - "short": "2m+", - "long": "At Least 2 Months Old" + _2m: { + id: "at_least_2m_old", + short: "2m+", + long: "At Least 2 Months Old", }, - "_3m": { - "id": "at_least_3m_old", - "short": "3m+", - "long": "At Least 3 Months Old" + _3m: { + id: "at_least_3m_old", + short: "3m+", + long: "At Least 3 Months Old", }, - "_4m": { - "id": "at_least_4m_old", - "short": "4m+", - "long": "At Least 4 Months Old" + _4m: { + id: "at_least_4m_old", + short: "4m+", + long: "At Least 4 Months Old", }, - "_5m": { - "id": "at_least_5m_old", - "short": "5m+", - "long": "At Least 5 Months Old" + _5m: { + id: "at_least_5m_old", + short: "5m+", + long: "At Least 5 Months Old", }, - "_6m": { - "id": "at_least_6m_old", - "short": "6m+", - "long": "At Least 6 Months Old" + _6m: { + id: "at_least_6m_old", + short: "6m+", + long: "At Least 6 Months Old", }, - "_1y": { - "id": "at_least_1y_old", - "short": "1y+", - "long": "At Least 1 Year Old" + _1y: { + id: "at_least_1y_old", + short: "1y+", + long: "At Least 1 Year Old", }, - "_2y": { - "id": "at_least_2y_old", - "short": "2y+", - "long": "At Least 2 Years Old" + _2y: { + id: "at_least_2y_old", + short: "2y+", + long: "At Least 2 Years Old", }, - "_3y": { - "id": "at_least_3y_old", - "short": "3y+", - "long": "At Least 3 Years Old" + _3y: { + id: "at_least_3y_old", + short: "3y+", + long: "At Least 3 Years Old", }, - "_4y": { - "id": "at_least_4y_old", - "short": "4y+", - "long": "At Least 4 Years Old" + _4y: { + id: "at_least_4y_old", + short: "4y+", + long: "At Least 4 Years Old", }, - "_5y": { - "id": "at_least_5y_old", - "short": "5y+", - "long": "At Least 5 Years Old" + _5y: { + id: "at_least_5y_old", + short: "5y+", + long: "At Least 5 Years Old", }, - "_6y": { - "id": "at_least_6y_old", - "short": "6y+", - "long": "At Least 6 Years Old" + _6y: { + id: "at_least_6y_old", + short: "6y+", + long: "At Least 6 Years Old", }, - "_7y": { - "id": "at_least_7y_old", - "short": "7y+", - "long": "At Least 7 Years Old" + _7y: { + id: "at_least_7y_old", + short: "7y+", + long: "At Least 7 Years Old", }, - "_8y": { - "id": "at_least_8y_old", - "short": "8y+", - "long": "At Least 8 Years Old" + _8y: { + id: "at_least_8y_old", + short: "8y+", + long: "At Least 8 Years Old", }, - "_10y": { - "id": "at_least_10y_old", - "short": "10y+", - "long": "At Least 10 Years Old" + _10y: { + id: "at_least_10y_old", + short: "10y+", + long: "At Least 10 Years Old", + }, + _12y: { + id: "at_least_12y_old", + short: "12y+", + long: "At Least 12 Years Old", }, - "_12y": { - "id": "at_least_12y_old", - "short": "12y+", - "long": "At Least 12 Years Old" - } }); AMOUNT_RANGE_NAMES = /** @type {const} */ ({ - "_0sats": { - "id": "with_0sats", - "short": "0 sats", - "long": "0 Sats" + _0sats: { + id: "with_0sats", + short: "0 sats", + long: "0 Sats", }, - "_1satTo10sats": { - "id": "above_1sat_under_10sats", - "short": "1-10 sats", - "long": "1 to 10 Sats" + _1satTo10sats: { + id: "above_1sat_under_10sats", + short: "1-10 sats", + long: "1 to 10 Sats", }, - "_10satsTo100sats": { - "id": "above_10sats_under_100sats", - "short": "10-100 sats", - "long": "10 to 100 Sats" + _10satsTo100sats: { + id: "above_10sats_under_100sats", + short: "10-100 sats", + long: "10 to 100 Sats", }, - "_100satsTo1kSats": { - "id": "above_100sats_under_1k_sats", - "short": "100-1k sats", - "long": "100 to 1K Sats" + _100satsTo1kSats: { + id: "above_100sats_under_1k_sats", + short: "100-1k sats", + long: "100 to 1K Sats", }, - "_1kSatsTo10kSats": { - "id": "above_1k_sats_under_10k_sats", - "short": "1k-10k sats", - "long": "1K to 10K Sats" + _1kSatsTo10kSats: { + id: "above_1k_sats_under_10k_sats", + short: "1k-10k sats", + long: "1K to 10K Sats", }, - "_10kSatsTo100kSats": { - "id": "above_10k_sats_under_100k_sats", - "short": "10k-100k sats", - "long": "10K to 100K Sats" + _10kSatsTo100kSats: { + id: "above_10k_sats_under_100k_sats", + short: "10k-100k sats", + long: "10K to 100K Sats", }, - "_100kSatsTo1mSats": { - "id": "above_100k_sats_under_1m_sats", - "short": "100k-1M sats", - "long": "100K to 1M Sats" + _100kSatsTo1mSats: { + id: "above_100k_sats_under_1m_sats", + short: "100k-1M sats", + long: "100K to 1M Sats", }, - "_1mSatsTo10mSats": { - "id": "above_1m_sats_under_10m_sats", - "short": "1M-10M sats", - "long": "1M to 10M Sats" + _1mSatsTo10mSats: { + id: "above_1m_sats_under_10m_sats", + short: "1M-10M sats", + long: "1M to 10M Sats", }, - "_10mSatsTo1btc": { - "id": "above_10m_sats_under_1btc", - "short": "0.1-1 BTC", - "long": "0.1 to 1 BTC" + _10mSatsTo1btc: { + id: "above_10m_sats_under_1btc", + short: "0.1-1 BTC", + long: "0.1 to 1 BTC", }, - "_1btcTo10btc": { - "id": "above_1btc_under_10btc", - "short": "1-10 BTC", - "long": "1 to 10 BTC" + _1btcTo10btc: { + id: "above_1btc_under_10btc", + short: "1-10 BTC", + long: "1 to 10 BTC", }, - "_10btcTo100btc": { - "id": "above_10btc_under_100btc", - "short": "10-100 BTC", - "long": "10 to 100 BTC" + _10btcTo100btc: { + id: "above_10btc_under_100btc", + short: "10-100 BTC", + long: "10 to 100 BTC", }, - "_100btcTo1kBtc": { - "id": "above_100btc_under_1k_btc", - "short": "100-1k BTC", - "long": "100 to 1K BTC" + _100btcTo1kBtc: { + id: "above_100btc_under_1k_btc", + short: "100-1k BTC", + long: "100 to 1K BTC", }, - "_1kBtcTo10kBtc": { - "id": "above_1k_btc_under_10k_btc", - "short": "1k-10k BTC", - "long": "1K to 10K BTC" + _1kBtcTo10kBtc: { + id: "above_1k_btc_under_10k_btc", + short: "1k-10k BTC", + long: "1K to 10K BTC", }, - "_10kBtcTo100kBtc": { - "id": "above_10k_btc_under_100k_btc", - "short": "10k-100k BTC", - "long": "10K to 100K BTC" + _10kBtcTo100kBtc: { + id: "above_10k_btc_under_100k_btc", + short: "10k-100k BTC", + long: "10K to 100K BTC", + }, + _100kBtcOrMore: { + id: "above_100k_btc", + short: "100k+ BTC", + long: "100K+ BTC", }, - "_100kBtcOrMore": { - "id": "above_100k_btc", - "short": "100k+ BTC", - "long": "100K+ BTC" - } }); GE_AMOUNT_NAMES = /** @type {const} */ ({ - "_1sat": { - "id": "above_1sat", - "short": "1+ sats", - "long": "Above 1 Sat" + _1sat: { + id: "above_1sat", + short: "1+ sats", + long: "Above 1 Sat", }, - "_10sats": { - "id": "above_10sats", - "short": "10+ sats", - "long": "Above 10 Sats" + _10sats: { + id: "above_10sats", + short: "10+ sats", + long: "Above 10 Sats", }, - "_100sats": { - "id": "above_100sats", - "short": "100+ sats", - "long": "Above 100 Sats" + _100sats: { + id: "above_100sats", + short: "100+ sats", + long: "Above 100 Sats", }, - "_1kSats": { - "id": "above_1k_sats", - "short": "1k+ sats", - "long": "Above 1K Sats" + _1kSats: { + id: "above_1k_sats", + short: "1k+ sats", + long: "Above 1K Sats", }, - "_10kSats": { - "id": "above_10k_sats", - "short": "10k+ sats", - "long": "Above 10K Sats" + _10kSats: { + id: "above_10k_sats", + short: "10k+ sats", + long: "Above 10K Sats", }, - "_100kSats": { - "id": "above_100k_sats", - "short": "100k+ sats", - "long": "Above 100K Sats" + _100kSats: { + id: "above_100k_sats", + short: "100k+ sats", + long: "Above 100K Sats", }, - "_1mSats": { - "id": "above_1m_sats", - "short": "1M+ sats", - "long": "Above 1M Sats" + _1mSats: { + id: "above_1m_sats", + short: "1M+ sats", + long: "Above 1M Sats", }, - "_10mSats": { - "id": "above_10m_sats", - "short": "0.1+ BTC", - "long": "Above 0.1 BTC" + _10mSats: { + id: "above_10m_sats", + short: "0.1+ BTC", + long: "Above 0.1 BTC", }, - "_1btc": { - "id": "above_1btc", - "short": "1+ BTC", - "long": "Above 1 BTC" + _1btc: { + id: "above_1btc", + short: "1+ BTC", + long: "Above 1 BTC", }, - "_10btc": { - "id": "above_10btc", - "short": "10+ BTC", - "long": "Above 10 BTC" + _10btc: { + id: "above_10btc", + short: "10+ BTC", + long: "Above 10 BTC", }, - "_100btc": { - "id": "above_100btc", - "short": "100+ BTC", - "long": "Above 100 BTC" + _100btc: { + id: "above_100btc", + short: "100+ BTC", + long: "Above 100 BTC", }, - "_1kBtc": { - "id": "above_1k_btc", - "short": "1k+ BTC", - "long": "Above 1K BTC" + _1kBtc: { + id: "above_1k_btc", + short: "1k+ BTC", + long: "Above 1K BTC", + }, + _10kBtc: { + id: "above_10k_btc", + short: "10k+ BTC", + long: "Above 10K BTC", }, - "_10kBtc": { - "id": "above_10k_btc", - "short": "10k+ BTC", - "long": "Above 10K BTC" - } }); LT_AMOUNT_NAMES = /** @type {const} */ ({ - "_10sats": { - "id": "under_10sats", - "short": "<10 sats", - "long": "Under 10 Sats" + _10sats: { + id: "under_10sats", + short: "<10 sats", + long: "Under 10 Sats", }, - "_100sats": { - "id": "under_100sats", - "short": "<100 sats", - "long": "Under 100 Sats" + _100sats: { + id: "under_100sats", + short: "<100 sats", + long: "Under 100 Sats", }, - "_1kSats": { - "id": "under_1k_sats", - "short": "<1k sats", - "long": "Under 1K Sats" + _1kSats: { + id: "under_1k_sats", + short: "<1k sats", + long: "Under 1K Sats", }, - "_10kSats": { - "id": "under_10k_sats", - "short": "<10k sats", - "long": "Under 10K Sats" + _10kSats: { + id: "under_10k_sats", + short: "<10k sats", + long: "Under 10K Sats", }, - "_100kSats": { - "id": "under_100k_sats", - "short": "<100k sats", - "long": "Under 100K Sats" + _100kSats: { + id: "under_100k_sats", + short: "<100k sats", + long: "Under 100K Sats", }, - "_1mSats": { - "id": "under_1m_sats", - "short": "<1M sats", - "long": "Under 1M Sats" + _1mSats: { + id: "under_1m_sats", + short: "<1M sats", + long: "Under 1M Sats", }, - "_10mSats": { - "id": "under_10m_sats", - "short": "<0.1 BTC", - "long": "Under 0.1 BTC" + _10mSats: { + id: "under_10m_sats", + short: "<0.1 BTC", + long: "Under 0.1 BTC", }, - "_1btc": { - "id": "under_1btc", - "short": "<1 BTC", - "long": "Under 1 BTC" + _1btc: { + id: "under_1btc", + short: "<1 BTC", + long: "Under 1 BTC", }, - "_10btc": { - "id": "under_10btc", - "short": "<10 BTC", - "long": "Under 10 BTC" + _10btc: { + id: "under_10btc", + short: "<10 BTC", + long: "Under 10 BTC", }, - "_100btc": { - "id": "under_100btc", - "short": "<100 BTC", - "long": "Under 100 BTC" + _100btc: { + id: "under_100btc", + short: "<100 BTC", + long: "Under 100 BTC", }, - "_1kBtc": { - "id": "under_1k_btc", - "short": "<1k BTC", - "long": "Under 1K BTC" + _1kBtc: { + id: "under_1k_btc", + short: "<1k BTC", + long: "Under 1K BTC", }, - "_10kBtc": { - "id": "under_10k_btc", - "short": "<10k BTC", - "long": "Under 10K BTC" + _10kBtc: { + id: "under_10k_btc", + short: "<10k BTC", + long: "Under 10K BTC", + }, + _100kBtc: { + id: "under_100k_btc", + short: "<100k BTC", + long: "Under 100K BTC", }, - "_100kBtc": { - "id": "under_100k_btc", - "short": "<100k BTC", - "long": "Under 100K BTC" - } }); /** @@ -5813,7 +6320,7 @@ class BrkClient extends BrkClientBase { constructor(options) { super(options); /** @type {MetricsTree} */ - this.metrics = this._buildTree(''); + this.metrics = this._buildTree(""); } /** @@ -5824,1066 +6331,1390 @@ class BrkClient extends BrkClientBase { _buildTree(basePath) { return { addresses: { - firstP2aaddressindex: createMetricPattern11(this, 'first_p2aaddressindex'), - firstP2pk33addressindex: createMetricPattern11(this, 'first_p2pk33addressindex'), - firstP2pk65addressindex: createMetricPattern11(this, 'first_p2pk65addressindex'), - firstP2pkhaddressindex: createMetricPattern11(this, 'first_p2pkhaddressindex'), - firstP2shaddressindex: createMetricPattern11(this, 'first_p2shaddressindex'), - firstP2traddressindex: createMetricPattern11(this, 'first_p2traddressindex'), - firstP2wpkhaddressindex: createMetricPattern11(this, 'first_p2wpkhaddressindex'), - firstP2wshaddressindex: createMetricPattern11(this, 'first_p2wshaddressindex'), - p2abytes: createMetricPattern16(this, 'p2abytes'), - p2pk33bytes: createMetricPattern18(this, 'p2pk33bytes'), - p2pk65bytes: createMetricPattern19(this, 'p2pk65bytes'), - p2pkhbytes: createMetricPattern20(this, 'p2pkhbytes'), - p2shbytes: createMetricPattern21(this, 'p2shbytes'), - p2trbytes: createMetricPattern22(this, 'p2trbytes'), - p2wpkhbytes: createMetricPattern23(this, 'p2wpkhbytes'), - p2wshbytes: createMetricPattern24(this, 'p2wshbytes'), + firstP2aaddressindex: createMetricPattern11( + this, + "first_p2aaddressindex", + ), + firstP2pk33addressindex: createMetricPattern11( + this, + "first_p2pk33addressindex", + ), + firstP2pk65addressindex: createMetricPattern11( + this, + "first_p2pk65addressindex", + ), + firstP2pkhaddressindex: createMetricPattern11( + this, + "first_p2pkhaddressindex", + ), + firstP2shaddressindex: createMetricPattern11( + this, + "first_p2shaddressindex", + ), + firstP2traddressindex: createMetricPattern11( + this, + "first_p2traddressindex", + ), + firstP2wpkhaddressindex: createMetricPattern11( + this, + "first_p2wpkhaddressindex", + ), + firstP2wshaddressindex: createMetricPattern11( + this, + "first_p2wshaddressindex", + ), + p2abytes: createMetricPattern16(this, "p2abytes"), + p2pk33bytes: createMetricPattern18(this, "p2pk33bytes"), + p2pk65bytes: createMetricPattern19(this, "p2pk65bytes"), + p2pkhbytes: createMetricPattern20(this, "p2pkhbytes"), + p2shbytes: createMetricPattern21(this, "p2shbytes"), + p2trbytes: createMetricPattern22(this, "p2trbytes"), + p2wpkhbytes: createMetricPattern23(this, "p2wpkhbytes"), + p2wshbytes: createMetricPattern24(this, "p2wshbytes"), }, blocks: { - blockhash: createMetricPattern11(this, 'blockhash'), + blockhash: createMetricPattern11(this, "blockhash"), count: { - _1mBlockCount: createMetricPattern1(this, '1m_block_count'), - _1mStart: createMetricPattern11(this, '1m_start'), - _1wBlockCount: createMetricPattern1(this, '1w_block_count'), - _1wStart: createMetricPattern11(this, '1w_start'), - _1yBlockCount: createMetricPattern1(this, '1y_block_count'), - _1yStart: createMetricPattern11(this, '1y_start'), - _24hBlockCount: createMetricPattern1(this, '24h_block_count'), - _24hStart: createMetricPattern11(this, '24h_start'), - blockCount: createBlockCountPattern(this, 'block_count'), - blockCountTarget: createMetricPattern4(this, 'block_count_target'), + _1mBlockCount: createMetricPattern1(this, "1m_block_count"), + _1mStart: createMetricPattern11(this, "1m_start"), + _1wBlockCount: createMetricPattern1(this, "1w_block_count"), + _1wStart: createMetricPattern11(this, "1w_start"), + _1yBlockCount: createMetricPattern1(this, "1y_block_count"), + _1yStart: createMetricPattern11(this, "1y_start"), + _24hBlockCount: createMetricPattern1(this, "24h_block_count"), + _24hStart: createMetricPattern11(this, "24h_start"), + blockCount: createBlockCountPattern(this, "block_count"), + blockCountTarget: createMetricPattern4(this, "block_count_target"), }, difficulty: { - adjustment: createMetricPattern1(this, 'difficulty_adjustment'), - asHash: createMetricPattern1(this, 'difficulty_as_hash'), - blocksBeforeNextAdjustment: createMetricPattern1(this, 'blocks_before_next_difficulty_adjustment'), - daysBeforeNextAdjustment: createMetricPattern1(this, 'days_before_next_difficulty_adjustment'), - epoch: createMetricPattern4(this, 'difficultyepoch'), - raw: createMetricPattern1(this, 'difficulty'), + adjustment: createMetricPattern1(this, "difficulty_adjustment"), + asHash: createMetricPattern1(this, "difficulty_as_hash"), + blocksBeforeNextAdjustment: createMetricPattern1( + this, + "blocks_before_next_difficulty_adjustment", + ), + daysBeforeNextAdjustment: createMetricPattern1( + this, + "days_before_next_difficulty_adjustment", + ), + epoch: createMetricPattern4(this, "difficultyepoch"), + raw: createMetricPattern1(this, "difficulty"), }, - fullness: createFullnessPattern(this, 'block_fullness'), + fullness: createFullnessPattern(this, "block_fullness"), halving: { - blocksBeforeNextHalving: createMetricPattern1(this, 'blocks_before_next_halving'), - daysBeforeNextHalving: createMetricPattern1(this, 'days_before_next_halving'), - epoch: createMetricPattern4(this, 'halvingepoch'), + blocksBeforeNextHalving: createMetricPattern1( + this, + "blocks_before_next_halving", + ), + daysBeforeNextHalving: createMetricPattern1( + this, + "days_before_next_halving", + ), + epoch: createMetricPattern4(this, "halvingepoch"), }, interval: { - average: createMetricPattern2(this, 'block_interval_average'), - base: createMetricPattern11(this, 'block_interval'), - max: createMetricPattern2(this, 'block_interval_max'), - median: createMetricPattern6(this, 'block_interval_median'), - min: createMetricPattern2(this, 'block_interval_min'), - pct10: createMetricPattern6(this, 'block_interval_pct10'), - pct25: createMetricPattern6(this, 'block_interval_pct25'), - pct75: createMetricPattern6(this, 'block_interval_pct75'), - pct90: createMetricPattern6(this, 'block_interval_pct90'), + average: createMetricPattern2(this, "block_interval_average"), + base: createMetricPattern11(this, "block_interval"), + max: createMetricPattern2(this, "block_interval_max"), + median: createMetricPattern6(this, "block_interval_median"), + min: createMetricPattern2(this, "block_interval_min"), + pct10: createMetricPattern6(this, "block_interval_pct10"), + pct25: createMetricPattern6(this, "block_interval_pct25"), + pct75: createMetricPattern6(this, "block_interval_pct75"), + pct90: createMetricPattern6(this, "block_interval_pct90"), }, mining: { - hashPricePhs: createMetricPattern1(this, 'hash_price_phs'), - hashPricePhsMin: createMetricPattern1(this, 'hash_price_phs_min'), - hashPriceRebound: createMetricPattern1(this, 'hash_price_rebound'), - hashPriceThs: createMetricPattern1(this, 'hash_price_ths'), - hashPriceThsMin: createMetricPattern1(this, 'hash_price_ths_min'), - hashRate: createMetricPattern1(this, 'hash_rate'), - hashRate1mSma: createMetricPattern4(this, 'hash_rate_1m_sma'), - hashRate1wSma: createMetricPattern4(this, 'hash_rate_1w_sma'), - hashRate1ySma: createMetricPattern4(this, 'hash_rate_1y_sma'), - hashRate2mSma: createMetricPattern4(this, 'hash_rate_2m_sma'), - hashValuePhs: createMetricPattern1(this, 'hash_value_phs'), - hashValuePhsMin: createMetricPattern1(this, 'hash_value_phs_min'), - hashValueRebound: createMetricPattern1(this, 'hash_value_rebound'), - hashValueThs: createMetricPattern1(this, 'hash_value_ths'), - hashValueThsMin: createMetricPattern1(this, 'hash_value_ths_min'), + hashPricePhs: createMetricPattern1(this, "hash_price_phs"), + hashPricePhsMin: createMetricPattern1(this, "hash_price_phs_min"), + hashPriceRebound: createMetricPattern1(this, "hash_price_rebound"), + hashPriceThs: createMetricPattern1(this, "hash_price_ths"), + hashPriceThsMin: createMetricPattern1(this, "hash_price_ths_min"), + hashRate: createMetricPattern1(this, "hash_rate"), + hashRate1mSma: createMetricPattern4(this, "hash_rate_1m_sma"), + hashRate1wSma: createMetricPattern4(this, "hash_rate_1w_sma"), + hashRate1ySma: createMetricPattern4(this, "hash_rate_1y_sma"), + hashRate2mSma: createMetricPattern4(this, "hash_rate_2m_sma"), + hashValuePhs: createMetricPattern1(this, "hash_value_phs"), + hashValuePhsMin: createMetricPattern1(this, "hash_value_phs_min"), + hashValueRebound: createMetricPattern1(this, "hash_value_rebound"), + hashValueThs: createMetricPattern1(this, "hash_value_ths"), + hashValueThsMin: createMetricPattern1(this, "hash_value_ths_min"), }, rewards: { _24hCoinbaseSum: { - bitcoin: createMetricPattern11(this, '24h_coinbase_sum_btc'), - dollars: createMetricPattern11(this, '24h_coinbase_sum_usd'), - sats: createMetricPattern11(this, '24h_coinbase_sum'), + bitcoin: createMetricPattern11(this, "24h_coinbase_sum_btc"), + dollars: createMetricPattern11(this, "24h_coinbase_sum_usd"), + sats: createMetricPattern11(this, "24h_coinbase_sum"), }, - coinbase: createCoinbasePattern(this, 'coinbase'), - feeDominance: createMetricPattern6(this, 'fee_dominance'), - subsidy: createCoinbasePattern(this, 'subsidy'), - subsidyDominance: createMetricPattern6(this, 'subsidy_dominance'), - subsidyUsd1ySma: createMetricPattern4(this, 'subsidy_usd_1y_sma'), - unclaimedRewards: createUnclaimedRewardsPattern(this, 'unclaimed_rewards'), + coinbase: createCoinbasePattern(this, "coinbase"), + feeDominance: createMetricPattern6(this, "fee_dominance"), + subsidy: createCoinbasePattern(this, "subsidy"), + subsidyDominance: createMetricPattern6(this, "subsidy_dominance"), + subsidyUsd1ySma: createMetricPattern4(this, "subsidy_usd_1y_sma"), + unclaimedRewards: createUnclaimedRewardsPattern( + this, + "unclaimed_rewards", + ), }, size: { - average: createMetricPattern2(this, 'block_size_average'), - cumulative: createMetricPattern1(this, 'block_size_cumulative'), - max: createMetricPattern2(this, 'block_size_max'), - median: createMetricPattern6(this, 'block_size_median'), - min: createMetricPattern2(this, 'block_size_min'), - pct10: createMetricPattern6(this, 'block_size_pct10'), - pct25: createMetricPattern6(this, 'block_size_pct25'), - pct75: createMetricPattern6(this, 'block_size_pct75'), - pct90: createMetricPattern6(this, 'block_size_pct90'), - sum: createMetricPattern2(this, 'block_size_sum'), + average: createMetricPattern2(this, "block_size_average"), + cumulative: createMetricPattern1(this, "block_size_cumulative"), + max: createMetricPattern2(this, "block_size_max"), + median: createMetricPattern6(this, "block_size_median"), + min: createMetricPattern2(this, "block_size_min"), + pct10: createMetricPattern6(this, "block_size_pct10"), + pct25: createMetricPattern6(this, "block_size_pct25"), + pct75: createMetricPattern6(this, "block_size_pct75"), + pct90: createMetricPattern6(this, "block_size_pct90"), + sum: createMetricPattern2(this, "block_size_sum"), }, time: { - date: createMetricPattern11(this, 'date'), - dateFixed: createMetricPattern11(this, 'date_fixed'), - timestamp: createMetricPattern1(this, 'timestamp'), - timestampFixed: createMetricPattern11(this, 'timestamp_fixed'), + date: createMetricPattern11(this, "date"), + dateFixed: createMetricPattern11(this, "date_fixed"), + timestamp: createMetricPattern1(this, "timestamp"), + timestampFixed: createMetricPattern11(this, "timestamp_fixed"), }, - totalSize: createMetricPattern11(this, 'total_size'), - vbytes: createDollarsPattern(this, 'block_vbytes'), - weight: createDollarsPattern(this, 'block_weight_average'), + totalSize: createMetricPattern11(this, "total_size"), + vbytes: createDollarsPattern(this, "block_vbytes"), + weight: createDollarsPattern(this, "block_weight_average"), }, cointime: { activity: { - activityToVaultednessRatio: createMetricPattern1(this, 'activity_to_vaultedness_ratio'), - coinblocksCreated: createBlockCountPattern(this, 'coinblocks_created'), - coinblocksStored: createBlockCountPattern(this, 'coinblocks_stored'), - liveliness: createMetricPattern1(this, 'liveliness'), - vaultedness: createMetricPattern1(this, 'vaultedness'), + activityToVaultednessRatio: createMetricPattern1( + this, + "activity_to_vaultedness_ratio", + ), + coinblocksCreated: createBlockCountPattern( + this, + "coinblocks_created", + ), + coinblocksStored: createBlockCountPattern(this, "coinblocks_stored"), + liveliness: createMetricPattern1(this, "liveliness"), + vaultedness: createMetricPattern1(this, "vaultedness"), }, adjusted: { - cointimeAdjInflationRate: createMetricPattern4(this, 'cointime_adj_inflation_rate'), - cointimeAdjTxBtcVelocity: createMetricPattern4(this, 'cointime_adj_tx_btc_velocity'), - cointimeAdjTxUsdVelocity: createMetricPattern4(this, 'cointime_adj_tx_usd_velocity'), + cointimeAdjInflationRate: createMetricPattern4( + this, + "cointime_adj_inflation_rate", + ), + cointimeAdjTxBtcVelocity: createMetricPattern4( + this, + "cointime_adj_tx_btc_velocity", + ), + cointimeAdjTxUsdVelocity: createMetricPattern4( + this, + "cointime_adj_tx_usd_velocity", + ), }, cap: { - activeCap: createMetricPattern1(this, 'active_cap'), - cointimeCap: createMetricPattern1(this, 'cointime_cap'), - investorCap: createMetricPattern1(this, 'investor_cap'), - thermoCap: createMetricPattern1(this, 'thermo_cap'), - vaultedCap: createMetricPattern1(this, 'vaulted_cap'), + activeCap: createMetricPattern1(this, "active_cap"), + cointimeCap: createMetricPattern1(this, "cointime_cap"), + investorCap: createMetricPattern1(this, "investor_cap"), + thermoCap: createMetricPattern1(this, "thermo_cap"), + vaultedCap: createMetricPattern1(this, "vaulted_cap"), }, pricing: { - activePrice: createMetricPattern1(this, 'active_price'), - activePriceRatio: createActivePriceRatioPattern(this, 'active_price_ratio'), - cointimePrice: createMetricPattern1(this, 'cointime_price'), - cointimePriceRatio: createActivePriceRatioPattern(this, 'cointime_price_ratio'), - trueMarketMean: createMetricPattern1(this, 'true_market_mean'), - trueMarketMeanRatio: createActivePriceRatioPattern(this, 'true_market_mean_ratio'), - vaultedPrice: createMetricPattern1(this, 'vaulted_price'), - vaultedPriceRatio: createActivePriceRatioPattern(this, 'vaulted_price_ratio'), + activePrice: createMetricPattern1(this, "active_price"), + activePriceRatio: createActivePriceRatioPattern( + this, + "active_price_ratio", + ), + cointimePrice: createMetricPattern1(this, "cointime_price"), + cointimePriceRatio: createActivePriceRatioPattern( + this, + "cointime_price_ratio", + ), + trueMarketMean: createMetricPattern1(this, "true_market_mean"), + trueMarketMeanRatio: createActivePriceRatioPattern( + this, + "true_market_mean_ratio", + ), + vaultedPrice: createMetricPattern1(this, "vaulted_price"), + vaultedPriceRatio: createActivePriceRatioPattern( + this, + "vaulted_price_ratio", + ), }, supply: { - activeSupply: createActiveSupplyPattern(this, 'active_supply'), - vaultedSupply: createActiveSupplyPattern(this, 'vaulted_supply'), + activeSupply: createActiveSupplyPattern(this, "active_supply"), + vaultedSupply: createActiveSupplyPattern(this, "vaulted_supply"), }, value: { - cointimeValueCreated: createBlockCountPattern(this, 'cointime_value_created'), - cointimeValueDestroyed: createBlockCountPattern(this, 'cointime_value_destroyed'), - cointimeValueStored: createBlockCountPattern(this, 'cointime_value_stored'), + cointimeValueCreated: createBlockCountPattern( + this, + "cointime_value_created", + ), + cointimeValueDestroyed: createBlockCountPattern( + this, + "cointime_value_destroyed", + ), + cointimeValueStored: createBlockCountPattern( + this, + "cointime_value_stored", + ), }, }, constants: { - constant0: createMetricPattern1(this, 'constant_0'), - constant1: createMetricPattern1(this, 'constant_1'), - constant100: createMetricPattern1(this, 'constant_100'), - constant2: createMetricPattern1(this, 'constant_2'), - constant20: createMetricPattern1(this, 'constant_20'), - constant3: createMetricPattern1(this, 'constant_3'), - constant30: createMetricPattern1(this, 'constant_30'), - constant382: createMetricPattern1(this, 'constant_38_2'), - constant4: createMetricPattern1(this, 'constant_4'), - constant50: createMetricPattern1(this, 'constant_50'), - constant600: createMetricPattern1(this, 'constant_600'), - constant618: createMetricPattern1(this, 'constant_61_8'), - constant70: createMetricPattern1(this, 'constant_70'), - constant80: createMetricPattern1(this, 'constant_80'), - constantMinus1: createMetricPattern1(this, 'constant_minus_1'), - constantMinus2: createMetricPattern1(this, 'constant_minus_2'), - constantMinus3: createMetricPattern1(this, 'constant_minus_3'), - constantMinus4: createMetricPattern1(this, 'constant_minus_4'), + constant0: createMetricPattern1(this, "constant_0"), + constant1: createMetricPattern1(this, "constant_1"), + constant100: createMetricPattern1(this, "constant_100"), + constant2: createMetricPattern1(this, "constant_2"), + constant20: createMetricPattern1(this, "constant_20"), + constant3: createMetricPattern1(this, "constant_3"), + constant30: createMetricPattern1(this, "constant_30"), + constant382: createMetricPattern1(this, "constant_38_2"), + constant4: createMetricPattern1(this, "constant_4"), + constant50: createMetricPattern1(this, "constant_50"), + constant600: createMetricPattern1(this, "constant_600"), + constant618: createMetricPattern1(this, "constant_61_8"), + constant70: createMetricPattern1(this, "constant_70"), + constant80: createMetricPattern1(this, "constant_80"), + constantMinus1: createMetricPattern1(this, "constant_minus_1"), + constantMinus2: createMetricPattern1(this, "constant_minus_2"), + constantMinus3: createMetricPattern1(this, "constant_minus_3"), + constantMinus4: createMetricPattern1(this, "constant_minus_4"), }, distribution: { addrCount: { - all: createMetricPattern1(this, 'addr_count'), - p2a: createMetricPattern1(this, 'p2a_addr_count'), - p2pk33: createMetricPattern1(this, 'p2pk33_addr_count'), - p2pk65: createMetricPattern1(this, 'p2pk65_addr_count'), - p2pkh: createMetricPattern1(this, 'p2pkh_addr_count'), - p2sh: createMetricPattern1(this, 'p2sh_addr_count'), - p2tr: createMetricPattern1(this, 'p2tr_addr_count'), - p2wpkh: createMetricPattern1(this, 'p2wpkh_addr_count'), - p2wsh: createMetricPattern1(this, 'p2wsh_addr_count'), + all: createMetricPattern1(this, "addr_count"), + p2a: createMetricPattern1(this, "p2a_addr_count"), + p2pk33: createMetricPattern1(this, "p2pk33_addr_count"), + p2pk65: createMetricPattern1(this, "p2pk65_addr_count"), + p2pkh: createMetricPattern1(this, "p2pkh_addr_count"), + p2sh: createMetricPattern1(this, "p2sh_addr_count"), + p2tr: createMetricPattern1(this, "p2tr_addr_count"), + p2wpkh: createMetricPattern1(this, "p2wpkh_addr_count"), + p2wsh: createMetricPattern1(this, "p2wsh_addr_count"), }, addressCohorts: { amountRange: { - _0sats: create_0satsPattern(this, 'addrs_with_0sats'), - _100btcTo1kBtc: create_0satsPattern(this, 'addrs_above_100btc_under_1k_btc'), - _100kBtcOrMore: create_0satsPattern(this, 'addrs_above_100k_btc'), - _100kSatsTo1mSats: create_0satsPattern(this, 'addrs_above_100k_sats_under_1m_sats'), - _100satsTo1kSats: create_0satsPattern(this, 'addrs_above_100sats_under_1k_sats'), - _10btcTo100btc: create_0satsPattern(this, 'addrs_above_10btc_under_100btc'), - _10kBtcTo100kBtc: create_0satsPattern(this, 'addrs_above_10k_btc_under_100k_btc'), - _10kSatsTo100kSats: create_0satsPattern(this, 'addrs_above_10k_sats_under_100k_sats'), - _10mSatsTo1btc: create_0satsPattern(this, 'addrs_above_10m_sats_under_1btc'), - _10satsTo100sats: create_0satsPattern(this, 'addrs_above_10sats_under_100sats'), - _1btcTo10btc: create_0satsPattern(this, 'addrs_above_1btc_under_10btc'), - _1kBtcTo10kBtc: create_0satsPattern(this, 'addrs_above_1k_btc_under_10k_btc'), - _1kSatsTo10kSats: create_0satsPattern(this, 'addrs_above_1k_sats_under_10k_sats'), - _1mSatsTo10mSats: create_0satsPattern(this, 'addrs_above_1m_sats_under_10m_sats'), - _1satTo10sats: create_0satsPattern(this, 'addrs_above_1sat_under_10sats'), + _0sats: create_0satsPattern(this, "addrs_with_0sats"), + _100btcTo1kBtc: create_0satsPattern( + this, + "addrs_above_100btc_under_1k_btc", + ), + _100kBtcOrMore: create_0satsPattern(this, "addrs_above_100k_btc"), + _100kSatsTo1mSats: create_0satsPattern( + this, + "addrs_above_100k_sats_under_1m_sats", + ), + _100satsTo1kSats: create_0satsPattern( + this, + "addrs_above_100sats_under_1k_sats", + ), + _10btcTo100btc: create_0satsPattern( + this, + "addrs_above_10btc_under_100btc", + ), + _10kBtcTo100kBtc: create_0satsPattern( + this, + "addrs_above_10k_btc_under_100k_btc", + ), + _10kSatsTo100kSats: create_0satsPattern( + this, + "addrs_above_10k_sats_under_100k_sats", + ), + _10mSatsTo1btc: create_0satsPattern( + this, + "addrs_above_10m_sats_under_1btc", + ), + _10satsTo100sats: create_0satsPattern( + this, + "addrs_above_10sats_under_100sats", + ), + _1btcTo10btc: create_0satsPattern( + this, + "addrs_above_1btc_under_10btc", + ), + _1kBtcTo10kBtc: create_0satsPattern( + this, + "addrs_above_1k_btc_under_10k_btc", + ), + _1kSatsTo10kSats: create_0satsPattern( + this, + "addrs_above_1k_sats_under_10k_sats", + ), + _1mSatsTo10mSats: create_0satsPattern( + this, + "addrs_above_1m_sats_under_10m_sats", + ), + _1satTo10sats: create_0satsPattern( + this, + "addrs_above_1sat_under_10sats", + ), }, geAmount: { - _100btc: create_0satsPattern(this, 'addrs_above_100btc'), - _100kSats: create_0satsPattern(this, 'addrs_above_100k_sats'), - _100sats: create_0satsPattern(this, 'addrs_above_100sats'), - _10btc: create_0satsPattern(this, 'addrs_above_10btc'), - _10kBtc: create_0satsPattern(this, 'addrs_above_10k_btc'), - _10kSats: create_0satsPattern(this, 'addrs_above_10k_sats'), - _10mSats: create_0satsPattern(this, 'addrs_above_10m_sats'), - _10sats: create_0satsPattern(this, 'addrs_above_10sats'), - _1btc: create_0satsPattern(this, 'addrs_above_1btc'), - _1kBtc: create_0satsPattern(this, 'addrs_above_1k_btc'), - _1kSats: create_0satsPattern(this, 'addrs_above_1k_sats'), - _1mSats: create_0satsPattern(this, 'addrs_above_1m_sats'), - _1sat: create_0satsPattern(this, 'addrs_above_1sat'), + _100btc: create_0satsPattern(this, "addrs_above_100btc"), + _100kSats: create_0satsPattern(this, "addrs_above_100k_sats"), + _100sats: create_0satsPattern(this, "addrs_above_100sats"), + _10btc: create_0satsPattern(this, "addrs_above_10btc"), + _10kBtc: create_0satsPattern(this, "addrs_above_10k_btc"), + _10kSats: create_0satsPattern(this, "addrs_above_10k_sats"), + _10mSats: create_0satsPattern(this, "addrs_above_10m_sats"), + _10sats: create_0satsPattern(this, "addrs_above_10sats"), + _1btc: create_0satsPattern(this, "addrs_above_1btc"), + _1kBtc: create_0satsPattern(this, "addrs_above_1k_btc"), + _1kSats: create_0satsPattern(this, "addrs_above_1k_sats"), + _1mSats: create_0satsPattern(this, "addrs_above_1m_sats"), + _1sat: create_0satsPattern(this, "addrs_above_1sat"), }, ltAmount: { - _100btc: create_0satsPattern(this, 'addrs_under_100btc'), - _100kBtc: create_0satsPattern(this, 'addrs_under_100k_btc'), - _100kSats: create_0satsPattern(this, 'addrs_under_100k_sats'), - _100sats: create_0satsPattern(this, 'addrs_under_100sats'), - _10btc: create_0satsPattern(this, 'addrs_under_10btc'), - _10kBtc: create_0satsPattern(this, 'addrs_under_10k_btc'), - _10kSats: create_0satsPattern(this, 'addrs_under_10k_sats'), - _10mSats: create_0satsPattern(this, 'addrs_under_10m_sats'), - _10sats: create_0satsPattern(this, 'addrs_under_10sats'), - _1btc: create_0satsPattern(this, 'addrs_under_1btc'), - _1kBtc: create_0satsPattern(this, 'addrs_under_1k_btc'), - _1kSats: create_0satsPattern(this, 'addrs_under_1k_sats'), - _1mSats: create_0satsPattern(this, 'addrs_under_1m_sats'), + _100btc: create_0satsPattern(this, "addrs_under_100btc"), + _100kBtc: create_0satsPattern(this, "addrs_under_100k_btc"), + _100kSats: create_0satsPattern(this, "addrs_under_100k_sats"), + _100sats: create_0satsPattern(this, "addrs_under_100sats"), + _10btc: create_0satsPattern(this, "addrs_under_10btc"), + _10kBtc: create_0satsPattern(this, "addrs_under_10k_btc"), + _10kSats: create_0satsPattern(this, "addrs_under_10k_sats"), + _10mSats: create_0satsPattern(this, "addrs_under_10m_sats"), + _10sats: create_0satsPattern(this, "addrs_under_10sats"), + _1btc: create_0satsPattern(this, "addrs_under_1btc"), + _1kBtc: create_0satsPattern(this, "addrs_under_1k_btc"), + _1kSats: create_0satsPattern(this, "addrs_under_1k_sats"), + _1mSats: create_0satsPattern(this, "addrs_under_1m_sats"), }, }, addressesData: { - empty: createMetricPattern32(this, 'emptyaddressdata'), - loaded: createMetricPattern31(this, 'loadedaddressdata'), + empty: createMetricPattern32(this, "emptyaddressdata"), + loaded: createMetricPattern31(this, "loadedaddressdata"), }, anyAddressIndexes: { - p2a: createMetricPattern16(this, 'anyaddressindex'), - p2pk33: createMetricPattern18(this, 'anyaddressindex'), - p2pk65: createMetricPattern19(this, 'anyaddressindex'), - p2pkh: createMetricPattern20(this, 'anyaddressindex'), - p2sh: createMetricPattern21(this, 'anyaddressindex'), - p2tr: createMetricPattern22(this, 'anyaddressindex'), - p2wpkh: createMetricPattern23(this, 'anyaddressindex'), - p2wsh: createMetricPattern24(this, 'anyaddressindex'), + p2a: createMetricPattern16(this, "anyaddressindex"), + p2pk33: createMetricPattern18(this, "anyaddressindex"), + p2pk65: createMetricPattern19(this, "anyaddressindex"), + p2pkh: createMetricPattern20(this, "anyaddressindex"), + p2sh: createMetricPattern21(this, "anyaddressindex"), + p2tr: createMetricPattern22(this, "anyaddressindex"), + p2wpkh: createMetricPattern23(this, "anyaddressindex"), + p2wsh: createMetricPattern24(this, "anyaddressindex"), }, - chainState: createMetricPattern11(this, 'chain'), + chainState: createMetricPattern11(this, "chain"), emptyAddrCount: { - all: createMetricPattern1(this, 'empty_addr_count'), - p2a: createMetricPattern1(this, 'p2a_empty_addr_count'), - p2pk33: createMetricPattern1(this, 'p2pk33_empty_addr_count'), - p2pk65: createMetricPattern1(this, 'p2pk65_empty_addr_count'), - p2pkh: createMetricPattern1(this, 'p2pkh_empty_addr_count'), - p2sh: createMetricPattern1(this, 'p2sh_empty_addr_count'), - p2tr: createMetricPattern1(this, 'p2tr_empty_addr_count'), - p2wpkh: createMetricPattern1(this, 'p2wpkh_empty_addr_count'), - p2wsh: createMetricPattern1(this, 'p2wsh_empty_addr_count'), + all: createMetricPattern1(this, "empty_addr_count"), + p2a: createMetricPattern1(this, "p2a_empty_addr_count"), + p2pk33: createMetricPattern1(this, "p2pk33_empty_addr_count"), + p2pk65: createMetricPattern1(this, "p2pk65_empty_addr_count"), + p2pkh: createMetricPattern1(this, "p2pkh_empty_addr_count"), + p2sh: createMetricPattern1(this, "p2sh_empty_addr_count"), + p2tr: createMetricPattern1(this, "p2tr_empty_addr_count"), + p2wpkh: createMetricPattern1(this, "p2wpkh_empty_addr_count"), + p2wsh: createMetricPattern1(this, "p2wsh_empty_addr_count"), }, - emptyaddressindex: createMetricPattern32(this, 'emptyaddressindex'), - loadedaddressindex: createMetricPattern31(this, 'loadedaddressindex'), + emptyaddressindex: createMetricPattern32(this, "emptyaddressindex"), + loadedaddressindex: createMetricPattern31(this, "loadedaddressindex"), utxoCohorts: { ageRange: { - _10yTo12y: create_10yTo12yPattern(this, 'utxos_at_least_10y_up_to_12y_old'), - _12yTo15y: create_10yTo12yPattern(this, 'utxos_at_least_12y_up_to_15y_old'), - _1dTo1w: create_10yTo12yPattern(this, 'utxos_at_least_1d_up_to_1w_old'), - _1hTo1d: create_10yTo12yPattern(this, 'utxos_at_least_1h_up_to_1d_old'), - _1mTo2m: create_10yTo12yPattern(this, 'utxos_at_least_1m_up_to_2m_old'), - _1wTo1m: create_10yTo12yPattern(this, 'utxos_at_least_1w_up_to_1m_old'), - _1yTo2y: create_10yTo12yPattern(this, 'utxos_at_least_1y_up_to_2y_old'), - _2mTo3m: create_10yTo12yPattern(this, 'utxos_at_least_2m_up_to_3m_old'), - _2yTo3y: create_10yTo12yPattern(this, 'utxos_at_least_2y_up_to_3y_old'), - _3mTo4m: create_10yTo12yPattern(this, 'utxos_at_least_3m_up_to_4m_old'), - _3yTo4y: create_10yTo12yPattern(this, 'utxos_at_least_3y_up_to_4y_old'), - _4mTo5m: create_10yTo12yPattern(this, 'utxos_at_least_4m_up_to_5m_old'), - _4yTo5y: create_10yTo12yPattern(this, 'utxos_at_least_4y_up_to_5y_old'), - _5mTo6m: create_10yTo12yPattern(this, 'utxos_at_least_5m_up_to_6m_old'), - _5yTo6y: create_10yTo12yPattern(this, 'utxos_at_least_5y_up_to_6y_old'), - _6mTo1y: create_10yTo12yPattern(this, 'utxos_at_least_6m_up_to_1y_old'), - _6yTo7y: create_10yTo12yPattern(this, 'utxos_at_least_6y_up_to_7y_old'), - _7yTo8y: create_10yTo12yPattern(this, 'utxos_at_least_7y_up_to_8y_old'), - _8yTo10y: create_10yTo12yPattern(this, 'utxos_at_least_8y_up_to_10y_old'), - from15y: create_10yTo12yPattern(this, 'utxos_at_least_15y_old'), - upTo1h: create_10yTo12yPattern(this, 'utxos_up_to_1h_old'), + _10yTo12y: create_10yTo12yPattern( + this, + "utxos_at_least_10y_up_to_12y_old", + ), + _12yTo15y: create_10yTo12yPattern( + this, + "utxos_at_least_12y_up_to_15y_old", + ), + _1dTo1w: create_10yTo12yPattern( + this, + "utxos_at_least_1d_up_to_1w_old", + ), + _1hTo1d: create_10yTo12yPattern( + this, + "utxos_at_least_1h_up_to_1d_old", + ), + _1mTo2m: create_10yTo12yPattern( + this, + "utxos_at_least_1m_up_to_2m_old", + ), + _1wTo1m: create_10yTo12yPattern( + this, + "utxos_at_least_1w_up_to_1m_old", + ), + _1yTo2y: create_10yTo12yPattern( + this, + "utxos_at_least_1y_up_to_2y_old", + ), + _2mTo3m: create_10yTo12yPattern( + this, + "utxos_at_least_2m_up_to_3m_old", + ), + _2yTo3y: create_10yTo12yPattern( + this, + "utxos_at_least_2y_up_to_3y_old", + ), + _3mTo4m: create_10yTo12yPattern( + this, + "utxos_at_least_3m_up_to_4m_old", + ), + _3yTo4y: create_10yTo12yPattern( + this, + "utxos_at_least_3y_up_to_4y_old", + ), + _4mTo5m: create_10yTo12yPattern( + this, + "utxos_at_least_4m_up_to_5m_old", + ), + _4yTo5y: create_10yTo12yPattern( + this, + "utxos_at_least_4y_up_to_5y_old", + ), + _5mTo6m: create_10yTo12yPattern( + this, + "utxos_at_least_5m_up_to_6m_old", + ), + _5yTo6y: create_10yTo12yPattern( + this, + "utxos_at_least_5y_up_to_6y_old", + ), + _6mTo1y: create_10yTo12yPattern( + this, + "utxos_at_least_6m_up_to_1y_old", + ), + _6yTo7y: create_10yTo12yPattern( + this, + "utxos_at_least_6y_up_to_7y_old", + ), + _7yTo8y: create_10yTo12yPattern( + this, + "utxos_at_least_7y_up_to_8y_old", + ), + _8yTo10y: create_10yTo12yPattern( + this, + "utxos_at_least_8y_up_to_10y_old", + ), + from15y: create_10yTo12yPattern(this, "utxos_at_least_15y_old"), + upTo1h: create_10yTo12yPattern(this, "utxos_up_to_1h_old"), }, all: { - activity: createActivityPattern2(this, 'coinblocks_destroyed'), + activity: createActivityPattern2(this, "coinblocks_destroyed"), costBasis: { - max: createMetricPattern1(this, 'max_cost_basis'), - min: createMetricPattern1(this, 'min_cost_basis'), - percentiles: createPercentilesPattern(this, 'cost_basis'), + max: createMetricPattern1(this, "max_cost_basis"), + min: createMetricPattern1(this, "min_cost_basis"), + percentiles: createPercentilesPattern(this, "cost_basis"), }, - outputs: createOutputsPattern(this, 'utxo_count'), - realized: createRealizedPattern3(this, 'adjusted_sopr'), + outputs: createOutputsPattern(this, "utxo_count"), + realized: createRealizedPattern3(this, "adjusted_sopr"), relative: { - negUnrealizedLossRelToOwnTotalUnrealizedPnl: createMetricPattern1(this, 'neg_unrealized_loss_rel_to_own_total_unrealized_pnl'), - netUnrealizedPnlRelToOwnTotalUnrealizedPnl: createMetricPattern1(this, 'net_unrealized_pnl_rel_to_own_total_unrealized_pnl'), - supplyInLossRelToOwnSupply: createMetricPattern1(this, 'supply_in_loss_rel_to_own_supply'), - supplyInProfitRelToOwnSupply: createMetricPattern1(this, 'supply_in_profit_rel_to_own_supply'), - unrealizedLossRelToOwnTotalUnrealizedPnl: createMetricPattern1(this, 'unrealized_loss_rel_to_own_total_unrealized_pnl'), - unrealizedProfitRelToOwnTotalUnrealizedPnl: createMetricPattern1(this, 'unrealized_profit_rel_to_own_total_unrealized_pnl'), + negUnrealizedLossRelToOwnTotalUnrealizedPnl: createMetricPattern1( + this, + "neg_unrealized_loss_rel_to_own_total_unrealized_pnl", + ), + netUnrealizedPnlRelToOwnTotalUnrealizedPnl: createMetricPattern1( + this, + "net_unrealized_pnl_rel_to_own_total_unrealized_pnl", + ), + supplyInLossRelToOwnSupply: createMetricPattern1( + this, + "supply_in_loss_rel_to_own_supply", + ), + supplyInProfitRelToOwnSupply: createMetricPattern1( + this, + "supply_in_profit_rel_to_own_supply", + ), + unrealizedLossRelToOwnTotalUnrealizedPnl: createMetricPattern1( + this, + "unrealized_loss_rel_to_own_total_unrealized_pnl", + ), + unrealizedProfitRelToOwnTotalUnrealizedPnl: createMetricPattern1( + this, + "unrealized_profit_rel_to_own_total_unrealized_pnl", + ), }, - supply: createSupplyPattern2(this, 'supply'), - unrealized: createUnrealizedPattern(this, 'neg_unrealized_loss'), + supply: createSupplyPattern2(this, "supply"), + unrealized: createUnrealizedPattern(this, "neg_unrealized_loss"), }, amountRange: { - _0sats: create_0satsPattern2(this, 'utxos_with_0sats'), - _100btcTo1kBtc: create_0satsPattern2(this, 'utxos_above_100btc_under_1k_btc'), - _100kBtcOrMore: create_0satsPattern2(this, 'utxos_above_100k_btc'), - _100kSatsTo1mSats: create_0satsPattern2(this, 'utxos_above_100k_sats_under_1m_sats'), - _100satsTo1kSats: create_0satsPattern2(this, 'utxos_above_100sats_under_1k_sats'), - _10btcTo100btc: create_0satsPattern2(this, 'utxos_above_10btc_under_100btc'), - _10kBtcTo100kBtc: create_0satsPattern2(this, 'utxos_above_10k_btc_under_100k_btc'), - _10kSatsTo100kSats: create_0satsPattern2(this, 'utxos_above_10k_sats_under_100k_sats'), - _10mSatsTo1btc: create_0satsPattern2(this, 'utxos_above_10m_sats_under_1btc'), - _10satsTo100sats: create_0satsPattern2(this, 'utxos_above_10sats_under_100sats'), - _1btcTo10btc: create_0satsPattern2(this, 'utxos_above_1btc_under_10btc'), - _1kBtcTo10kBtc: create_0satsPattern2(this, 'utxos_above_1k_btc_under_10k_btc'), - _1kSatsTo10kSats: create_0satsPattern2(this, 'utxos_above_1k_sats_under_10k_sats'), - _1mSatsTo10mSats: create_0satsPattern2(this, 'utxos_above_1m_sats_under_10m_sats'), - _1satTo10sats: create_0satsPattern2(this, 'utxos_above_1sat_under_10sats'), + _0sats: create_0satsPattern2(this, "utxos_with_0sats"), + _100btcTo1kBtc: create_0satsPattern2( + this, + "utxos_above_100btc_under_1k_btc", + ), + _100kBtcOrMore: create_0satsPattern2(this, "utxos_above_100k_btc"), + _100kSatsTo1mSats: create_0satsPattern2( + this, + "utxos_above_100k_sats_under_1m_sats", + ), + _100satsTo1kSats: create_0satsPattern2( + this, + "utxos_above_100sats_under_1k_sats", + ), + _10btcTo100btc: create_0satsPattern2( + this, + "utxos_above_10btc_under_100btc", + ), + _10kBtcTo100kBtc: create_0satsPattern2( + this, + "utxos_above_10k_btc_under_100k_btc", + ), + _10kSatsTo100kSats: create_0satsPattern2( + this, + "utxos_above_10k_sats_under_100k_sats", + ), + _10mSatsTo1btc: create_0satsPattern2( + this, + "utxos_above_10m_sats_under_1btc", + ), + _10satsTo100sats: create_0satsPattern2( + this, + "utxos_above_10sats_under_100sats", + ), + _1btcTo10btc: create_0satsPattern2( + this, + "utxos_above_1btc_under_10btc", + ), + _1kBtcTo10kBtc: create_0satsPattern2( + this, + "utxos_above_1k_btc_under_10k_btc", + ), + _1kSatsTo10kSats: create_0satsPattern2( + this, + "utxos_above_1k_sats_under_10k_sats", + ), + _1mSatsTo10mSats: create_0satsPattern2( + this, + "utxos_above_1m_sats_under_10m_sats", + ), + _1satTo10sats: create_0satsPattern2( + this, + "utxos_above_1sat_under_10sats", + ), }, epoch: { - _0: create_0satsPattern2(this, 'epoch_0'), - _1: create_0satsPattern2(this, 'epoch_1'), - _2: create_0satsPattern2(this, 'epoch_2'), - _3: create_0satsPattern2(this, 'epoch_3'), - _4: create_0satsPattern2(this, 'epoch_4'), + _0: create_0satsPattern2(this, "epoch_0"), + _1: create_0satsPattern2(this, "epoch_1"), + _2: create_0satsPattern2(this, "epoch_2"), + _3: create_0satsPattern2(this, "epoch_3"), + _4: create_0satsPattern2(this, "epoch_4"), }, geAmount: { - _100btc: create_100btcPattern(this, 'utxos_above_100btc'), - _100kSats: create_100btcPattern(this, 'utxos_above_100k_sats'), - _100sats: create_100btcPattern(this, 'utxos_above_100sats'), - _10btc: create_100btcPattern(this, 'utxos_above_10btc'), - _10kBtc: create_100btcPattern(this, 'utxos_above_10k_btc'), - _10kSats: create_100btcPattern(this, 'utxos_above_10k_sats'), - _10mSats: create_100btcPattern(this, 'utxos_above_10m_sats'), - _10sats: create_100btcPattern(this, 'utxos_above_10sats'), - _1btc: create_100btcPattern(this, 'utxos_above_1btc'), - _1kBtc: create_100btcPattern(this, 'utxos_above_1k_btc'), - _1kSats: create_100btcPattern(this, 'utxos_above_1k_sats'), - _1mSats: create_100btcPattern(this, 'utxos_above_1m_sats'), - _1sat: create_100btcPattern(this, 'utxos_above_1sat'), + _100btc: create_100btcPattern(this, "utxos_above_100btc"), + _100kSats: create_100btcPattern(this, "utxos_above_100k_sats"), + _100sats: create_100btcPattern(this, "utxos_above_100sats"), + _10btc: create_100btcPattern(this, "utxos_above_10btc"), + _10kBtc: create_100btcPattern(this, "utxos_above_10k_btc"), + _10kSats: create_100btcPattern(this, "utxos_above_10k_sats"), + _10mSats: create_100btcPattern(this, "utxos_above_10m_sats"), + _10sats: create_100btcPattern(this, "utxos_above_10sats"), + _1btc: create_100btcPattern(this, "utxos_above_1btc"), + _1kBtc: create_100btcPattern(this, "utxos_above_1k_btc"), + _1kSats: create_100btcPattern(this, "utxos_above_1k_sats"), + _1mSats: create_100btcPattern(this, "utxos_above_1m_sats"), + _1sat: create_100btcPattern(this, "utxos_above_1sat"), }, ltAmount: { - _100btc: create_100btcPattern(this, 'utxos_under_100btc'), - _100kBtc: create_100btcPattern(this, 'utxos_under_100k_btc'), - _100kSats: create_100btcPattern(this, 'utxos_under_100k_sats'), - _100sats: create_100btcPattern(this, 'utxos_under_100sats'), - _10btc: create_100btcPattern(this, 'utxos_under_10btc'), - _10kBtc: create_100btcPattern(this, 'utxos_under_10k_btc'), - _10kSats: create_100btcPattern(this, 'utxos_under_10k_sats'), - _10mSats: create_100btcPattern(this, 'utxos_under_10m_sats'), - _10sats: create_100btcPattern(this, 'utxos_under_10sats'), - _1btc: create_100btcPattern(this, 'utxos_under_1btc'), - _1kBtc: create_100btcPattern(this, 'utxos_under_1k_btc'), - _1kSats: create_100btcPattern(this, 'utxos_under_1k_sats'), - _1mSats: create_100btcPattern(this, 'utxos_under_1m_sats'), + _100btc: create_100btcPattern(this, "utxos_under_100btc"), + _100kBtc: create_100btcPattern(this, "utxos_under_100k_btc"), + _100kSats: create_100btcPattern(this, "utxos_under_100k_sats"), + _100sats: create_100btcPattern(this, "utxos_under_100sats"), + _10btc: create_100btcPattern(this, "utxos_under_10btc"), + _10kBtc: create_100btcPattern(this, "utxos_under_10k_btc"), + _10kSats: create_100btcPattern(this, "utxos_under_10k_sats"), + _10mSats: create_100btcPattern(this, "utxos_under_10m_sats"), + _10sats: create_100btcPattern(this, "utxos_under_10sats"), + _1btc: create_100btcPattern(this, "utxos_under_1btc"), + _1kBtc: create_100btcPattern(this, "utxos_under_1k_btc"), + _1kSats: create_100btcPattern(this, "utxos_under_1k_sats"), + _1mSats: create_100btcPattern(this, "utxos_under_1m_sats"), }, maxAge: { - _10y: create_10yPattern(this, 'utxos_up_to_10y_old'), - _12y: create_10yPattern(this, 'utxos_up_to_12y_old'), - _15y: create_10yPattern(this, 'utxos_up_to_15y_old'), - _1m: create_10yPattern(this, 'utxos_up_to_1m_old'), - _1w: create_10yPattern(this, 'utxos_up_to_1w_old'), - _1y: create_10yPattern(this, 'utxos_up_to_1y_old'), - _2m: create_10yPattern(this, 'utxos_up_to_2m_old'), - _2y: create_10yPattern(this, 'utxos_up_to_2y_old'), - _3m: create_10yPattern(this, 'utxos_up_to_3m_old'), - _3y: create_10yPattern(this, 'utxos_up_to_3y_old'), - _4m: create_10yPattern(this, 'utxos_up_to_4m_old'), - _4y: create_10yPattern(this, 'utxos_up_to_4y_old'), - _5m: create_10yPattern(this, 'utxos_up_to_5m_old'), - _5y: create_10yPattern(this, 'utxos_up_to_5y_old'), - _6m: create_10yPattern(this, 'utxos_up_to_6m_old'), - _6y: create_10yPattern(this, 'utxos_up_to_6y_old'), - _7y: create_10yPattern(this, 'utxos_up_to_7y_old'), - _8y: create_10yPattern(this, 'utxos_up_to_8y_old'), + _10y: create_10yPattern(this, "utxos_up_to_10y_old"), + _12y: create_10yPattern(this, "utxos_up_to_12y_old"), + _15y: create_10yPattern(this, "utxos_up_to_15y_old"), + _1m: create_10yPattern(this, "utxos_up_to_1m_old"), + _1w: create_10yPattern(this, "utxos_up_to_1w_old"), + _1y: create_10yPattern(this, "utxos_up_to_1y_old"), + _2m: create_10yPattern(this, "utxos_up_to_2m_old"), + _2y: create_10yPattern(this, "utxos_up_to_2y_old"), + _3m: create_10yPattern(this, "utxos_up_to_3m_old"), + _3y: create_10yPattern(this, "utxos_up_to_3y_old"), + _4m: create_10yPattern(this, "utxos_up_to_4m_old"), + _4y: create_10yPattern(this, "utxos_up_to_4y_old"), + _5m: create_10yPattern(this, "utxos_up_to_5m_old"), + _5y: create_10yPattern(this, "utxos_up_to_5y_old"), + _6m: create_10yPattern(this, "utxos_up_to_6m_old"), + _6y: create_10yPattern(this, "utxos_up_to_6y_old"), + _7y: create_10yPattern(this, "utxos_up_to_7y_old"), + _8y: create_10yPattern(this, "utxos_up_to_8y_old"), }, minAge: { - _10y: create_100btcPattern(this, 'utxos_at_least_10y_old'), - _12y: create_100btcPattern(this, 'utxos_at_least_12y_old'), - _1d: create_100btcPattern(this, 'utxos_at_least_1d_old'), - _1m: create_100btcPattern(this, 'utxos_at_least_1m_old'), - _1w: create_100btcPattern(this, 'utxos_at_least_1w_old'), - _1y: create_100btcPattern(this, 'utxos_at_least_1y_old'), - _2m: create_100btcPattern(this, 'utxos_at_least_2m_old'), - _2y: create_100btcPattern(this, 'utxos_at_least_2y_old'), - _3m: create_100btcPattern(this, 'utxos_at_least_3m_old'), - _3y: create_100btcPattern(this, 'utxos_at_least_3y_old'), - _4m: create_100btcPattern(this, 'utxos_at_least_4m_old'), - _4y: create_100btcPattern(this, 'utxos_at_least_4y_old'), - _5m: create_100btcPattern(this, 'utxos_at_least_5m_old'), - _5y: create_100btcPattern(this, 'utxos_at_least_5y_old'), - _6m: create_100btcPattern(this, 'utxos_at_least_6m_old'), - _6y: create_100btcPattern(this, 'utxos_at_least_6y_old'), - _7y: create_100btcPattern(this, 'utxos_at_least_7y_old'), - _8y: create_100btcPattern(this, 'utxos_at_least_8y_old'), + _10y: create_100btcPattern(this, "utxos_at_least_10y_old"), + _12y: create_100btcPattern(this, "utxos_at_least_12y_old"), + _1d: create_100btcPattern(this, "utxos_at_least_1d_old"), + _1m: create_100btcPattern(this, "utxos_at_least_1m_old"), + _1w: create_100btcPattern(this, "utxos_at_least_1w_old"), + _1y: create_100btcPattern(this, "utxos_at_least_1y_old"), + _2m: create_100btcPattern(this, "utxos_at_least_2m_old"), + _2y: create_100btcPattern(this, "utxos_at_least_2y_old"), + _3m: create_100btcPattern(this, "utxos_at_least_3m_old"), + _3y: create_100btcPattern(this, "utxos_at_least_3y_old"), + _4m: create_100btcPattern(this, "utxos_at_least_4m_old"), + _4y: create_100btcPattern(this, "utxos_at_least_4y_old"), + _5m: create_100btcPattern(this, "utxos_at_least_5m_old"), + _5y: create_100btcPattern(this, "utxos_at_least_5y_old"), + _6m: create_100btcPattern(this, "utxos_at_least_6m_old"), + _6y: create_100btcPattern(this, "utxos_at_least_6y_old"), + _7y: create_100btcPattern(this, "utxos_at_least_7y_old"), + _8y: create_100btcPattern(this, "utxos_at_least_8y_old"), }, term: { long: { - activity: createActivityPattern2(this, 'lth'), + activity: createActivityPattern2(this, "lth"), costBasis: { - max: createMetricPattern1(this, 'lth_max_cost_basis'), - min: createMetricPattern1(this, 'lth_min_cost_basis'), - percentiles: createPercentilesPattern(this, 'lth_cost_basis'), + max: createMetricPattern1(this, "lth_max_cost_basis"), + min: createMetricPattern1(this, "lth_min_cost_basis"), + percentiles: createPercentilesPattern(this, "lth_cost_basis"), }, - outputs: createOutputsPattern(this, 'lth'), - realized: createRealizedPattern2(this, 'lth'), - relative: createRelativePattern5(this, 'lth'), - supply: createSupplyPattern2(this, 'lth_supply'), - unrealized: createUnrealizedPattern(this, 'lth'), + outputs: createOutputsPattern(this, "lth"), + realized: createRealizedPattern2(this, "lth"), + relative: createRelativePattern5(this, "lth"), + supply: createSupplyPattern2(this, "lth_supply"), + unrealized: createUnrealizedPattern(this, "lth"), }, short: { - activity: createActivityPattern2(this, 'sth'), + activity: createActivityPattern2(this, "sth"), costBasis: { - max: createMetricPattern1(this, 'sth_max_cost_basis'), - min: createMetricPattern1(this, 'sth_min_cost_basis'), - percentiles: createPercentilesPattern(this, 'sth_cost_basis'), + max: createMetricPattern1(this, "sth_max_cost_basis"), + min: createMetricPattern1(this, "sth_min_cost_basis"), + percentiles: createPercentilesPattern(this, "sth_cost_basis"), }, - outputs: createOutputsPattern(this, 'sth'), - realized: createRealizedPattern3(this, 'sth'), - relative: createRelativePattern5(this, 'sth'), - supply: createSupplyPattern2(this, 'sth_supply'), - unrealized: createUnrealizedPattern(this, 'sth'), + outputs: createOutputsPattern(this, "sth"), + realized: createRealizedPattern3(this, "sth"), + relative: createRelativePattern5(this, "sth"), + supply: createSupplyPattern2(this, "sth_supply"), + unrealized: createUnrealizedPattern(this, "sth"), }, }, type: { - empty: create_0satsPattern2(this, 'empty_outputs'), - p2a: create_0satsPattern2(this, 'p2a'), - p2ms: create_0satsPattern2(this, 'p2ms'), - p2pk33: create_0satsPattern2(this, 'p2pk33'), - p2pk65: create_0satsPattern2(this, 'p2pk65'), - p2pkh: create_0satsPattern2(this, 'p2pkh'), - p2sh: create_0satsPattern2(this, 'p2sh'), - p2tr: create_0satsPattern2(this, 'p2tr'), - p2wpkh: create_0satsPattern2(this, 'p2wpkh'), - p2wsh: create_0satsPattern2(this, 'p2wsh'), - unknown: create_0satsPattern2(this, 'unknown_outputs'), + empty: create_0satsPattern2(this, "empty_outputs"), + p2a: create_0satsPattern2(this, "p2a"), + p2ms: create_0satsPattern2(this, "p2ms"), + p2pk33: create_0satsPattern2(this, "p2pk33"), + p2pk65: create_0satsPattern2(this, "p2pk65"), + p2pkh: create_0satsPattern2(this, "p2pkh"), + p2sh: create_0satsPattern2(this, "p2sh"), + p2tr: create_0satsPattern2(this, "p2tr"), + p2wpkh: create_0satsPattern2(this, "p2wpkh"), + p2wsh: create_0satsPattern2(this, "p2wsh"), + unknown: create_0satsPattern2(this, "unknown_outputs"), }, year: { - _2009: create_0satsPattern2(this, 'year_2009'), - _2010: create_0satsPattern2(this, 'year_2010'), - _2011: create_0satsPattern2(this, 'year_2011'), - _2012: create_0satsPattern2(this, 'year_2012'), - _2013: create_0satsPattern2(this, 'year_2013'), - _2014: create_0satsPattern2(this, 'year_2014'), - _2015: create_0satsPattern2(this, 'year_2015'), - _2016: create_0satsPattern2(this, 'year_2016'), - _2017: create_0satsPattern2(this, 'year_2017'), - _2018: create_0satsPattern2(this, 'year_2018'), - _2019: create_0satsPattern2(this, 'year_2019'), - _2020: create_0satsPattern2(this, 'year_2020'), - _2021: create_0satsPattern2(this, 'year_2021'), - _2022: create_0satsPattern2(this, 'year_2022'), - _2023: create_0satsPattern2(this, 'year_2023'), - _2024: create_0satsPattern2(this, 'year_2024'), - _2025: create_0satsPattern2(this, 'year_2025'), - _2026: create_0satsPattern2(this, 'year_2026'), + _2009: create_0satsPattern2(this, "year_2009"), + _2010: create_0satsPattern2(this, "year_2010"), + _2011: create_0satsPattern2(this, "year_2011"), + _2012: create_0satsPattern2(this, "year_2012"), + _2013: create_0satsPattern2(this, "year_2013"), + _2014: create_0satsPattern2(this, "year_2014"), + _2015: create_0satsPattern2(this, "year_2015"), + _2016: create_0satsPattern2(this, "year_2016"), + _2017: create_0satsPattern2(this, "year_2017"), + _2018: create_0satsPattern2(this, "year_2018"), + _2019: create_0satsPattern2(this, "year_2019"), + _2020: create_0satsPattern2(this, "year_2020"), + _2021: create_0satsPattern2(this, "year_2021"), + _2022: create_0satsPattern2(this, "year_2022"), + _2023: create_0satsPattern2(this, "year_2023"), + _2024: create_0satsPattern2(this, "year_2024"), + _2025: create_0satsPattern2(this, "year_2025"), + _2026: create_0satsPattern2(this, "year_2026"), }, }, }, indexes: { address: { empty: { - identity: createMetricPattern9(this, 'emptyoutputindex'), + identity: createMetricPattern9(this, "emptyoutputindex"), }, opreturn: { - identity: createMetricPattern14(this, 'opreturnindex'), + identity: createMetricPattern14(this, "opreturnindex"), }, p2a: { - identity: createMetricPattern16(this, 'p2aaddressindex'), + identity: createMetricPattern16(this, "p2aaddressindex"), }, p2ms: { - identity: createMetricPattern17(this, 'p2msoutputindex'), + identity: createMetricPattern17(this, "p2msoutputindex"), }, p2pk33: { - identity: createMetricPattern18(this, 'p2pk33addressindex'), + identity: createMetricPattern18(this, "p2pk33addressindex"), }, p2pk65: { - identity: createMetricPattern19(this, 'p2pk65addressindex'), + identity: createMetricPattern19(this, "p2pk65addressindex"), }, p2pkh: { - identity: createMetricPattern20(this, 'p2pkhaddressindex'), + identity: createMetricPattern20(this, "p2pkhaddressindex"), }, p2sh: { - identity: createMetricPattern21(this, 'p2shaddressindex'), + identity: createMetricPattern21(this, "p2shaddressindex"), }, p2tr: { - identity: createMetricPattern22(this, 'p2traddressindex'), + identity: createMetricPattern22(this, "p2traddressindex"), }, p2wpkh: { - identity: createMetricPattern23(this, 'p2wpkhaddressindex'), + identity: createMetricPattern23(this, "p2wpkhaddressindex"), }, p2wsh: { - identity: createMetricPattern24(this, 'p2wshaddressindex'), + identity: createMetricPattern24(this, "p2wshaddressindex"), }, unknown: { - identity: createMetricPattern28(this, 'unknownoutputindex'), + identity: createMetricPattern28(this, "unknownoutputindex"), }, }, dateindex: { - date: createMetricPattern6(this, 'dateindex_date'), - firstHeight: createMetricPattern6(this, 'dateindex_first_height'), - heightCount: createMetricPattern6(this, 'dateindex_height_count'), - identity: createMetricPattern6(this, 'dateindex'), - monthindex: createMetricPattern6(this, 'dateindex_monthindex'), - weekindex: createMetricPattern6(this, 'dateindex_weekindex'), + date: createMetricPattern6(this, "dateindex_date"), + firstHeight: createMetricPattern6(this, "dateindex_first_height"), + heightCount: createMetricPattern6(this, "dateindex_height_count"), + identity: createMetricPattern6(this, "dateindex"), + monthindex: createMetricPattern6(this, "dateindex_monthindex"), + weekindex: createMetricPattern6(this, "dateindex_weekindex"), }, decadeindex: { - firstYearindex: createMetricPattern7(this, 'decadeindex_first_yearindex'), - identity: createMetricPattern7(this, 'decadeindex'), - yearindexCount: createMetricPattern7(this, 'decadeindex_yearindex_count'), + firstYearindex: createMetricPattern7( + this, + "decadeindex_first_yearindex", + ), + identity: createMetricPattern7(this, "decadeindex"), + yearindexCount: createMetricPattern7( + this, + "decadeindex_yearindex_count", + ), }, difficultyepoch: { - firstHeight: createMetricPattern8(this, 'difficultyepoch_first_height'), - heightCount: createMetricPattern8(this, 'difficultyepoch_height_count'), - identity: createMetricPattern8(this, 'difficultyepoch'), + firstHeight: createMetricPattern8( + this, + "difficultyepoch_first_height", + ), + heightCount: createMetricPattern8( + this, + "difficultyepoch_height_count", + ), + identity: createMetricPattern8(this, "difficultyepoch"), }, halvingepoch: { - firstHeight: createMetricPattern10(this, 'halvingepoch_first_height'), - identity: createMetricPattern10(this, 'halvingepoch'), + firstHeight: createMetricPattern10(this, "halvingepoch_first_height"), + identity: createMetricPattern10(this, "halvingepoch"), }, height: { - dateindex: createMetricPattern11(this, 'height_dateindex'), - difficultyepoch: createMetricPattern11(this, 'height_difficultyepoch'), - halvingepoch: createMetricPattern11(this, 'height_halvingepoch'), - identity: createMetricPattern11(this, 'height'), - txindexCount: createMetricPattern11(this, 'height_txindex_count'), + dateindex: createMetricPattern11(this, "height_dateindex"), + difficultyepoch: createMetricPattern11( + this, + "height_difficultyepoch", + ), + halvingepoch: createMetricPattern11(this, "height_halvingepoch"), + identity: createMetricPattern11(this, "height"), + txindexCount: createMetricPattern11(this, "height_txindex_count"), }, monthindex: { - dateindexCount: createMetricPattern13(this, 'monthindex_dateindex_count'), - firstDateindex: createMetricPattern13(this, 'monthindex_first_dateindex'), - identity: createMetricPattern13(this, 'monthindex'), - quarterindex: createMetricPattern13(this, 'monthindex_quarterindex'), - semesterindex: createMetricPattern13(this, 'monthindex_semesterindex'), - yearindex: createMetricPattern13(this, 'monthindex_yearindex'), + dateindexCount: createMetricPattern13( + this, + "monthindex_dateindex_count", + ), + firstDateindex: createMetricPattern13( + this, + "monthindex_first_dateindex", + ), + identity: createMetricPattern13(this, "monthindex"), + quarterindex: createMetricPattern13(this, "monthindex_quarterindex"), + semesterindex: createMetricPattern13( + this, + "monthindex_semesterindex", + ), + yearindex: createMetricPattern13(this, "monthindex_yearindex"), }, quarterindex: { - firstMonthindex: createMetricPattern25(this, 'quarterindex_first_monthindex'), - identity: createMetricPattern25(this, 'quarterindex'), - monthindexCount: createMetricPattern25(this, 'quarterindex_monthindex_count'), + firstMonthindex: createMetricPattern25( + this, + "quarterindex_first_monthindex", + ), + identity: createMetricPattern25(this, "quarterindex"), + monthindexCount: createMetricPattern25( + this, + "quarterindex_monthindex_count", + ), }, semesterindex: { - firstMonthindex: createMetricPattern26(this, 'semesterindex_first_monthindex'), - identity: createMetricPattern26(this, 'semesterindex'), - monthindexCount: createMetricPattern26(this, 'semesterindex_monthindex_count'), + firstMonthindex: createMetricPattern26( + this, + "semesterindex_first_monthindex", + ), + identity: createMetricPattern26(this, "semesterindex"), + monthindexCount: createMetricPattern26( + this, + "semesterindex_monthindex_count", + ), }, txindex: { - identity: createMetricPattern27(this, 'txindex'), - inputCount: createMetricPattern27(this, 'txindex_input_count'), - outputCount: createMetricPattern27(this, 'txindex_output_count'), + identity: createMetricPattern27(this, "txindex"), + inputCount: createMetricPattern27(this, "txindex_input_count"), + outputCount: createMetricPattern27(this, "txindex_output_count"), }, txinindex: { - identity: createMetricPattern12(this, 'txinindex'), + identity: createMetricPattern12(this, "txinindex"), }, txoutindex: { - identity: createMetricPattern15(this, 'txoutindex'), + identity: createMetricPattern15(this, "txoutindex"), }, weekindex: { - dateindexCount: createMetricPattern29(this, 'weekindex_dateindex_count'), - firstDateindex: createMetricPattern29(this, 'weekindex_first_dateindex'), - identity: createMetricPattern29(this, 'weekindex'), + dateindexCount: createMetricPattern29( + this, + "weekindex_dateindex_count", + ), + firstDateindex: createMetricPattern29( + this, + "weekindex_first_dateindex", + ), + identity: createMetricPattern29(this, "weekindex"), }, yearindex: { - decadeindex: createMetricPattern30(this, 'yearindex_decadeindex'), - firstMonthindex: createMetricPattern30(this, 'yearindex_first_monthindex'), - identity: createMetricPattern30(this, 'yearindex'), - monthindexCount: createMetricPattern30(this, 'yearindex_monthindex_count'), + decadeindex: createMetricPattern30(this, "yearindex_decadeindex"), + firstMonthindex: createMetricPattern30( + this, + "yearindex_first_monthindex", + ), + identity: createMetricPattern30(this, "yearindex"), + monthindexCount: createMetricPattern30( + this, + "yearindex_monthindex_count", + ), }, }, inputs: { - count: createCountPattern2(this, 'input_count'), - firstTxinindex: createMetricPattern11(this, 'first_txinindex'), - outpoint: createMetricPattern12(this, 'outpoint'), - outputtype: createMetricPattern12(this, 'outputtype'), + count: createCountPattern2(this, "input_count"), + firstTxinindex: createMetricPattern11(this, "first_txinindex"), + outpoint: createMetricPattern12(this, "outpoint"), + outputtype: createMetricPattern12(this, "outputtype"), spent: { - txoutindex: createMetricPattern12(this, 'txoutindex'), - value: createMetricPattern12(this, 'value'), + txoutindex: createMetricPattern12(this, "txoutindex"), + value: createMetricPattern12(this, "value"), }, - txindex: createMetricPattern12(this, 'txindex'), - typeindex: createMetricPattern12(this, 'typeindex'), - witnessSize: createMetricPattern12(this, 'witness_size'), + txindex: createMetricPattern12(this, "txindex"), + typeindex: createMetricPattern12(this, "typeindex"), + witnessSize: createMetricPattern12(this, "witness_size"), }, market: { ath: { - daysSincePriceAth: createMetricPattern4(this, 'days_since_price_ath'), - maxDaysBetweenPriceAths: createMetricPattern4(this, 'max_days_between_price_aths'), - maxYearsBetweenPriceAths: createMetricPattern4(this, 'max_years_between_price_aths'), - priceAth: createMetricPattern1(this, 'price_ath'), - priceDrawdown: createMetricPattern3(this, 'price_drawdown'), - yearsSincePriceAth: createMetricPattern4(this, 'years_since_price_ath'), + daysSincePriceAth: createMetricPattern4(this, "days_since_price_ath"), + maxDaysBetweenPriceAths: createMetricPattern4( + this, + "max_days_between_price_aths", + ), + maxYearsBetweenPriceAths: createMetricPattern4( + this, + "max_years_between_price_aths", + ), + priceAth: createMetricPattern1(this, "price_ath"), + priceDrawdown: createMetricPattern3(this, "price_drawdown"), + yearsSincePriceAth: createMetricPattern4( + this, + "years_since_price_ath", + ), }, dca: { classAveragePrice: { - _2015: createMetricPattern4(this, 'dca_class_2015_average_price'), - _2016: createMetricPattern4(this, 'dca_class_2016_average_price'), - _2017: createMetricPattern4(this, 'dca_class_2017_average_price'), - _2018: createMetricPattern4(this, 'dca_class_2018_average_price'), - _2019: createMetricPattern4(this, 'dca_class_2019_average_price'), - _2020: createMetricPattern4(this, 'dca_class_2020_average_price'), - _2021: createMetricPattern4(this, 'dca_class_2021_average_price'), - _2022: createMetricPattern4(this, 'dca_class_2022_average_price'), - _2023: createMetricPattern4(this, 'dca_class_2023_average_price'), - _2024: createMetricPattern4(this, 'dca_class_2024_average_price'), - _2025: createMetricPattern4(this, 'dca_class_2025_average_price'), + _2015: createMetricPattern4(this, "dca_class_2015_average_price"), + _2016: createMetricPattern4(this, "dca_class_2016_average_price"), + _2017: createMetricPattern4(this, "dca_class_2017_average_price"), + _2018: createMetricPattern4(this, "dca_class_2018_average_price"), + _2019: createMetricPattern4(this, "dca_class_2019_average_price"), + _2020: createMetricPattern4(this, "dca_class_2020_average_price"), + _2021: createMetricPattern4(this, "dca_class_2021_average_price"), + _2022: createMetricPattern4(this, "dca_class_2022_average_price"), + _2023: createMetricPattern4(this, "dca_class_2023_average_price"), + _2024: createMetricPattern4(this, "dca_class_2024_average_price"), + _2025: createMetricPattern4(this, "dca_class_2025_average_price"), }, classReturns: { - _2015: createMetricPattern4(this, 'dca_class_2015_returns'), - _2016: createMetricPattern4(this, 'dca_class_2016_returns'), - _2017: createMetricPattern4(this, 'dca_class_2017_returns'), - _2018: createMetricPattern4(this, 'dca_class_2018_returns'), - _2019: createMetricPattern4(this, 'dca_class_2019_returns'), - _2020: createMetricPattern4(this, 'dca_class_2020_returns'), - _2021: createMetricPattern4(this, 'dca_class_2021_returns'), - _2022: createMetricPattern4(this, 'dca_class_2022_returns'), - _2023: createMetricPattern4(this, 'dca_class_2023_returns'), - _2024: createMetricPattern4(this, 'dca_class_2024_returns'), - _2025: createMetricPattern4(this, 'dca_class_2025_returns'), + _2015: createMetricPattern4(this, "dca_class_2015_returns"), + _2016: createMetricPattern4(this, "dca_class_2016_returns"), + _2017: createMetricPattern4(this, "dca_class_2017_returns"), + _2018: createMetricPattern4(this, "dca_class_2018_returns"), + _2019: createMetricPattern4(this, "dca_class_2019_returns"), + _2020: createMetricPattern4(this, "dca_class_2020_returns"), + _2021: createMetricPattern4(this, "dca_class_2021_returns"), + _2022: createMetricPattern4(this, "dca_class_2022_returns"), + _2023: createMetricPattern4(this, "dca_class_2023_returns"), + _2024: createMetricPattern4(this, "dca_class_2024_returns"), + _2025: createMetricPattern4(this, "dca_class_2025_returns"), }, classStack: { - _2015: create_2015Pattern(this, 'dca_class_2015_stack'), - _2016: create_2015Pattern(this, 'dca_class_2016_stack'), - _2017: create_2015Pattern(this, 'dca_class_2017_stack'), - _2018: create_2015Pattern(this, 'dca_class_2018_stack'), - _2019: create_2015Pattern(this, 'dca_class_2019_stack'), - _2020: create_2015Pattern(this, 'dca_class_2020_stack'), - _2021: create_2015Pattern(this, 'dca_class_2021_stack'), - _2022: create_2015Pattern(this, 'dca_class_2022_stack'), - _2023: create_2015Pattern(this, 'dca_class_2023_stack'), - _2024: create_2015Pattern(this, 'dca_class_2024_stack'), - _2025: create_2015Pattern(this, 'dca_class_2025_stack'), + _2015: create_2015Pattern(this, "dca_class_2015_stack"), + _2016: create_2015Pattern(this, "dca_class_2016_stack"), + _2017: create_2015Pattern(this, "dca_class_2017_stack"), + _2018: create_2015Pattern(this, "dca_class_2018_stack"), + _2019: create_2015Pattern(this, "dca_class_2019_stack"), + _2020: create_2015Pattern(this, "dca_class_2020_stack"), + _2021: create_2015Pattern(this, "dca_class_2021_stack"), + _2022: create_2015Pattern(this, "dca_class_2022_stack"), + _2023: create_2015Pattern(this, "dca_class_2023_stack"), + _2024: create_2015Pattern(this, "dca_class_2024_stack"), + _2025: create_2015Pattern(this, "dca_class_2025_stack"), }, - periodAveragePrice: createPeriodAveragePricePattern(this, 'dca_average_price'), - periodCagr: createPeriodCagrPattern(this, 'dca_cagr'), - periodLumpSumStack: createPeriodLumpSumStackPattern(this, 'lump_sum_stack'), - periodReturns: createPeriodAveragePricePattern(this, 'dca_returns'), - periodStack: createPeriodLumpSumStackPattern(this, 'dca_stack'), + periodAveragePrice: createPeriodAveragePricePattern( + this, + "dca_average_price", + ), + periodCagr: createPeriodCagrPattern(this, "dca_cagr"), + periodLumpSumStack: createPeriodLumpSumStackPattern( + this, + "lump_sum_stack", + ), + periodReturns: createPeriodAveragePricePattern(this, "dca_returns"), + periodStack: createPeriodLumpSumStackPattern(this, "dca_stack"), }, indicators: { - gini: createMetricPattern6(this, 'gini'), - macdHistogram: createMetricPattern6(this, 'macd_histogram'), - macdLine: createMetricPattern6(this, 'macd_line'), - macdSignal: createMetricPattern6(this, 'macd_signal'), - nvt: createMetricPattern4(this, 'nvt'), - piCycle: createMetricPattern6(this, 'pi_cycle'), - puellMultiple: createMetricPattern4(this, 'puell_multiple'), - rsi14d: createMetricPattern6(this, 'rsi_14d'), - rsi14dMax: createMetricPattern6(this, 'rsi_14d_max'), - rsi14dMin: createMetricPattern6(this, 'rsi_14d_min'), - rsiAverageGain14d: createMetricPattern6(this, 'rsi_average_gain_14d'), - rsiAverageLoss14d: createMetricPattern6(this, 'rsi_average_loss_14d'), - rsiGains: createMetricPattern6(this, 'rsi_gains'), - rsiLosses: createMetricPattern6(this, 'rsi_losses'), - stochD: createMetricPattern6(this, 'stoch_d'), - stochK: createMetricPattern6(this, 'stoch_k'), - stochRsi: createMetricPattern6(this, 'stoch_rsi'), - stochRsiD: createMetricPattern6(this, 'stoch_rsi_d'), - stochRsiK: createMetricPattern6(this, 'stoch_rsi_k'), + gini: createMetricPattern6(this, "gini"), + macdHistogram: createMetricPattern6(this, "macd_histogram"), + macdLine: createMetricPattern6(this, "macd_line"), + macdSignal: createMetricPattern6(this, "macd_signal"), + nvt: createMetricPattern4(this, "nvt"), + piCycle: createMetricPattern6(this, "pi_cycle"), + puellMultiple: createMetricPattern4(this, "puell_multiple"), + rsi14d: createMetricPattern6(this, "rsi_14d"), + rsi14dMax: createMetricPattern6(this, "rsi_14d_max"), + rsi14dMin: createMetricPattern6(this, "rsi_14d_min"), + rsiAverageGain14d: createMetricPattern6(this, "rsi_average_gain_14d"), + rsiAverageLoss14d: createMetricPattern6(this, "rsi_average_loss_14d"), + rsiGains: createMetricPattern6(this, "rsi_gains"), + rsiLosses: createMetricPattern6(this, "rsi_losses"), + stochD: createMetricPattern6(this, "stoch_d"), + stochK: createMetricPattern6(this, "stoch_k"), + stochRsi: createMetricPattern6(this, "stoch_rsi"), + stochRsiD: createMetricPattern6(this, "stoch_rsi_d"), + stochRsiK: createMetricPattern6(this, "stoch_rsi_k"), }, lookback: { priceAgo: { - _10y: createMetricPattern4(this, 'price_10y_ago'), - _1d: createMetricPattern4(this, 'price_1d_ago'), - _1m: createMetricPattern4(this, 'price_1m_ago'), - _1w: createMetricPattern4(this, 'price_1w_ago'), - _1y: createMetricPattern4(this, 'price_1y_ago'), - _2y: createMetricPattern4(this, 'price_2y_ago'), - _3m: createMetricPattern4(this, 'price_3m_ago'), - _3y: createMetricPattern4(this, 'price_3y_ago'), - _4y: createMetricPattern4(this, 'price_4y_ago'), - _5y: createMetricPattern4(this, 'price_5y_ago'), - _6m: createMetricPattern4(this, 'price_6m_ago'), - _6y: createMetricPattern4(this, 'price_6y_ago'), - _8y: createMetricPattern4(this, 'price_8y_ago'), + _10y: createMetricPattern4(this, "price_10y_ago"), + _1d: createMetricPattern4(this, "price_1d_ago"), + _1m: createMetricPattern4(this, "price_1m_ago"), + _1w: createMetricPattern4(this, "price_1w_ago"), + _1y: createMetricPattern4(this, "price_1y_ago"), + _2y: createMetricPattern4(this, "price_2y_ago"), + _3m: createMetricPattern4(this, "price_3m_ago"), + _3y: createMetricPattern4(this, "price_3y_ago"), + _4y: createMetricPattern4(this, "price_4y_ago"), + _5y: createMetricPattern4(this, "price_5y_ago"), + _6m: createMetricPattern4(this, "price_6m_ago"), + _6y: createMetricPattern4(this, "price_6y_ago"), + _8y: createMetricPattern4(this, "price_8y_ago"), }, }, movingAverage: { - price111dSma: createPrice111dSmaPattern(this, 'price_111d_sma'), - price12dEma: createPrice111dSmaPattern(this, 'price_12d_ema'), - price13dEma: createPrice111dSmaPattern(this, 'price_13d_ema'), - price13dSma: createPrice111dSmaPattern(this, 'price_13d_sma'), - price144dEma: createPrice111dSmaPattern(this, 'price_144d_ema'), - price144dSma: createPrice111dSmaPattern(this, 'price_144d_sma'), - price1mEma: createPrice111dSmaPattern(this, 'price_1m_ema'), - price1mSma: createPrice111dSmaPattern(this, 'price_1m_sma'), - price1wEma: createPrice111dSmaPattern(this, 'price_1w_ema'), - price1wSma: createPrice111dSmaPattern(this, 'price_1w_sma'), - price1yEma: createPrice111dSmaPattern(this, 'price_1y_ema'), - price1ySma: createPrice111dSmaPattern(this, 'price_1y_sma'), - price200dEma: createPrice111dSmaPattern(this, 'price_200d_ema'), - price200dSma: createPrice111dSmaPattern(this, 'price_200d_sma'), - price200dSmaX08: createMetricPattern4(this, 'price_200d_sma_x0_8'), - price200dSmaX24: createMetricPattern4(this, 'price_200d_sma_x2_4'), - price200wEma: createPrice111dSmaPattern(this, 'price_200w_ema'), - price200wSma: createPrice111dSmaPattern(this, 'price_200w_sma'), - price21dEma: createPrice111dSmaPattern(this, 'price_21d_ema'), - price21dSma: createPrice111dSmaPattern(this, 'price_21d_sma'), - price26dEma: createPrice111dSmaPattern(this, 'price_26d_ema'), - price2yEma: createPrice111dSmaPattern(this, 'price_2y_ema'), - price2ySma: createPrice111dSmaPattern(this, 'price_2y_sma'), - price34dEma: createPrice111dSmaPattern(this, 'price_34d_ema'), - price34dSma: createPrice111dSmaPattern(this, 'price_34d_sma'), - price350dSma: createPrice111dSmaPattern(this, 'price_350d_sma'), - price350dSmaX2: createMetricPattern4(this, 'price_350d_sma_x2'), - price4yEma: createPrice111dSmaPattern(this, 'price_4y_ema'), - price4ySma: createPrice111dSmaPattern(this, 'price_4y_sma'), - price55dEma: createPrice111dSmaPattern(this, 'price_55d_ema'), - price55dSma: createPrice111dSmaPattern(this, 'price_55d_sma'), - price89dEma: createPrice111dSmaPattern(this, 'price_89d_ema'), - price89dSma: createPrice111dSmaPattern(this, 'price_89d_sma'), - price8dEma: createPrice111dSmaPattern(this, 'price_8d_ema'), - price8dSma: createPrice111dSmaPattern(this, 'price_8d_sma'), + price111dSma: createPrice111dSmaPattern(this, "price_111d_sma"), + price12dEma: createPrice111dSmaPattern(this, "price_12d_ema"), + price13dEma: createPrice111dSmaPattern(this, "price_13d_ema"), + price13dSma: createPrice111dSmaPattern(this, "price_13d_sma"), + price144dEma: createPrice111dSmaPattern(this, "price_144d_ema"), + price144dSma: createPrice111dSmaPattern(this, "price_144d_sma"), + price1mEma: createPrice111dSmaPattern(this, "price_1m_ema"), + price1mSma: createPrice111dSmaPattern(this, "price_1m_sma"), + price1wEma: createPrice111dSmaPattern(this, "price_1w_ema"), + price1wSma: createPrice111dSmaPattern(this, "price_1w_sma"), + price1yEma: createPrice111dSmaPattern(this, "price_1y_ema"), + price1ySma: createPrice111dSmaPattern(this, "price_1y_sma"), + price200dEma: createPrice111dSmaPattern(this, "price_200d_ema"), + price200dSma: createPrice111dSmaPattern(this, "price_200d_sma"), + price200dSmaX08: createMetricPattern4(this, "price_200d_sma_x0_8"), + price200dSmaX24: createMetricPattern4(this, "price_200d_sma_x2_4"), + price200wEma: createPrice111dSmaPattern(this, "price_200w_ema"), + price200wSma: createPrice111dSmaPattern(this, "price_200w_sma"), + price21dEma: createPrice111dSmaPattern(this, "price_21d_ema"), + price21dSma: createPrice111dSmaPattern(this, "price_21d_sma"), + price26dEma: createPrice111dSmaPattern(this, "price_26d_ema"), + price2yEma: createPrice111dSmaPattern(this, "price_2y_ema"), + price2ySma: createPrice111dSmaPattern(this, "price_2y_sma"), + price34dEma: createPrice111dSmaPattern(this, "price_34d_ema"), + price34dSma: createPrice111dSmaPattern(this, "price_34d_sma"), + price350dSma: createPrice111dSmaPattern(this, "price_350d_sma"), + price350dSmaX2: createMetricPattern4(this, "price_350d_sma_x2"), + price4yEma: createPrice111dSmaPattern(this, "price_4y_ema"), + price4ySma: createPrice111dSmaPattern(this, "price_4y_sma"), + price55dEma: createPrice111dSmaPattern(this, "price_55d_ema"), + price55dSma: createPrice111dSmaPattern(this, "price_55d_sma"), + price89dEma: createPrice111dSmaPattern(this, "price_89d_ema"), + price89dSma: createPrice111dSmaPattern(this, "price_89d_sma"), + price8dEma: createPrice111dSmaPattern(this, "price_8d_ema"), + price8dSma: createPrice111dSmaPattern(this, "price_8d_sma"), }, range: { - price1mMax: createMetricPattern4(this, 'price_1m_max'), - price1mMin: createMetricPattern4(this, 'price_1m_min'), - price1wMax: createMetricPattern4(this, 'price_1w_max'), - price1wMin: createMetricPattern4(this, 'price_1w_min'), - price1yMax: createMetricPattern4(this, 'price_1y_max'), - price1yMin: createMetricPattern4(this, 'price_1y_min'), - price2wChoppinessIndex: createMetricPattern4(this, 'price_2w_choppiness_index'), - price2wMax: createMetricPattern4(this, 'price_2w_max'), - price2wMin: createMetricPattern4(this, 'price_2w_min'), - priceTrueRange: createMetricPattern6(this, 'price_true_range'), - priceTrueRange2wSum: createMetricPattern6(this, 'price_true_range_2w_sum'), + price1mMax: createMetricPattern4(this, "price_1m_max"), + price1mMin: createMetricPattern4(this, "price_1m_min"), + price1wMax: createMetricPattern4(this, "price_1w_max"), + price1wMin: createMetricPattern4(this, "price_1w_min"), + price1yMax: createMetricPattern4(this, "price_1y_max"), + price1yMin: createMetricPattern4(this, "price_1y_min"), + price2wChoppinessIndex: createMetricPattern4( + this, + "price_2w_choppiness_index", + ), + price2wMax: createMetricPattern4(this, "price_2w_max"), + price2wMin: createMetricPattern4(this, "price_2w_min"), + priceTrueRange: createMetricPattern6(this, "price_true_range"), + priceTrueRange2wSum: createMetricPattern6( + this, + "price_true_range_2w_sum", + ), }, returns: { - _1dReturns1mSd: create_1dReturns1mSdPattern(this, '1d_returns_1m_sd'), - _1dReturns1wSd: create_1dReturns1mSdPattern(this, '1d_returns_1w_sd'), - _1dReturns1ySd: create_1dReturns1mSdPattern(this, '1d_returns_1y_sd'), - cagr: createPeriodCagrPattern(this, 'cagr'), - downside1mSd: create_1dReturns1mSdPattern(this, 'downside_1m_sd'), - downside1wSd: create_1dReturns1mSdPattern(this, 'downside_1w_sd'), - downside1ySd: create_1dReturns1mSdPattern(this, 'downside_1y_sd'), - downsideReturns: createMetricPattern6(this, 'downside_returns'), + _1dReturns1mSd: create_1dReturns1mSdPattern(this, "1d_returns_1m_sd"), + _1dReturns1wSd: create_1dReturns1mSdPattern(this, "1d_returns_1w_sd"), + _1dReturns1ySd: create_1dReturns1mSdPattern(this, "1d_returns_1y_sd"), + cagr: createPeriodCagrPattern(this, "cagr"), + downside1mSd: create_1dReturns1mSdPattern(this, "downside_1m_sd"), + downside1wSd: create_1dReturns1mSdPattern(this, "downside_1w_sd"), + downside1ySd: create_1dReturns1mSdPattern(this, "downside_1y_sd"), + downsideReturns: createMetricPattern6(this, "downside_returns"), priceReturns: { - _10y: createMetricPattern4(this, '10y_price_returns'), - _1d: createMetricPattern4(this, '1d_price_returns'), - _1m: createMetricPattern4(this, '1m_price_returns'), - _1w: createMetricPattern4(this, '1w_price_returns'), - _1y: createMetricPattern4(this, '1y_price_returns'), - _2y: createMetricPattern4(this, '2y_price_returns'), - _3m: createMetricPattern4(this, '3m_price_returns'), - _3y: createMetricPattern4(this, '3y_price_returns'), - _4y: createMetricPattern4(this, '4y_price_returns'), - _5y: createMetricPattern4(this, '5y_price_returns'), - _6m: createMetricPattern4(this, '6m_price_returns'), - _6y: createMetricPattern4(this, '6y_price_returns'), - _8y: createMetricPattern4(this, '8y_price_returns'), + _10y: createMetricPattern4(this, "10y_price_returns"), + _1d: createMetricPattern4(this, "1d_price_returns"), + _1m: createMetricPattern4(this, "1m_price_returns"), + _1w: createMetricPattern4(this, "1w_price_returns"), + _1y: createMetricPattern4(this, "1y_price_returns"), + _2y: createMetricPattern4(this, "2y_price_returns"), + _3m: createMetricPattern4(this, "3m_price_returns"), + _3y: createMetricPattern4(this, "3y_price_returns"), + _4y: createMetricPattern4(this, "4y_price_returns"), + _5y: createMetricPattern4(this, "5y_price_returns"), + _6m: createMetricPattern4(this, "6m_price_returns"), + _6y: createMetricPattern4(this, "6y_price_returns"), + _8y: createMetricPattern4(this, "8y_price_returns"), }, }, volatility: { - price1mVolatility: createMetricPattern4(this, 'price_1m_volatility'), - price1wVolatility: createMetricPattern4(this, 'price_1w_volatility'), - price1yVolatility: createMetricPattern4(this, 'price_1y_volatility'), - sharpe1m: createMetricPattern6(this, 'sharpe_1m'), - sharpe1w: createMetricPattern6(this, 'sharpe_1w'), - sharpe1y: createMetricPattern6(this, 'sharpe_1y'), - sortino1m: createMetricPattern6(this, 'sortino_1m'), - sortino1w: createMetricPattern6(this, 'sortino_1w'), - sortino1y: createMetricPattern6(this, 'sortino_1y'), + price1mVolatility: createMetricPattern4(this, "price_1m_volatility"), + price1wVolatility: createMetricPattern4(this, "price_1w_volatility"), + price1yVolatility: createMetricPattern4(this, "price_1y_volatility"), + sharpe1m: createMetricPattern6(this, "sharpe_1m"), + sharpe1w: createMetricPattern6(this, "sharpe_1w"), + sharpe1y: createMetricPattern6(this, "sharpe_1y"), + sortino1m: createMetricPattern6(this, "sortino_1m"), + sortino1w: createMetricPattern6(this, "sortino_1w"), + sortino1y: createMetricPattern6(this, "sortino_1y"), }, }, outputs: { count: { - totalCount: createCountPattern2(this, 'output_count'), - utxoCount: createMetricPattern1(this, 'exact_utxo_count'), + totalCount: createCountPattern2(this, "output_count"), + utxoCount: createMetricPattern1(this, "exact_utxo_count"), }, - firstTxoutindex: createMetricPattern11(this, 'first_txoutindex'), - outputtype: createMetricPattern15(this, 'outputtype'), + firstTxoutindex: createMetricPattern11(this, "first_txoutindex"), + outputtype: createMetricPattern15(this, "outputtype"), spent: { - txinindex: createMetricPattern15(this, 'txinindex'), + txinindex: createMetricPattern15(this, "txinindex"), }, - txindex: createMetricPattern15(this, 'txindex'), - typeindex: createMetricPattern15(this, 'typeindex'), - value: createMetricPattern15(this, 'value'), + txindex: createMetricPattern15(this, "txindex"), + typeindex: createMetricPattern15(this, "typeindex"), + value: createMetricPattern15(this, "value"), }, pools: { - heightToPool: createMetricPattern11(this, 'pool'), + heightToPool: createMetricPattern11(this, "pool"), vecs: { - aaopool: createAaopoolPattern(this, 'aaopool'), - antpool: createAaopoolPattern(this, 'antpool'), - arkpool: createAaopoolPattern(this, 'arkpool'), - asicminer: createAaopoolPattern(this, 'asicminer'), - axbt: createAaopoolPattern(this, 'axbt'), - batpool: createAaopoolPattern(this, 'batpool'), - bcmonster: createAaopoolPattern(this, 'bcmonster'), - bcpoolio: createAaopoolPattern(this, 'bcpoolio'), - binancepool: createAaopoolPattern(this, 'binancepool'), - bitalo: createAaopoolPattern(this, 'bitalo'), - bitclub: createAaopoolPattern(this, 'bitclub'), - bitcoinaffiliatenetwork: createAaopoolPattern(this, 'bitcoinaffiliatenetwork'), - bitcoincom: createAaopoolPattern(this, 'bitcoincom'), - bitcoinindia: createAaopoolPattern(this, 'bitcoinindia'), - bitcoinrussia: createAaopoolPattern(this, 'bitcoinrussia'), - bitcoinukraine: createAaopoolPattern(this, 'bitcoinukraine'), - bitfarms: createAaopoolPattern(this, 'bitfarms'), - bitfufupool: createAaopoolPattern(this, 'bitfufupool'), - bitfury: createAaopoolPattern(this, 'bitfury'), - bitminter: createAaopoolPattern(this, 'bitminter'), - bitparking: createAaopoolPattern(this, 'bitparking'), - bitsolo: createAaopoolPattern(this, 'bitsolo'), - bixin: createAaopoolPattern(this, 'bixin'), - blockfills: createAaopoolPattern(this, 'blockfills'), - braiinspool: createAaopoolPattern(this, 'braiinspool'), - bravomining: createAaopoolPattern(this, 'bravomining'), - btcc: createAaopoolPattern(this, 'btcc'), - btccom: createAaopoolPattern(this, 'btccom'), - btcdig: createAaopoolPattern(this, 'btcdig'), - btcguild: createAaopoolPattern(this, 'btcguild'), - btclab: createAaopoolPattern(this, 'btclab'), - btcmp: createAaopoolPattern(this, 'btcmp'), - btcnuggets: createAaopoolPattern(this, 'btcnuggets'), - btcpoolparty: createAaopoolPattern(this, 'btcpoolparty'), - btcserv: createAaopoolPattern(this, 'btcserv'), - btctop: createAaopoolPattern(this, 'btctop'), - btpool: createAaopoolPattern(this, 'btpool'), - bwpool: createAaopoolPattern(this, 'bwpool'), - bytepool: createAaopoolPattern(this, 'bytepool'), - canoe: createAaopoolPattern(this, 'canoe'), - canoepool: createAaopoolPattern(this, 'canoepool'), - carbonnegative: createAaopoolPattern(this, 'carbonnegative'), - ckpool: createAaopoolPattern(this, 'ckpool'), - cloudhashing: createAaopoolPattern(this, 'cloudhashing'), - coinlab: createAaopoolPattern(this, 'coinlab'), - cointerra: createAaopoolPattern(this, 'cointerra'), - connectbtc: createAaopoolPattern(this, 'connectbtc'), - dcex: createAaopoolPattern(this, 'dcex'), - dcexploration: createAaopoolPattern(this, 'dcexploration'), - digitalbtc: createAaopoolPattern(this, 'digitalbtc'), - digitalxmintsy: createAaopoolPattern(this, 'digitalxmintsy'), - dpool: createAaopoolPattern(this, 'dpool'), - eclipsemc: createAaopoolPattern(this, 'eclipsemc'), - eightbaochi: createAaopoolPattern(this, 'eightbaochi'), - ekanembtc: createAaopoolPattern(this, 'ekanembtc'), - eligius: createAaopoolPattern(this, 'eligius'), - emcdpool: createAaopoolPattern(this, 'emcdpool'), - entrustcharitypool: createAaopoolPattern(this, 'entrustcharitypool'), - eobot: createAaopoolPattern(this, 'eobot'), - exxbw: createAaopoolPattern(this, 'exxbw'), - f2pool: createAaopoolPattern(this, 'f2pool'), - fiftyeightcoin: createAaopoolPattern(this, 'fiftyeightcoin'), - foundryusa: createAaopoolPattern(this, 'foundryusa'), - futurebitapollosolo: createAaopoolPattern(this, 'futurebitapollosolo'), - gbminers: createAaopoolPattern(this, 'gbminers'), - ghashio: createAaopoolPattern(this, 'ghashio'), - givemecoins: createAaopoolPattern(this, 'givemecoins'), - gogreenlight: createAaopoolPattern(this, 'gogreenlight'), - haominer: createAaopoolPattern(this, 'haominer'), - haozhuzhu: createAaopoolPattern(this, 'haozhuzhu'), - hashbx: createAaopoolPattern(this, 'hashbx'), - hashpool: createAaopoolPattern(this, 'hashpool'), - helix: createAaopoolPattern(this, 'helix'), - hhtt: createAaopoolPattern(this, 'hhtt'), - hotpool: createAaopoolPattern(this, 'hotpool'), - hummerpool: createAaopoolPattern(this, 'hummerpool'), - huobipool: createAaopoolPattern(this, 'huobipool'), - innopolistech: createAaopoolPattern(this, 'innopolistech'), - kanopool: createAaopoolPattern(this, 'kanopool'), - kncminer: createAaopoolPattern(this, 'kncminer'), - kucoinpool: createAaopoolPattern(this, 'kucoinpool'), - lubiancom: createAaopoolPattern(this, 'lubiancom'), - luckypool: createAaopoolPattern(this, 'luckypool'), - luxor: createAaopoolPattern(this, 'luxor'), - marapool: createAaopoolPattern(this, 'marapool'), - maxbtc: createAaopoolPattern(this, 'maxbtc'), - maxipool: createAaopoolPattern(this, 'maxipool'), - megabigpower: createAaopoolPattern(this, 'megabigpower'), - minerium: createAaopoolPattern(this, 'minerium'), - miningcity: createAaopoolPattern(this, 'miningcity'), - miningdutch: createAaopoolPattern(this, 'miningdutch'), - miningkings: createAaopoolPattern(this, 'miningkings'), - miningsquared: createAaopoolPattern(this, 'miningsquared'), - mmpool: createAaopoolPattern(this, 'mmpool'), - mtred: createAaopoolPattern(this, 'mtred'), - multicoinco: createAaopoolPattern(this, 'multicoinco'), - multipool: createAaopoolPattern(this, 'multipool'), - mybtccoinpool: createAaopoolPattern(this, 'mybtccoinpool'), - neopool: createAaopoolPattern(this, 'neopool'), - nexious: createAaopoolPattern(this, 'nexious'), - nicehash: createAaopoolPattern(this, 'nicehash'), - nmcbit: createAaopoolPattern(this, 'nmcbit'), - novablock: createAaopoolPattern(this, 'novablock'), - ocean: createAaopoolPattern(this, 'ocean'), - okexpool: createAaopoolPattern(this, 'okexpool'), - okkong: createAaopoolPattern(this, 'okkong'), - okminer: createAaopoolPattern(this, 'okminer'), - okpooltop: createAaopoolPattern(this, 'okpooltop'), - onehash: createAaopoolPattern(this, 'onehash'), - onem1x: createAaopoolPattern(this, 'onem1x'), - onethash: createAaopoolPattern(this, 'onethash'), - ozcoin: createAaopoolPattern(this, 'ozcoin'), - parasite: createAaopoolPattern(this, 'parasite'), - patels: createAaopoolPattern(this, 'patels'), - pegapool: createAaopoolPattern(this, 'pegapool'), - phashio: createAaopoolPattern(this, 'phashio'), - phoenix: createAaopoolPattern(this, 'phoenix'), - polmine: createAaopoolPattern(this, 'polmine'), - pool175btc: createAaopoolPattern(this, 'pool175btc'), - pool50btc: createAaopoolPattern(this, 'pool50btc'), - poolin: createAaopoolPattern(this, 'poolin'), - portlandhodl: createAaopoolPattern(this, 'portlandhodl'), - publicpool: createAaopoolPattern(this, 'publicpool'), - purebtccom: createAaopoolPattern(this, 'purebtccom'), - rawpool: createAaopoolPattern(this, 'rawpool'), - rigpool: createAaopoolPattern(this, 'rigpool'), - sbicrypto: createAaopoolPattern(this, 'sbicrypto'), - secpool: createAaopoolPattern(this, 'secpool'), - secretsuperstar: createAaopoolPattern(this, 'secretsuperstar'), - sevenpool: createAaopoolPattern(this, 'sevenpool'), - shawnp0wers: createAaopoolPattern(this, 'shawnp0wers'), - sigmapoolcom: createAaopoolPattern(this, 'sigmapoolcom'), - simplecoinus: createAaopoolPattern(this, 'simplecoinus'), - solock: createAaopoolPattern(this, 'solock'), - spiderpool: createAaopoolPattern(this, 'spiderpool'), - stminingcorp: createAaopoolPattern(this, 'stminingcorp'), - tangpool: createAaopoolPattern(this, 'tangpool'), - tatmaspool: createAaopoolPattern(this, 'tatmaspool'), - tbdice: createAaopoolPattern(this, 'tbdice'), - telco214: createAaopoolPattern(this, 'telco214'), - terrapool: createAaopoolPattern(this, 'terrapool'), - tiger: createAaopoolPattern(this, 'tiger'), - tigerpoolnet: createAaopoolPattern(this, 'tigerpoolnet'), - titan: createAaopoolPattern(this, 'titan'), - transactioncoinmining: createAaopoolPattern(this, 'transactioncoinmining'), - trickysbtcpool: createAaopoolPattern(this, 'trickysbtcpool'), - triplemining: createAaopoolPattern(this, 'triplemining'), - twentyoneinc: createAaopoolPattern(this, 'twentyoneinc'), - ultimuspool: createAaopoolPattern(this, 'ultimuspool'), - unknown: createAaopoolPattern(this, 'unknown'), - unomp: createAaopoolPattern(this, 'unomp'), - viabtc: createAaopoolPattern(this, 'viabtc'), - waterhole: createAaopoolPattern(this, 'waterhole'), - wayicn: createAaopoolPattern(this, 'wayicn'), - whitepool: createAaopoolPattern(this, 'whitepool'), - wk057: createAaopoolPattern(this, 'wk057'), - yourbtcnet: createAaopoolPattern(this, 'yourbtcnet'), - zulupool: createAaopoolPattern(this, 'zulupool'), + aaopool: createAaopoolPattern(this, "aaopool"), + antpool: createAaopoolPattern(this, "antpool"), + arkpool: createAaopoolPattern(this, "arkpool"), + asicminer: createAaopoolPattern(this, "asicminer"), + axbt: createAaopoolPattern(this, "axbt"), + batpool: createAaopoolPattern(this, "batpool"), + bcmonster: createAaopoolPattern(this, "bcmonster"), + bcpoolio: createAaopoolPattern(this, "bcpoolio"), + binancepool: createAaopoolPattern(this, "binancepool"), + bitalo: createAaopoolPattern(this, "bitalo"), + bitclub: createAaopoolPattern(this, "bitclub"), + bitcoinaffiliatenetwork: createAaopoolPattern( + this, + "bitcoinaffiliatenetwork", + ), + bitcoincom: createAaopoolPattern(this, "bitcoincom"), + bitcoinindia: createAaopoolPattern(this, "bitcoinindia"), + bitcoinrussia: createAaopoolPattern(this, "bitcoinrussia"), + bitcoinukraine: createAaopoolPattern(this, "bitcoinukraine"), + bitfarms: createAaopoolPattern(this, "bitfarms"), + bitfufupool: createAaopoolPattern(this, "bitfufupool"), + bitfury: createAaopoolPattern(this, "bitfury"), + bitminter: createAaopoolPattern(this, "bitminter"), + bitparking: createAaopoolPattern(this, "bitparking"), + bitsolo: createAaopoolPattern(this, "bitsolo"), + bixin: createAaopoolPattern(this, "bixin"), + blockfills: createAaopoolPattern(this, "blockfills"), + braiinspool: createAaopoolPattern(this, "braiinspool"), + bravomining: createAaopoolPattern(this, "bravomining"), + btcc: createAaopoolPattern(this, "btcc"), + btccom: createAaopoolPattern(this, "btccom"), + btcdig: createAaopoolPattern(this, "btcdig"), + btcguild: createAaopoolPattern(this, "btcguild"), + btclab: createAaopoolPattern(this, "btclab"), + btcmp: createAaopoolPattern(this, "btcmp"), + btcnuggets: createAaopoolPattern(this, "btcnuggets"), + btcpoolparty: createAaopoolPattern(this, "btcpoolparty"), + btcserv: createAaopoolPattern(this, "btcserv"), + btctop: createAaopoolPattern(this, "btctop"), + btpool: createAaopoolPattern(this, "btpool"), + bwpool: createAaopoolPattern(this, "bwpool"), + bytepool: createAaopoolPattern(this, "bytepool"), + canoe: createAaopoolPattern(this, "canoe"), + canoepool: createAaopoolPattern(this, "canoepool"), + carbonnegative: createAaopoolPattern(this, "carbonnegative"), + ckpool: createAaopoolPattern(this, "ckpool"), + cloudhashing: createAaopoolPattern(this, "cloudhashing"), + coinlab: createAaopoolPattern(this, "coinlab"), + cointerra: createAaopoolPattern(this, "cointerra"), + connectbtc: createAaopoolPattern(this, "connectbtc"), + dcex: createAaopoolPattern(this, "dcex"), + dcexploration: createAaopoolPattern(this, "dcexploration"), + digitalbtc: createAaopoolPattern(this, "digitalbtc"), + digitalxmintsy: createAaopoolPattern(this, "digitalxmintsy"), + dpool: createAaopoolPattern(this, "dpool"), + eclipsemc: createAaopoolPattern(this, "eclipsemc"), + eightbaochi: createAaopoolPattern(this, "eightbaochi"), + ekanembtc: createAaopoolPattern(this, "ekanembtc"), + eligius: createAaopoolPattern(this, "eligius"), + emcdpool: createAaopoolPattern(this, "emcdpool"), + entrustcharitypool: createAaopoolPattern(this, "entrustcharitypool"), + eobot: createAaopoolPattern(this, "eobot"), + exxbw: createAaopoolPattern(this, "exxbw"), + f2pool: createAaopoolPattern(this, "f2pool"), + fiftyeightcoin: createAaopoolPattern(this, "fiftyeightcoin"), + foundryusa: createAaopoolPattern(this, "foundryusa"), + futurebitapollosolo: createAaopoolPattern( + this, + "futurebitapollosolo", + ), + gbminers: createAaopoolPattern(this, "gbminers"), + ghashio: createAaopoolPattern(this, "ghashio"), + givemecoins: createAaopoolPattern(this, "givemecoins"), + gogreenlight: createAaopoolPattern(this, "gogreenlight"), + haominer: createAaopoolPattern(this, "haominer"), + haozhuzhu: createAaopoolPattern(this, "haozhuzhu"), + hashbx: createAaopoolPattern(this, "hashbx"), + hashpool: createAaopoolPattern(this, "hashpool"), + helix: createAaopoolPattern(this, "helix"), + hhtt: createAaopoolPattern(this, "hhtt"), + hotpool: createAaopoolPattern(this, "hotpool"), + hummerpool: createAaopoolPattern(this, "hummerpool"), + huobipool: createAaopoolPattern(this, "huobipool"), + innopolistech: createAaopoolPattern(this, "innopolistech"), + kanopool: createAaopoolPattern(this, "kanopool"), + kncminer: createAaopoolPattern(this, "kncminer"), + kucoinpool: createAaopoolPattern(this, "kucoinpool"), + lubiancom: createAaopoolPattern(this, "lubiancom"), + luckypool: createAaopoolPattern(this, "luckypool"), + luxor: createAaopoolPattern(this, "luxor"), + marapool: createAaopoolPattern(this, "marapool"), + maxbtc: createAaopoolPattern(this, "maxbtc"), + maxipool: createAaopoolPattern(this, "maxipool"), + megabigpower: createAaopoolPattern(this, "megabigpower"), + minerium: createAaopoolPattern(this, "minerium"), + miningcity: createAaopoolPattern(this, "miningcity"), + miningdutch: createAaopoolPattern(this, "miningdutch"), + miningkings: createAaopoolPattern(this, "miningkings"), + miningsquared: createAaopoolPattern(this, "miningsquared"), + mmpool: createAaopoolPattern(this, "mmpool"), + mtred: createAaopoolPattern(this, "mtred"), + multicoinco: createAaopoolPattern(this, "multicoinco"), + multipool: createAaopoolPattern(this, "multipool"), + mybtccoinpool: createAaopoolPattern(this, "mybtccoinpool"), + neopool: createAaopoolPattern(this, "neopool"), + nexious: createAaopoolPattern(this, "nexious"), + nicehash: createAaopoolPattern(this, "nicehash"), + nmcbit: createAaopoolPattern(this, "nmcbit"), + novablock: createAaopoolPattern(this, "novablock"), + ocean: createAaopoolPattern(this, "ocean"), + okexpool: createAaopoolPattern(this, "okexpool"), + okkong: createAaopoolPattern(this, "okkong"), + okminer: createAaopoolPattern(this, "okminer"), + okpooltop: createAaopoolPattern(this, "okpooltop"), + onehash: createAaopoolPattern(this, "onehash"), + onem1x: createAaopoolPattern(this, "onem1x"), + onethash: createAaopoolPattern(this, "onethash"), + ozcoin: createAaopoolPattern(this, "ozcoin"), + parasite: createAaopoolPattern(this, "parasite"), + patels: createAaopoolPattern(this, "patels"), + pegapool: createAaopoolPattern(this, "pegapool"), + phashio: createAaopoolPattern(this, "phashio"), + phoenix: createAaopoolPattern(this, "phoenix"), + polmine: createAaopoolPattern(this, "polmine"), + pool175btc: createAaopoolPattern(this, "pool175btc"), + pool50btc: createAaopoolPattern(this, "pool50btc"), + poolin: createAaopoolPattern(this, "poolin"), + portlandhodl: createAaopoolPattern(this, "portlandhodl"), + publicpool: createAaopoolPattern(this, "publicpool"), + purebtccom: createAaopoolPattern(this, "purebtccom"), + rawpool: createAaopoolPattern(this, "rawpool"), + rigpool: createAaopoolPattern(this, "rigpool"), + sbicrypto: createAaopoolPattern(this, "sbicrypto"), + secpool: createAaopoolPattern(this, "secpool"), + secretsuperstar: createAaopoolPattern(this, "secretsuperstar"), + sevenpool: createAaopoolPattern(this, "sevenpool"), + shawnp0wers: createAaopoolPattern(this, "shawnp0wers"), + sigmapoolcom: createAaopoolPattern(this, "sigmapoolcom"), + simplecoinus: createAaopoolPattern(this, "simplecoinus"), + solock: createAaopoolPattern(this, "solock"), + spiderpool: createAaopoolPattern(this, "spiderpool"), + stminingcorp: createAaopoolPattern(this, "stminingcorp"), + tangpool: createAaopoolPattern(this, "tangpool"), + tatmaspool: createAaopoolPattern(this, "tatmaspool"), + tbdice: createAaopoolPattern(this, "tbdice"), + telco214: createAaopoolPattern(this, "telco214"), + terrapool: createAaopoolPattern(this, "terrapool"), + tiger: createAaopoolPattern(this, "tiger"), + tigerpoolnet: createAaopoolPattern(this, "tigerpoolnet"), + titan: createAaopoolPattern(this, "titan"), + transactioncoinmining: createAaopoolPattern( + this, + "transactioncoinmining", + ), + trickysbtcpool: createAaopoolPattern(this, "trickysbtcpool"), + triplemining: createAaopoolPattern(this, "triplemining"), + twentyoneinc: createAaopoolPattern(this, "twentyoneinc"), + ultimuspool: createAaopoolPattern(this, "ultimuspool"), + unknown: createAaopoolPattern(this, "unknown"), + unomp: createAaopoolPattern(this, "unomp"), + viabtc: createAaopoolPattern(this, "viabtc"), + waterhole: createAaopoolPattern(this, "waterhole"), + wayicn: createAaopoolPattern(this, "wayicn"), + whitepool: createAaopoolPattern(this, "whitepool"), + wk057: createAaopoolPattern(this, "wk057"), + yourbtcnet: createAaopoolPattern(this, "yourbtcnet"), + zulupool: createAaopoolPattern(this, "zulupool"), }, }, positions: { - blockPosition: createMetricPattern11(this, 'position'), - txPosition: createMetricPattern27(this, 'position'), + blockPosition: createMetricPattern11(this, "position"), + txPosition: createMetricPattern27(this, "position"), }, price: { cents: { - ohlc: createMetricPattern5(this, 'ohlc_cents'), + ohlc: createMetricPattern5(this, "ohlc_cents"), split: { - close: createMetricPattern5(this, 'price_close_cents'), - high: createMetricPattern5(this, 'price_high_cents'), - low: createMetricPattern5(this, 'price_low_cents'), - open: createMetricPattern5(this, 'price_open_cents'), + close: createMetricPattern5(this, "price_close_cents"), + high: createMetricPattern5(this, "price_high_cents"), + low: createMetricPattern5(this, "price_low_cents"), + open: createMetricPattern5(this, "price_open_cents"), }, }, sats: { - ohlc: createMetricPattern1(this, 'price_ohlc_sats'), - split: createSplitPattern2(this, 'price_sats'), + ohlc: createMetricPattern1(this, "price_ohlc_sats"), + split: createSplitPattern2(this, "price_sats"), }, usd: { - ohlc: createMetricPattern1(this, 'price_ohlc'), - split: createSplitPattern2(this, 'price'), + ohlc: createMetricPattern1(this, "price_ohlc"), + split: createSplitPattern2(this, "price"), }, }, scripts: { count: { - emptyoutput: createDollarsPattern(this, 'emptyoutput_count'), - opreturn: createDollarsPattern(this, 'opreturn_count'), - p2a: createDollarsPattern(this, 'p2a_count'), - p2ms: createDollarsPattern(this, 'p2ms_count'), - p2pk33: createDollarsPattern(this, 'p2pk33_count'), - p2pk65: createDollarsPattern(this, 'p2pk65_count'), - p2pkh: createDollarsPattern(this, 'p2pkh_count'), - p2sh: createDollarsPattern(this, 'p2sh_count'), - p2tr: createDollarsPattern(this, 'p2tr_count'), - p2wpkh: createDollarsPattern(this, 'p2wpkh_count'), - p2wsh: createDollarsPattern(this, 'p2wsh_count'), - segwit: createDollarsPattern(this, 'segwit_count'), - segwitAdoption: createSegwitAdoptionPattern(this, 'segwit_adoption'), - taprootAdoption: createSegwitAdoptionPattern(this, 'taproot_adoption'), - unknownoutput: createDollarsPattern(this, 'unknownoutput_count'), + emptyoutput: createDollarsPattern(this, "emptyoutput_count"), + opreturn: createDollarsPattern(this, "opreturn_count"), + p2a: createDollarsPattern(this, "p2a_count"), + p2ms: createDollarsPattern(this, "p2ms_count"), + p2pk33: createDollarsPattern(this, "p2pk33_count"), + p2pk65: createDollarsPattern(this, "p2pk65_count"), + p2pkh: createDollarsPattern(this, "p2pkh_count"), + p2sh: createDollarsPattern(this, "p2sh_count"), + p2tr: createDollarsPattern(this, "p2tr_count"), + p2wpkh: createDollarsPattern(this, "p2wpkh_count"), + p2wsh: createDollarsPattern(this, "p2wsh_count"), + segwit: createDollarsPattern(this, "segwit_count"), + segwitAdoption: createSegwitAdoptionPattern(this, "segwit_adoption"), + taprootAdoption: createSegwitAdoptionPattern( + this, + "taproot_adoption", + ), + unknownoutput: createDollarsPattern(this, "unknownoutput_count"), }, - emptyToTxindex: createMetricPattern9(this, 'txindex'), - firstEmptyoutputindex: createMetricPattern11(this, 'first_emptyoutputindex'), - firstOpreturnindex: createMetricPattern11(this, 'first_opreturnindex'), - firstP2msoutputindex: createMetricPattern11(this, 'first_p2msoutputindex'), - firstUnknownoutputindex: createMetricPattern11(this, 'first_unknownoutputindex'), - opreturnToTxindex: createMetricPattern14(this, 'txindex'), - p2msToTxindex: createMetricPattern17(this, 'txindex'), - unknownToTxindex: createMetricPattern28(this, 'txindex'), + emptyToTxindex: createMetricPattern9(this, "txindex"), + firstEmptyoutputindex: createMetricPattern11( + this, + "first_emptyoutputindex", + ), + firstOpreturnindex: createMetricPattern11(this, "first_opreturnindex"), + firstP2msoutputindex: createMetricPattern11( + this, + "first_p2msoutputindex", + ), + firstUnknownoutputindex: createMetricPattern11( + this, + "first_unknownoutputindex", + ), + opreturnToTxindex: createMetricPattern14(this, "txindex"), + p2msToTxindex: createMetricPattern17(this, "txindex"), + unknownToTxindex: createMetricPattern28(this, "txindex"), value: { - opreturn: createCoinbasePattern(this, 'opreturn_value'), + opreturn: createCoinbasePattern(this, "opreturn_value"), }, }, supply: { burned: { - opreturn: createUnclaimedRewardsPattern(this, 'opreturn_supply'), - unspendable: createUnclaimedRewardsPattern(this, 'unspendable_supply'), + opreturn: createUnclaimedRewardsPattern(this, "opreturn_supply"), + unspendable: createUnclaimedRewardsPattern( + this, + "unspendable_supply", + ), }, circulating: { - bitcoin: createMetricPattern3(this, 'circulating_supply_btc'), - dollars: createMetricPattern3(this, 'circulating_supply_usd'), - sats: createMetricPattern3(this, 'circulating_supply'), + bitcoin: createMetricPattern3(this, "circulating_supply_btc"), + dollars: createMetricPattern3(this, "circulating_supply_usd"), + sats: createMetricPattern3(this, "circulating_supply"), }, - inflation: createMetricPattern4(this, 'inflation_rate'), - marketCap: createMetricPattern1(this, 'market_cap'), + inflation: createMetricPattern4(this, "inflation_rate"), + marketCap: createMetricPattern1(this, "market_cap"), velocity: { - btc: createMetricPattern4(this, 'btc_velocity'), - usd: createMetricPattern4(this, 'usd_velocity'), + btc: createMetricPattern4(this, "btc_velocity"), + usd: createMetricPattern4(this, "usd_velocity"), }, }, transactions: { - baseSize: createMetricPattern27(this, 'base_size'), + baseSize: createMetricPattern27(this, "base_size"), count: { - isCoinbase: createMetricPattern27(this, 'is_coinbase'), - txCount: createDollarsPattern(this, 'tx_count'), + isCoinbase: createMetricPattern27(this, "is_coinbase"), + txCount: createDollarsPattern(this, "tx_count"), }, fees: { fee: { - bitcoin: createCountPattern2(this, 'fee_btc'), + bitcoin: createCountPattern2(this, "fee_btc"), dollars: { - average: createMetricPattern1(this, 'fee_usd_average'), - cumulative: createMetricPattern2(this, 'fee_usd_cumulative'), - heightCumulative: createMetricPattern11(this, 'fee_usd_cumulative'), - max: createMetricPattern1(this, 'fee_usd_max'), - median: createMetricPattern11(this, 'fee_usd_median'), - min: createMetricPattern1(this, 'fee_usd_min'), - pct10: createMetricPattern11(this, 'fee_usd_pct10'), - pct25: createMetricPattern11(this, 'fee_usd_pct25'), - pct75: createMetricPattern11(this, 'fee_usd_pct75'), - pct90: createMetricPattern11(this, 'fee_usd_pct90'), - sum: createMetricPattern1(this, 'fee_usd_sum'), + average: createMetricPattern1(this, "fee_usd_average"), + cumulative: createMetricPattern2(this, "fee_usd_cumulative"), + heightCumulative: createMetricPattern11( + this, + "fee_usd_cumulative", + ), + max: createMetricPattern1(this, "fee_usd_max"), + median: createMetricPattern11(this, "fee_usd_median"), + min: createMetricPattern1(this, "fee_usd_min"), + pct10: createMetricPattern11(this, "fee_usd_pct10"), + pct25: createMetricPattern11(this, "fee_usd_pct25"), + pct75: createMetricPattern11(this, "fee_usd_pct75"), + pct90: createMetricPattern11(this, "fee_usd_pct90"), + sum: createMetricPattern1(this, "fee_usd_sum"), }, - sats: createCountPattern2(this, 'fee'), - txindex: createMetricPattern27(this, 'fee'), + sats: createCountPattern2(this, "fee"), + txindex: createMetricPattern27(this, "fee"), }, - feeRate: createFeeRatePattern(this, 'fee_rate'), - inputValue: createMetricPattern27(this, 'input_value'), - outputValue: createMetricPattern27(this, 'output_value'), + feeRate: createFeeRatePattern(this, "fee_rate"), + inputValue: createMetricPattern27(this, "input_value"), + outputValue: createMetricPattern27(this, "output_value"), }, - firstTxindex: createMetricPattern11(this, 'first_txindex'), - firstTxinindex: createMetricPattern27(this, 'first_txinindex'), - firstTxoutindex: createMetricPattern27(this, 'first_txoutindex'), - height: createMetricPattern27(this, 'height'), - isExplicitlyRbf: createMetricPattern27(this, 'is_explicitly_rbf'), - rawlocktime: createMetricPattern27(this, 'rawlocktime'), + firstTxindex: createMetricPattern11(this, "first_txindex"), + firstTxinindex: createMetricPattern27(this, "first_txinindex"), + firstTxoutindex: createMetricPattern27(this, "first_txoutindex"), + height: createMetricPattern27(this, "height"), + isExplicitlyRbf: createMetricPattern27(this, "is_explicitly_rbf"), + rawlocktime: createMetricPattern27(this, "rawlocktime"), size: { - vsize: createFeeRatePattern(this, 'tx_vsize_average'), - weight: createFeeRatePattern(this, 'tx_weight_average'), + vsize: createFeeRatePattern(this, "tx_vsize_average"), + weight: createFeeRatePattern(this, "tx_weight_average"), }, - totalSize: createMetricPattern27(this, 'total_size'), - txid: createMetricPattern27(this, 'txid'), - txversion: createMetricPattern27(this, 'txversion'), + totalSize: createMetricPattern27(this, "total_size"), + txid: createMetricPattern27(this, "txid"), + txversion: createMetricPattern27(this, "txversion"), versions: { - v1: createBlockCountPattern(this, 'tx_v1'), - v2: createBlockCountPattern(this, 'tx_v2'), - v3: createBlockCountPattern(this, 'tx_v3'), + v1: createBlockCountPattern(this, "tx_v1"), + v2: createBlockCountPattern(this, "tx_v2"), + v3: createBlockCountPattern(this, "tx_v3"), }, volume: { - annualizedVolume: create_2015Pattern(this, 'annualized_volume'), - inputsPerSec: createMetricPattern4(this, 'inputs_per_sec'), - outputsPerSec: createMetricPattern4(this, 'outputs_per_sec'), - sentSum: createActiveSupplyPattern(this, 'sent_sum'), - txPerSec: createMetricPattern4(this, 'tx_per_sec'), + annualizedVolume: create_2015Pattern(this, "annualized_volume"), + inputsPerSec: createMetricPattern4(this, "inputs_per_sec"), + outputsPerSec: createMetricPattern4(this, "outputs_per_sec"), + sentSum: createActiveSupplyPattern(this, "sent_sum"), + txPerSec: createMetricPattern4(this, "tx_per_sec"), }, }, }; @@ -6892,7 +7723,11 @@ class BrkClient extends BrkClientBase { /** * Address information * - * Retrieve comprehensive information about a Bitcoin address including balance, transaction history, UTXOs, and estimated investment metrics. Supports all standard Bitcoin address types (P2PKH, P2SH, P2WPKH, P2WSH, P2TR, etc.). + * Retrieve address information including balance and transaction counts. Supports all standard Bitcoin address types (P2PKH, P2SH, P2WPKH, P2WSH, P2TR). + * + * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-address)* + * + * Endpoint: `GET /api/address/{address}` * * @param {Address} address * @returns {Promise} @@ -6906,6 +7741,10 @@ class BrkClient extends BrkClientBase { * * Get transaction IDs for an address, newest first. Use after_txid for pagination. * + * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-address-transactions)* + * + * Endpoint: `GET /api/address/{address}/txs` + * * @param {Address} address * @param {string=} [after_txid] - Txid to paginate from (return transactions before this one) * @param {number=} [limit] - Maximum number of results to return. Defaults to 25 if not specified. @@ -6913,10 +7752,10 @@ class BrkClient extends BrkClientBase { */ async getAddressTxs(address, after_txid, limit) { const params = new URLSearchParams(); - if (after_txid !== undefined) params.set('after_txid', String(after_txid)); - if (limit !== undefined) params.set('limit', String(limit)); + if (after_txid !== undefined) params.set("after_txid", String(after_txid)); + if (limit !== undefined) params.set("limit", String(limit)); const query = params.toString(); - const path = `/api/address/${address}/txs${query ? '?' + query : ''}`; + const path = `/api/address/${address}/txs${query ? "?" + query : ""}`; return this.getJson(path); } @@ -6925,17 +7764,21 @@ class BrkClient extends BrkClientBase { * * Get confirmed transaction IDs for an address, 25 per page. Use ?after_txid= for pagination. * + * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-address-transactions-chain)* + * + * Endpoint: `GET /api/address/{address}/txs/chain` + * * @param {Address} address * @param {string=} [after_txid] - Txid to paginate from (return transactions before this one) * @param {number=} [limit] - Maximum number of results to return. Defaults to 25 if not specified. * @returns {Promise} */ - async getAddressTxsChain(address, after_txid, limit) { + async getAddressConfirmedTxs(address, after_txid, limit) { const params = new URLSearchParams(); - if (after_txid !== undefined) params.set('after_txid', String(after_txid)); - if (limit !== undefined) params.set('limit', String(limit)); + if (after_txid !== undefined) params.set("after_txid", String(after_txid)); + if (limit !== undefined) params.set("limit", String(limit)); const query = params.toString(); - const path = `/api/address/${address}/txs/chain${query ? '?' + query : ''}`; + const path = `/api/address/${address}/txs/chain${query ? "?" + query : ""}`; return this.getJson(path); } @@ -6944,22 +7787,30 @@ class BrkClient extends BrkClientBase { * * Get unconfirmed transaction IDs for an address from the mempool (up to 50). * + * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-address-transactions-mempool)* + * + * Endpoint: `GET /api/address/{address}/txs/mempool` + * * @param {Address} address * @returns {Promise} */ - async getAddressTxsMempool(address) { + async getAddressMempoolTxs(address) { return this.getJson(`/api/address/${address}/txs/mempool`); } /** * Address UTXOs * - * Get unspent transaction outputs for an address. + * Get unspent transaction outputs (UTXOs) for an address. Returns txid, vout, value, and confirmation status for each UTXO. + * + * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-address-utxo)* + * + * Endpoint: `GET /api/address/{address}/utxo` * * @param {Address} address * @returns {Promise} */ - async getAddressUtxo(address) { + async getAddressUtxos(address) { return this.getJson(`/api/address/${address}/utxo`); } @@ -6968,10 +7819,14 @@ class BrkClient extends BrkClientBase { * * Retrieve block information by block height. Returns block metadata including hash, timestamp, difficulty, size, weight, and transaction count. * + * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-height)* + * + * Endpoint: `GET /api/block-height/{height}` + * * @param {Height} height * @returns {Promise} */ - async getBlockHeight(height) { + async getBlockByHeight(height) { return this.getJson(`/api/block-height/${height}`); } @@ -6980,10 +7835,14 @@ class BrkClient extends BrkClientBase { * * Retrieve block information by block hash. Returns block metadata including height, timestamp, difficulty, size, weight, and transaction count. * + * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block)* + * + * Endpoint: `GET /api/block/{hash}` + * * @param {BlockHash} hash * @returns {Promise} */ - async getBlockByHash(hash) { + async getBlock(hash) { return this.getJson(`/api/block/${hash}`); } @@ -6992,10 +7851,14 @@ class BrkClient extends BrkClientBase { * * Returns the raw block data in binary format. * + * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-raw)* + * + * Endpoint: `GET /api/block/{hash}/raw` + * * @param {BlockHash} hash * @returns {Promise} */ - async getBlockByHashRaw(hash) { + async getBlockRaw(hash) { return this.getJson(`/api/block/${hash}/raw`); } @@ -7004,10 +7867,14 @@ class BrkClient extends BrkClientBase { * * 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. * + * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-status)* + * + * Endpoint: `GET /api/block/{hash}/status` + * * @param {BlockHash} hash * @returns {Promise} */ - async getBlockByHashStatus(hash) { + async getBlockStatus(hash) { return this.getJson(`/api/block/${hash}/status`); } @@ -7016,23 +7883,31 @@ class BrkClient extends BrkClientBase { * * Retrieve a single transaction ID at a specific index within a block. Returns plain text txid. * + * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-transaction-id)* + * + * Endpoint: `GET /api/block/{hash}/txid/{index}` + * * @param {BlockHash} hash - Bitcoin block hash * @param {TxIndex} index - Transaction index within the block (0-based) * @returns {Promise} */ - async getBlockByHashTxidByIndex(hash, index) { + async getBlockTxid(hash, index) { return this.getJson(`/api/block/${hash}/txid/${index}`); } /** * Block transaction IDs * - * Retrieve all transaction IDs in a block by block hash. + * Retrieve all transaction IDs in a block. Returns an array of txids in block order. + * + * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-transaction-ids)* + * + * Endpoint: `GET /api/block/{hash}/txids` * * @param {BlockHash} hash * @returns {Promise} */ - async getBlockByHashTxids(hash) { + async getBlockTxids(hash) { return this.getJson(`/api/block/${hash}/txids`); } @@ -7041,11 +7916,15 @@ class BrkClient extends BrkClientBase { * * Retrieve transactions in a block by block hash, starting from the specified index. Returns up to 25 transactions at a time. * + * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-transactions)* + * + * Endpoint: `GET /api/block/{hash}/txs/{start_index}` + * * @param {BlockHash} hash - Bitcoin block hash * @param {TxIndex} start_index - Starting transaction index within the block (0-based) * @returns {Promise} */ - async getBlockByHashTxsByStartIndex(hash, start_index) { + async getBlockTxs(hash, start_index) { return this.getJson(`/api/block/${hash}/txs/${start_index}`); } @@ -7053,6 +7932,10 @@ class BrkClient extends BrkClientBase { * Recent blocks * * Retrieve the last 10 blocks. Returns block metadata for each block. + * + * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-blocks)* + * + * Endpoint: `GET /api/blocks` * @returns {Promise} */ async getBlocks() { @@ -7064,10 +7947,14 @@ class BrkClient extends BrkClientBase { * * 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. * + * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-blocks)* + * + * Endpoint: `GET /api/blocks/{height}` + * * @param {Height} height * @returns {Promise} */ - async getBlocksByHeight(height) { + async getBlocksFromHeight(height) { return this.getJson(`/api/blocks/${height}`); } @@ -7075,9 +7962,13 @@ class BrkClient extends BrkClientBase { * Mempool statistics * * Get current mempool statistics including transaction count, total vsize, and total fees. + * + * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-mempool)* + * + * Endpoint: `GET /api/mempool/info` * @returns {Promise} */ - async getMempoolInfo() { + async getMempool() { return this.getJson(`/api/mempool/info`); } @@ -7085,6 +7976,10 @@ class BrkClient extends BrkClientBase { * Mempool transaction IDs * * Get all transaction IDs currently in the mempool. + * + * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-mempool-transaction-ids)* + * + * Endpoint: `GET /api/mempool/txids` * @returns {Promise} */ async getMempoolTxids() { @@ -7094,12 +7989,14 @@ class BrkClient extends BrkClientBase { /** * Get supported indexes for a metric * - * Returns the list of indexes are supported by the specified metric. For example, `realized_price` might be available on dateindex, weekindex, and monthindex. + * Returns the list of indexes supported by the specified metric. For example, `realized_price` might be available on dateindex, weekindex, and monthindex. + * + * Endpoint: `GET /api/metric/{metric}` * * @param {Metric} metric * @returns {Promise} */ - async getMetric(metric) { + async getMetricInfo(metric) { return this.getJson(`/api/metric/${metric}`); } @@ -7108,6 +8005,8 @@ class BrkClient extends BrkClientBase { * * Fetch data for a specific metric at the given index. Use query parameters to filter by date range and format (json/csv). * + * Endpoint: `GET /api/metric/{metric}/{index}` + * * @param {Metric} metric - Metric name * @param {Index} index - Aggregation index * @param {number=} [start] - Inclusive starting index, if negative counts from end @@ -7116,15 +8015,15 @@ class BrkClient extends BrkClientBase { * @param {Format=} [format] - Format of the output * @returns {Promise} */ - async getMetricByIndex(metric, index, start, end, limit, format) { + async getMetric(metric, index, start, end, limit, format) { const params = new URLSearchParams(); - if (start !== undefined) params.set('start', String(start)); - if (end !== undefined) params.set('end', String(end)); - if (limit !== undefined) params.set('limit', String(limit)); - if (format !== undefined) params.set('format', String(format)); + if (start !== undefined) params.set("start", String(start)); + if (end !== undefined) params.set("end", String(end)); + if (limit !== undefined) params.set("limit", String(limit)); + if (format !== undefined) params.set("format", String(format)); const query = params.toString(); - const path = `/api/metric/${metric}/${index}${query ? '?' + query : ''}`; - if (format === 'csv') { + const path = `/api/metric/${metric}/${index}${query ? "?" + query : ""}`; + if (format === "csv") { return this.getText(path); } return this.getJson(path); @@ -7133,17 +8032,21 @@ class BrkClient extends BrkClientBase { /** * Metrics catalog * - * Returns the complete hierarchical catalog of available metrics organized as a tree structure. Metrics are grouped by categories and subcategories. Best viewed in an interactive JSON viewer (e.g., Firefox's built-in JSON viewer) for easy navigation of the nested structure. + * Returns the complete hierarchical catalog of available metrics organized as a tree structure. Metrics are grouped by categories and subcategories. + * + * Endpoint: `GET /api/metrics` * @returns {Promise} */ - async getMetrics() { + async getMetricsTree() { return this.getJson(`/api/metrics`); } /** * Bulk metric data * - * Fetch multiple metrics in a single request. Supports filtering by index and date range. Returns an array of MetricData objects. + * Fetch multiple metrics in a single request. Supports filtering by index and date range. Returns an array of MetricData objects. For a single metric, use `get_metric` instead. + * + * Endpoint: `GET /api/metrics/bulk` * * @param {Metrics} [metrics] - Requested metrics * @param {Index} [index] - Index to query @@ -7153,17 +8056,17 @@ class BrkClient extends BrkClientBase { * @param {Format=} [format] - Format of the output * @returns {Promise} */ - async getMetricsBulk(metrics, index, start, end, limit, format) { + async getMetrics(metrics, index, start, end, limit, format) { const params = new URLSearchParams(); - params.set('metrics', String(metrics)); - params.set('index', String(index)); - if (start !== undefined) params.set('start', String(start)); - if (end !== undefined) params.set('end', String(end)); - if (limit !== undefined) params.set('limit', String(limit)); - if (format !== undefined) params.set('format', String(format)); + params.set("metrics", String(metrics)); + params.set("index", String(index)); + if (start !== undefined) params.set("start", String(start)); + if (end !== undefined) params.set("end", String(end)); + if (limit !== undefined) params.set("limit", String(limit)); + if (format !== undefined) params.set("format", String(format)); const query = params.toString(); - const path = `/api/metrics/bulk${query ? '?' + query : ''}`; - if (format === 'csv') { + const path = `/api/metrics/bulk${query ? "?" + query : ""}`; + if (format === "csv") { return this.getText(path); } return this.getJson(path); @@ -7172,7 +8075,9 @@ class BrkClient extends BrkClientBase { /** * Metric count * - * Current metric count + * Returns the number of metrics available per index type. + * + * Endpoint: `GET /api/metrics/count` * @returns {Promise} */ async getMetricsCount() { @@ -7183,25 +8088,29 @@ class BrkClient extends BrkClientBase { * List available indexes * * Returns all available indexes with their accepted query aliases. Use any alias when querying metrics. + * + * Endpoint: `GET /api/metrics/indexes` * @returns {Promise} */ - async getMetricsIndexes() { + async getIndexes() { return this.getJson(`/api/metrics/indexes`); } /** * Metrics list * - * Paginated list of available metrics + * Paginated flat list of all available metric names. Use `page` query param for pagination. + * + * Endpoint: `GET /api/metrics/list` * * @param {number=} [page] - Pagination index * @returns {Promise} */ - async getMetricsList(page) { + async listMetrics(page) { const params = new URLSearchParams(); - if (page !== undefined) params.set('page', String(page)); + if (page !== undefined) params.set("page", String(page)); const query = params.toString(); - const path = `/api/metrics/list${query ? '?' + query : ''}`; + const path = `/api/metrics/list${query ? "?" + query : ""}`; return this.getJson(path); } @@ -7210,27 +8119,33 @@ class BrkClient extends BrkClientBase { * * Fuzzy search for metrics by name. Supports partial matches and typos. * + * Endpoint: `GET /api/metrics/search/{metric}` + * * @param {Metric} metric * @param {Limit=} [limit] * @returns {Promise} */ - async getMetricsSearchByMetric(metric, limit) { + async searchMetrics(metric, limit) { const params = new URLSearchParams(); - if (limit !== undefined) params.set('limit', String(limit)); + if (limit !== undefined) params.set("limit", String(limit)); const query = params.toString(); - const path = `/api/metrics/search/${metric}${query ? '?' + query : ''}`; + const path = `/api/metrics/search/${metric}${query ? "?" + query : ""}`; return this.getJson(path); } /** * Transaction information * - * Retrieve complete transaction data by transaction ID (txid). Returns the full transaction details including inputs, outputs, and metadata. The transaction data is read directly from the blockchain data files. + * Retrieve complete transaction data by transaction ID (txid). Returns inputs, outputs, fee, size, and confirmation status. + * + * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-transaction)* + * + * Endpoint: `GET /api/tx/{txid}` * * @param {Txid} txid * @returns {Promise} */ - async getTxByTxid(txid) { + async getTx(txid) { return this.getJson(`/api/tx/${txid}`); } @@ -7239,10 +8154,14 @@ class BrkClient extends BrkClientBase { * * Retrieve the raw transaction as a hex-encoded string. Returns the serialized transaction in hexadecimal format. * + * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-transaction-hex)* + * + * Endpoint: `GET /api/tx/{txid}/hex` + * * @param {Txid} txid * @returns {Promise} */ - async getTxByTxidHex(txid) { + async getTxHex(txid) { return this.getJson(`/api/tx/${txid}/hex`); } @@ -7251,11 +8170,15 @@ class BrkClient extends BrkClientBase { * * Get the spending status of a transaction output. Returns whether the output has been spent and, if so, the spending transaction details. * + * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-transaction-outspend)* + * + * Endpoint: `GET /api/tx/{txid}/outspend/{vout}` + * * @param {Txid} txid - Transaction ID * @param {Vout} vout - Output index * @returns {Promise} */ - async getTxByTxidOutspendByVout(txid, vout) { + async getTxOutspend(txid, vout) { return this.getJson(`/api/tx/${txid}/outspend/${vout}`); } @@ -7264,10 +8187,14 @@ class BrkClient extends BrkClientBase { * * Get the spending status of all outputs in a transaction. Returns an array with the spend status for each output. * + * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-transaction-outspends)* + * + * Endpoint: `GET /api/tx/{txid}/outspends` + * * @param {Txid} txid * @returns {Promise} */ - async getTxByTxidOutspends(txid) { + async getTxOutspends(txid) { return this.getJson(`/api/tx/${txid}/outspends`); } @@ -7276,10 +8203,14 @@ class BrkClient extends BrkClientBase { * * Retrieve the confirmation status of a transaction. Returns whether the transaction is confirmed and, if so, the block height, hash, and timestamp. * + * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-transaction-status)* + * + * Endpoint: `GET /api/tx/{txid}/status` + * * @param {Txid} txid * @returns {Promise} */ - async getTxByTxidStatus(txid) { + async getTxStatus(txid) { return this.getJson(`/api/tx/${txid}/status`); } @@ -7287,9 +8218,13 @@ class BrkClient extends BrkClientBase { * Difficulty adjustment * * Get current difficulty adjustment information including progress through the current epoch, estimated retarget date, and difficulty change prediction. + * + * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-difficulty-adjustment)* + * + * Endpoint: `GET /api/v1/difficulty-adjustment` * @returns {Promise} */ - async getV1DifficultyAdjustment() { + async getDifficultyAdjustment() { return this.getJson(`/api/v1/difficulty-adjustment`); } @@ -7297,9 +8232,13 @@ class BrkClient extends BrkClientBase { * Projected mempool blocks * * Get projected blocks from the mempool for fee estimation. Each block contains statistics about transactions that would be included if a block were mined now. + * + * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-mempool-blocks-fees)* + * + * Endpoint: `GET /api/v1/fees/mempool-blocks` * @returns {Promise} */ - async getV1FeesMempoolBlocks() { + async getMempoolBlocks() { return this.getJson(`/api/v1/fees/mempool-blocks`); } @@ -7307,21 +8246,45 @@ class BrkClient extends BrkClientBase { * Recommended fees * * Get recommended fee rates for different confirmation targets based on current mempool state. + * + * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-recommended-fees)* + * + * Endpoint: `GET /api/v1/fees/recommended` * @returns {Promise} */ - async getV1FeesRecommended() { + async getRecommendedFees() { return this.getJson(`/api/v1/fees/recommended`); } + /** + * Block fee rates (WIP) + * + * **Work in progress.** Get block fee rate percentiles (min, 10th, 25th, median, 75th, 90th, max) for a time period. Valid periods: 24h, 3d, 1w, 1m, 3m, 6m, 1y, 2y, 3y + * + * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-feerates)* + * + * Endpoint: `GET /api/v1/mining/blocks/fee-rates/{time_period}` + * + * @param {TimePeriod} time_period + * @returns {Promise<*>} + */ + async getBlockFeeRates(time_period) { + return this.getJson(`/api/v1/mining/blocks/fee-rates/${time_period}`); + } + /** * Block fees * * Get average block fees for a time period. Valid periods: 24h, 3d, 1w, 1m, 3m, 6m, 1y, 2y, 3y * + * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-fees)* + * + * Endpoint: `GET /api/v1/mining/blocks/fees/{time_period}` + * * @param {TimePeriod} time_period * @returns {Promise} */ - async getV1MiningBlocksFeesByTimePeriod(time_period) { + async getBlockFees(time_period) { return this.getJson(`/api/v1/mining/blocks/fees/${time_period}`); } @@ -7330,10 +8293,14 @@ class BrkClient extends BrkClientBase { * * Get average block rewards (coinbase = subsidy + fees) for a time period. Valid periods: 24h, 3d, 1w, 1m, 3m, 6m, 1y, 2y, 3y * + * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-rewards)* + * + * Endpoint: `GET /api/v1/mining/blocks/rewards/{time_period}` + * * @param {TimePeriod} time_period * @returns {Promise} */ - async getV1MiningBlocksRewardsByTimePeriod(time_period) { + async getBlockRewards(time_period) { return this.getJson(`/api/v1/mining/blocks/rewards/${time_period}`); } @@ -7342,10 +8309,14 @@ class BrkClient extends BrkClientBase { * * Get average block sizes and weights for a time period. Valid periods: 24h, 3d, 1w, 1m, 3m, 6m, 1y, 2y, 3y * + * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-sizes-weights)* + * + * Endpoint: `GET /api/v1/mining/blocks/sizes-weights/{time_period}` + * * @param {TimePeriod} time_period * @returns {Promise} */ - async getV1MiningBlocksSizesWeightsByTimePeriod(time_period) { + async getBlockSizesWeights(time_period) { return this.getJson(`/api/v1/mining/blocks/sizes-weights/${time_period}`); } @@ -7354,32 +8325,44 @@ class BrkClient extends BrkClientBase { * * Find the block closest to a given UNIX timestamp. * + * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-timestamp)* + * + * Endpoint: `GET /api/v1/mining/blocks/timestamp/{timestamp}` + * * @param {Timestamp} timestamp * @returns {Promise} */ - async getV1MiningBlocksTimestamp(timestamp) { + async getBlockByTimestamp(timestamp) { return this.getJson(`/api/v1/mining/blocks/timestamp/${timestamp}`); } /** * Difficulty adjustments (all time) * - * Get historical difficulty adjustments. Returns array of [timestamp, height, difficulty, change_percent]. + * Get historical difficulty adjustments including timestamp, block height, difficulty value, and percentage change. + * + * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-difficulty-adjustments)* + * + * Endpoint: `GET /api/v1/mining/difficulty-adjustments` * @returns {Promise} */ - async getV1MiningDifficultyAdjustments() { + async getDifficultyAdjustments() { return this.getJson(`/api/v1/mining/difficulty-adjustments`); } /** * Difficulty adjustments * - * Get historical difficulty adjustments for a time period. Valid periods: 24h, 3d, 1w, 1m, 3m, 6m, 1y, 2y, 3y. Returns array of [timestamp, height, difficulty, change_percent]. + * Get historical difficulty adjustments for a time period. Valid periods: 24h, 3d, 1w, 1m, 3m, 6m, 1y, 2y, 3y. + * + * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-difficulty-adjustments)* + * + * Endpoint: `GET /api/v1/mining/difficulty-adjustments/{time_period}` * * @param {TimePeriod} time_period * @returns {Promise} */ - async getV1MiningDifficultyAdjustmentsByTimePeriod(time_period) { + async getDifficultyAdjustmentsByPeriod(time_period) { return this.getJson(`/api/v1/mining/difficulty-adjustments/${time_period}`); } @@ -7387,9 +8370,13 @@ class BrkClient extends BrkClientBase { * Network hashrate (all time) * * Get network hashrate and difficulty data for all time. + * + * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-hashrate)* + * + * Endpoint: `GET /api/v1/mining/hashrate` * @returns {Promise} */ - async getV1MiningHashrate() { + async getHashrate() { return this.getJson(`/api/v1/mining/hashrate`); } @@ -7398,10 +8385,14 @@ class BrkClient extends BrkClientBase { * * Get network hashrate and difficulty data for a time period. Valid periods: 24h, 3d, 1w, 1m, 3m, 6m, 1y, 2y, 3y * + * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-hashrate)* + * + * Endpoint: `GET /api/v1/mining/hashrate/{time_period}` + * * @param {TimePeriod} time_period * @returns {Promise} */ - async getV1MiningHashrateByTimePeriod(time_period) { + async getHashrateByPeriod(time_period) { return this.getJson(`/api/v1/mining/hashrate/${time_period}`); } @@ -7410,10 +8401,14 @@ class BrkClient extends BrkClientBase { * * Get detailed information about a specific mining pool including block counts and shares for different time periods. * + * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-mining-pool)* + * + * Endpoint: `GET /api/v1/mining/pool/{slug}` + * * @param {PoolSlug} slug * @returns {Promise} */ - async getV1MiningPoolBySlug(slug) { + async getPool(slug) { return this.getJson(`/api/v1/mining/pool/${slug}`); } @@ -7421,9 +8416,13 @@ class BrkClient extends BrkClientBase { * List all mining pools * * Get list of all known mining pools with their identifiers. + * + * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-mining-pools)* + * + * Endpoint: `GET /api/v1/mining/pools` * @returns {Promise} */ - async getV1MiningPools() { + async getPools() { return this.getJson(`/api/v1/mining/pools`); } @@ -7432,10 +8431,14 @@ class BrkClient extends BrkClientBase { * * Get mining pool statistics for a time period. Valid periods: 24h, 3d, 1w, 1m, 3m, 6m, 1y, 2y, 3y * + * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-mining-pools)* + * + * Endpoint: `GET /api/v1/mining/pools/{time_period}` + * * @param {TimePeriod} time_period * @returns {Promise} */ - async getV1MiningPoolsByTimePeriod(time_period) { + async getPoolStats(time_period) { return this.getJson(`/api/v1/mining/pools/${time_period}`); } @@ -7444,10 +8447,14 @@ class BrkClient extends BrkClientBase { * * Get mining reward statistics for the last N blocks including total rewards, fees, and transaction count. * + * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-reward-stats)* + * + * Endpoint: `GET /api/v1/mining/reward-stats/{block_count}` + * * @param {number} block_count - Number of recent blocks to include * @returns {Promise} */ - async getV1MiningRewardStatsByBlockCount(block_count) { + async getRewardStats(block_count) { return this.getJson(`/api/v1/mining/reward-stats/${block_count}`); } @@ -7456,10 +8463,14 @@ class BrkClient extends BrkClientBase { * * Validate a Bitcoin address and get information about its type and scriptPubKey. * + * *[Mempool.space docs](https://mempool.space/docs/api/rest#get-address-validate)* + * + * Endpoint: `GET /api/v1/validate-address/{address}` + * * @param {string} address - Bitcoin address to validate (can be any string) * @returns {Promise} */ - async getV1ValidateAddress(address) { + async validateAddress(address) { return this.getJson(`/api/v1/validate-address/${address}`); } @@ -7467,6 +8478,8 @@ class BrkClient extends BrkClientBase { * Health check * * Returns the health status of the API server + * + * Endpoint: `GET /health` * @returns {Promise} */ async getHealth() { @@ -7477,12 +8490,13 @@ class BrkClient extends BrkClientBase { * API version * * Returns the current version of the API server + * + * Endpoint: `GET /version` * @returns {Promise} */ async getVersion() { return this.getJson(`/version`); } - } export { BrkClient, BrkError }; diff --git a/packages/brk_client/README.md b/packages/brk_client/README.md index ffb72925a..ef943d473 100644 --- a/packages/brk_client/README.md +++ b/packages/brk_client/README.md @@ -1,8 +1,8 @@ -# brk_client +# brk-client -Python client for the [Bitcoin Research Kit](https://bitcoinresearchkit.org) - a suite of tools to extract, compute and display data stored on a Bitcoin Core node. +Python client for the [Bitcoin Research Kit](https://github.com/bitcoinresearchkit/brk) API. -[Documentation](/DOCS.md) +[PyPI](https://pypi.org/project/brk-client/) | [API Reference](https://github.com/bitcoinresearchkit/brk/blob/main/packages/brk_client/DOCS.md) ## Installation @@ -10,6 +10,33 @@ Python client for the [Bitcoin Research Kit](https://bitcoinresearchkit.org) - a pip install brk-client ``` +## Quick Start + +```python +from brk_client import BrkClient + +client = BrkClient("http://localhost:3000") + +# Blockchain data (mempool.space compatible) +block = client.get_block_by_height(800000) +tx = client.get_tx("abc123...") +address = client.get_address("bc1q...") + +# Metrics API - typed, chainable +prices = client.metrics.price.usd.split.close \ + .by.dateindex() \ + .range(-30) # Last 30 days + +# Generic metric fetching +data = client.get_metric("price_close", "dateindex", -30) +``` + +## Configuration + +```python +client = BrkClient("http://localhost:3000", timeout=60.0) +``` + ## License MIT diff --git a/packages/brk_client/brk_client/__init__.py b/packages/brk_client/brk_client/__init__.py index 58f42776d..c0e605603 100644 --- a/packages/brk_client/brk_client/__init__.py +++ b/packages/brk_client/brk_client/__init__.py @@ -1,22 +1,12 @@ # Auto-generated BRK Python client # Do not edit manually -import json -from http.client import HTTPConnection, HTTPSConnection -from typing import ( - Any, - Generic, - List, - Literal, - Optional, - Protocol, - TypedDict, - TypeVar, - Union, -) +from typing import TypeVar, Generic, Any, Optional, List, Literal, TypedDict, Union, Protocol +from http.client import HTTPSConnection, HTTPConnection from urllib.parse import urlparse +import json -T = TypeVar("T") +T = TypeVar('T') # Type definitions @@ -81,20 +71,7 @@ Open = Cents OpReturnIndex = TypeIndex OutPoint = int # Type (P2PKH, P2WPKH, P2SH, P2TR, etc.) -OutputType = Literal[ - "p2pk65", - "p2pk33", - "p2pkh", - "p2ms", - "p2sh", - "opreturn", - "p2wpkh", - "p2wsh", - "p2tr", - "p2a", - "empty", - "unknown", -] +OutputType = Literal["p2pk65", "p2pk33", "p2pkh", "p2ms", "p2sh", "opreturn", "p2wpkh", "p2wsh", "p2tr", "p2a", "empty", "unknown"] P2AAddressIndex = TypeIndex U8x2 = List[int] P2ABytes = U8x2 @@ -117,166 +94,7 @@ P2WPKHAddressIndex = TypeIndex P2WPKHBytes = U8x20 P2WSHAddressIndex = TypeIndex P2WSHBytes = U8x32 -PoolSlug = Literal[ - "unknown", - "blockfills", - "ultimuspool", - "terrapool", - "luxor", - "onethash", - "btccom", - "bitfarms", - "huobipool", - "wayicn", - "canoepool", - "btctop", - "bitcoincom", - "pool175btc", - "gbminers", - "axbt", - "asicminer", - "bitminter", - "bitcoinrussia", - "btcserv", - "simplecoinus", - "btcguild", - "eligius", - "ozcoin", - "eclipsemc", - "maxbtc", - "triplemining", - "coinlab", - "pool50btc", - "ghashio", - "stminingcorp", - "bitparking", - "mmpool", - "polmine", - "kncminer", - "bitalo", - "f2pool", - "hhtt", - "megabigpower", - "mtred", - "nmcbit", - "yourbtcnet", - "givemecoins", - "braiinspool", - "antpool", - "multicoinco", - "bcpoolio", - "cointerra", - "kanopool", - "solock", - "ckpool", - "nicehash", - "bitclub", - "bitcoinaffiliatenetwork", - "btcc", - "bwpool", - "exxbw", - "bitsolo", - "bitfury", - "twentyoneinc", - "digitalbtc", - "eightbaochi", - "mybtccoinpool", - "tbdice", - "hashpool", - "nexious", - "bravomining", - "hotpool", - "okexpool", - "bcmonster", - "onehash", - "bixin", - "tatmaspool", - "viabtc", - "connectbtc", - "batpool", - "waterhole", - "dcexploration", - "dcex", - "btpool", - "fiftyeightcoin", - "bitcoinindia", - "shawnp0wers", - "phashio", - "rigpool", - "haozhuzhu", - "sevenpool", - "miningkings", - "hashbx", - "dpool", - "rawpool", - "haominer", - "helix", - "bitcoinukraine", - "poolin", - "secretsuperstar", - "tigerpoolnet", - "sigmapoolcom", - "okpooltop", - "hummerpool", - "tangpool", - "bytepool", - "spiderpool", - "novablock", - "miningcity", - "binancepool", - "minerium", - "lubiancom", - "okkong", - "aaopool", - "emcdpool", - "foundryusa", - "sbicrypto", - "arkpool", - "purebtccom", - "marapool", - "kucoinpool", - "entrustcharitypool", - "okminer", - "titan", - "pegapool", - "btcnuggets", - "cloudhashing", - "digitalxmintsy", - "telco214", - "btcpoolparty", - "multipool", - "transactioncoinmining", - "btcdig", - "trickysbtcpool", - "btcmp", - "eobot", - "unomp", - "patels", - "gogreenlight", - "ekanembtc", - "canoe", - "tiger", - "onem1x", - "zulupool", - "secpool", - "ocean", - "whitepool", - "wk057", - "futurebitapollosolo", - "carbonnegative", - "portlandhodl", - "phoenix", - "neopool", - "maxipool", - "bitfufupool", - "luckypool", - "miningdutch", - "publicpool", - "miningsquared", - "innopolistech", - "btclab", - "parasite", -] +PoolSlug = Literal["unknown", "blockfills", "ultimuspool", "terrapool", "luxor", "onethash", "btccom", "bitfarms", "huobipool", "wayicn", "canoepool", "btctop", "bitcoincom", "pool175btc", "gbminers", "axbt", "asicminer", "bitminter", "bitcoinrussia", "btcserv", "simplecoinus", "btcguild", "eligius", "ozcoin", "eclipsemc", "maxbtc", "triplemining", "coinlab", "pool50btc", "ghashio", "stminingcorp", "bitparking", "mmpool", "polmine", "kncminer", "bitalo", "f2pool", "hhtt", "megabigpower", "mtred", "nmcbit", "yourbtcnet", "givemecoins", "braiinspool", "antpool", "multicoinco", "bcpoolio", "cointerra", "kanopool", "solock", "ckpool", "nicehash", "bitclub", "bitcoinaffiliatenetwork", "btcc", "bwpool", "exxbw", "bitsolo", "bitfury", "twentyoneinc", "digitalbtc", "eightbaochi", "mybtccoinpool", "tbdice", "hashpool", "nexious", "bravomining", "hotpool", "okexpool", "bcmonster", "onehash", "bixin", "tatmaspool", "viabtc", "connectbtc", "batpool", "waterhole", "dcexploration", "dcex", "btpool", "fiftyeightcoin", "bitcoinindia", "shawnp0wers", "phashio", "rigpool", "haozhuzhu", "sevenpool", "miningkings", "hashbx", "dpool", "rawpool", "haominer", "helix", "bitcoinukraine", "poolin", "secretsuperstar", "tigerpoolnet", "sigmapoolcom", "okpooltop", "hummerpool", "tangpool", "bytepool", "spiderpool", "novablock", "miningcity", "binancepool", "minerium", "lubiancom", "okkong", "aaopool", "emcdpool", "foundryusa", "sbicrypto", "arkpool", "purebtccom", "marapool", "kucoinpool", "entrustcharitypool", "okminer", "titan", "pegapool", "btcnuggets", "cloudhashing", "digitalxmintsy", "telco214", "btcpoolparty", "multipool", "transactioncoinmining", "btcdig", "trickysbtcpool", "btcmp", "eobot", "unomp", "patels", "gogreenlight", "ekanembtc", "canoe", "tiger", "onem1x", "zulupool", "secpool", "ocean", "whitepool", "wk057", "futurebitapollosolo", "carbonnegative", "portlandhodl", "phoenix", "neopool", "maxipool", "bitfufupool", "luckypool", "miningdutch", "publicpool", "miningsquared", "innopolistech", "btclab", "parasite"] QuarterIndex = int # Transaction locktime RawLockTime = int @@ -294,7 +112,7 @@ StoredU32 = int # Fixed-size 64-bit unsigned integer optimized for on-disk storage StoredU64 = int # Time period for mining statistics. -# +# # Used to specify the lookback window for pool statistics, hashrate calculations, # and other time-based mining metrics. TimePeriod = Literal["24h", "3d", "1w", "1m", "3m", "6m", "1y", "2y", "3y"] @@ -311,43 +129,13 @@ WeekIndex = int YearIndex = int # Aggregation dimension for querying metrics. Includes time-based (date, week, month, year), # block-based (height, txindex), and address/output type indexes. -Index = Literal[ - "dateindex", - "decadeindex", - "difficultyepoch", - "emptyoutputindex", - "halvingepoch", - "height", - "txinindex", - "monthindex", - "opreturnindex", - "txoutindex", - "p2aaddressindex", - "p2msoutputindex", - "p2pk33addressindex", - "p2pk65addressindex", - "p2pkhaddressindex", - "p2shaddressindex", - "p2traddressindex", - "p2wpkhaddressindex", - "p2wshaddressindex", - "quarterindex", - "semesterindex", - "txindex", - "unknownoutputindex", - "weekindex", - "yearindex", - "loadedaddressindex", - "emptyaddressindex", -] +Index = Literal["dateindex", "decadeindex", "difficultyepoch", "emptyoutputindex", "halvingepoch", "height", "txinindex", "monthindex", "opreturnindex", "txoutindex", "p2aaddressindex", "p2msoutputindex", "p2pk33addressindex", "p2pk65addressindex", "p2pkhaddressindex", "p2shaddressindex", "p2traddressindex", "p2wpkhaddressindex", "p2wshaddressindex", "quarterindex", "semesterindex", "txindex", "unknownoutputindex", "weekindex", "yearindex", "loadedaddressindex", "emptyaddressindex"] # Hierarchical tree node for organizing metrics into categories TreeNode = Union[dict[str, "TreeNode"], "MetricLeafWithSchema"] - - class AddressChainStats(TypedDict): """ Address statistics on the blockchain (confirmed transactions only) - + Based on mempool.space's format with type_index extension. Attributes: @@ -358,7 +146,6 @@ class AddressChainStats(TypedDict): tx_count: Total number of confirmed transactions involving this address type_index: Index of this address within its type on the blockchain """ - funded_txo_count: int funded_txo_sum: Sats spent_txo_count: int @@ -366,11 +153,10 @@ class AddressChainStats(TypedDict): tx_count: int type_index: TypeIndex - class AddressMempoolStats(TypedDict): """ Address statistics in the mempool (unconfirmed transactions only) - + Based on mempool.space's format. Attributes: @@ -380,18 +166,15 @@ class AddressMempoolStats(TypedDict): spent_txo_sum: Total amount in satoshis being spent in unconfirmed transactions tx_count: Number of unconfirmed transactions involving this address """ - funded_txo_count: int funded_txo_sum: Sats spent_txo_count: int spent_txo_sum: Sats tx_count: int - class AddressParam(TypedDict): address: Address - class AddressStats(TypedDict): """ Address information compatible with mempool.space API format @@ -401,23 +184,19 @@ class AddressStats(TypedDict): chain_stats: Statistics for confirmed transactions on the blockchain mempool_stats: Statistics for unconfirmed transactions in the mempool """ - address: Address chain_stats: AddressChainStats mempool_stats: Union[AddressMempoolStats, None] - class AddressTxidsParam(TypedDict): """ Attributes: after_txid: Txid to paginate from (return transactions before this one) limit: Maximum number of results to return. Defaults to 25 if not specified. """ - after_txid: Union[Txid, None] limit: int - class AddressValidation(TypedDict): """ Address validation result @@ -431,7 +210,6 @@ class AddressValidation(TypedDict): witness_version: Witness version (0 for P2WPKH/P2WSH, 1 for P2TR) witness_program: Witness program in hex """ - isvalid: bool address: Optional[str] scriptPubKey: Optional[str] @@ -440,52 +218,42 @@ class AddressValidation(TypedDict): witness_version: Optional[int] witness_program: Optional[str] - class BlockCountParam(TypedDict): """ Attributes: block_count: Number of recent blocks to include """ - block_count: int - class BlockFeesEntry(TypedDict): """ A single block fees data point. """ - avgHeight: Height timestamp: Timestamp avgFees: Sats - class BlockHashParam(TypedDict): hash: BlockHash - class BlockHashStartIndex(TypedDict): """ Attributes: hash: Bitcoin block hash start_index: Starting transaction index within the block (0-based) """ - hash: BlockHash start_index: TxIndex - class BlockHashTxIndex(TypedDict): """ Attributes: hash: Bitcoin block hash index: Transaction index within the block (0-based) """ - hash: BlockHash index: TxIndex - class BlockInfo(TypedDict): """ Block information returned by the API @@ -499,7 +267,6 @@ class BlockInfo(TypedDict): timestamp: Block timestamp (Unix time) difficulty: Block difficulty as a floating point number """ - id: BlockHash height: Height tx_count: int @@ -508,46 +275,37 @@ class BlockInfo(TypedDict): timestamp: Timestamp difficulty: float - class BlockRewardsEntry(TypedDict): """ A single block rewards data point. """ - avgHeight: int timestamp: int avgRewards: int - class BlockSizeEntry(TypedDict): """ A single block size data point. """ - avgHeight: int timestamp: int avgSize: int - class BlockWeightEntry(TypedDict): """ A single block weight data point. """ - avgHeight: int timestamp: int avgWeight: int - class BlockSizesWeights(TypedDict): """ Combined block sizes and weights response. """ - sizes: List[BlockSizeEntry] weights: List[BlockWeightEntry] - class BlockStatus(TypedDict): """ Block status indicating whether block is in the best chain @@ -557,12 +315,10 @@ class BlockStatus(TypedDict): height: Block height (only if in best chain) next_best: Hash of the next block in the best chain (only if in best chain and not tip) """ - in_best_chain: bool height: Union[Height, None] next_best: Union[BlockHash, None] - class BlockTimestamp(TypedDict): """ Block information returned for timestamp queries @@ -572,12 +328,10 @@ class BlockTimestamp(TypedDict): hash: Block hash timestamp: Block timestamp in ISO 8601 format """ - height: Height hash: BlockHash timestamp: str - class DataRangeFormat(TypedDict): """ Data range with output format for API query parameters @@ -588,13 +342,11 @@ class DataRangeFormat(TypedDict): limit: Maximum number of values to return (ignored if `end` is set) format: Format of the output """ - start: Optional[int] end: Optional[int] limit: Union[Limit, None] format: Format - class DifficultyAdjustment(TypedDict): """ Difficulty adjustment information. @@ -611,7 +363,6 @@ class DifficultyAdjustment(TypedDict): adjustedTimeAvg: Time-adjusted average (accounting for timestamp manipulation) timeOffset: Time offset from expected schedule (seconds) """ - progressPercent: float difficultyChange: float estimatedRetargetDate: int @@ -623,19 +374,16 @@ class DifficultyAdjustment(TypedDict): adjustedTimeAvg: int timeOffset: int - class DifficultyAdjustmentEntry(TypedDict): """ A single difficulty adjustment entry. Serializes as array: [timestamp, height, difficulty, change_percent] """ - timestamp: Timestamp height: Height difficulty: float change_percent: float - class DifficultyEntry(TypedDict): """ A single difficulty data point. @@ -645,12 +393,10 @@ class DifficultyEntry(TypedDict): difficulty: Difficulty value. height: Block height of the adjustment. """ - timestamp: Timestamp difficulty: float height: Height - class EmptyAddressData(TypedDict): """ Data of an empty address @@ -660,12 +406,10 @@ class EmptyAddressData(TypedDict): funded_txo_count: Total funded/spent transaction output count (equal since address is empty) transfered: Total satoshis transferred """ - tx_count: int funded_txo_count: int transfered: Sats - class HashrateEntry(TypedDict): """ A single hashrate data point. @@ -674,11 +418,9 @@ class HashrateEntry(TypedDict): timestamp: Unix timestamp. avgHashrate: Average hashrate (H/s). """ - timestamp: Timestamp avgHashrate: int - class HashrateSummary(TypedDict): """ Summary of network hashrate and difficulty data. @@ -689,27 +431,22 @@ class HashrateSummary(TypedDict): currentHashrate: Current network hashrate (H/s). currentDifficulty: Current network difficulty. """ - hashrates: List[HashrateEntry] difficulty: List[DifficultyEntry] currentHashrate: int currentDifficulty: float - class Health(TypedDict): """ Server health status """ - status: str service: str timestamp: str - class HeightParam(TypedDict): height: Height - class IndexInfo(TypedDict): """ Information about an available index and its query aliases @@ -718,15 +455,12 @@ class IndexInfo(TypedDict): index: The canonical index name aliases: All Accepted query aliases """ - index: Index aliases: List[str] - class LimitParam(TypedDict): limit: Limit - class LoadedAddressData(TypedDict): """ Data for a loaded (non-empty) address with current balance @@ -739,7 +473,6 @@ class LoadedAddressData(TypedDict): sent: Satoshis sent by this address realized_cap: The realized capitalization of this address """ - tx_count: int funded_txo_count: int spent_txo_count: int @@ -747,7 +480,6 @@ class LoadedAddressData(TypedDict): sent: Sats realized_cap: Dollars - class MempoolBlock(TypedDict): """ Block info in a mempool.space like format for fee estimation. @@ -760,7 +492,6 @@ class MempoolBlock(TypedDict): medianFee: Median fee rate in sat/vB feeRange: Fee rate range: [min, 10%, 25%, 50%, 75%, 90%, max] """ - blockSize: int blockVSize: float nTx: int @@ -768,7 +499,6 @@ class MempoolBlock(TypedDict): medianFee: FeeRate feeRange: List[FeeRate] - class MempoolInfo(TypedDict): """ Mempool statistics @@ -778,12 +508,10 @@ class MempoolInfo(TypedDict): vsize: Total virtual size of all transactions in the mempool (vbytes) total_fee: Total fees of all transactions in the mempool (satoshis) """ - count: int vsize: VSize total_fee: Sats - class MetricCount(TypedDict): """ Metric count statistics - distinct metrics and total metric-index combinations @@ -794,17 +522,14 @@ class MetricCount(TypedDict): lazy_endpoints: Number of lazy (computed on-the-fly) metric-index combinations stored_endpoints: Number of eager (stored on disk) metric-index combinations """ - distinct_metrics: int total_endpoints: int lazy_endpoints: int stored_endpoints: int - class MetricParam(TypedDict): metric: Metric - class MetricSelection(TypedDict): """ Selection of metrics to query @@ -817,7 +542,6 @@ class MetricSelection(TypedDict): limit: Maximum number of values to return (ignored if `end` is set) format: Format of the output """ - metrics: Metrics index: Index start: Optional[int] @@ -825,7 +549,6 @@ class MetricSelection(TypedDict): limit: Union[Limit, None] format: Format - class MetricSelectionLegacy(TypedDict): """ Legacy metric selection parameters (deprecated) @@ -836,7 +559,6 @@ class MetricSelectionLegacy(TypedDict): limit: Maximum number of values to return (ignored if `end` is set) format: Format of the output """ - index: Index ids: Metrics start: Optional[int] @@ -844,51 +566,42 @@ class MetricSelectionLegacy(TypedDict): limit: Union[Limit, None] format: Format - class MetricWithIndex(TypedDict): """ Attributes: metric: Metric name index: Aggregation index """ - metric: Metric index: Index - class OHLCCents(TypedDict): """ OHLC (Open, High, Low, Close) data in cents """ - open: Open high: High low: Low close: Close - class OHLCDollars(TypedDict): """ OHLC (Open, High, Low, Close) data in dollars """ - open: Open high: High low: Low close: Close - class OHLCSats(TypedDict): """ OHLC (Open, High, Low, Close) data in satoshis """ - open: Open high: High low: Low close: Close - class PaginatedMetrics(TypedDict): """ A paginated list of available metric names (1000 per page) @@ -898,12 +611,10 @@ class PaginatedMetrics(TypedDict): max_page: Maximum valid page index (0-indexed) metrics: List of metric names (max 1000 per page) """ - current_page: int max_page: int metrics: List[str] - class Pagination(TypedDict): """ Pagination parameters for paginated API endpoints @@ -911,10 +622,8 @@ class Pagination(TypedDict): Attributes: page: Pagination index """ - page: Optional[int] - class PoolBlockCounts(TypedDict): """ Block counts for different time periods @@ -924,12 +633,10 @@ class PoolBlockCounts(TypedDict): _24h: Blocks mined in last 24 hours _1w: Blocks mined in last week """ - all: int _24h: int _1w: int - class PoolBlockShares(TypedDict): """ Pool's share of total blocks for different time periods @@ -939,12 +646,10 @@ class PoolBlockShares(TypedDict): _24h: Share of blocks in last 24 hours _1w: Share of blocks in last week """ - all: float _24h: float _1w: float - class PoolDetailInfo(TypedDict): """ Pool information for detail view @@ -957,7 +662,6 @@ class PoolDetailInfo(TypedDict): regexes: Coinbase tag patterns (regexes) slug: URL-friendly pool identifier """ - id: int name: str link: str @@ -965,7 +669,6 @@ class PoolDetailInfo(TypedDict): regexes: List[str] slug: PoolSlug - class PoolDetail(TypedDict): """ Detailed pool information with statistics across time periods @@ -977,14 +680,12 @@ class PoolDetail(TypedDict): estimatedHashrate: Estimated hashrate based on blocks mined reportedHashrate: Self-reported hashrate (if available) """ - pool: PoolDetailInfo blockCount: PoolBlockCounts blockShare: PoolBlockShares estimatedHashrate: int reportedHashrate: Optional[int] - class PoolInfo(TypedDict): """ Basic pool information for listing all pools @@ -994,16 +695,13 @@ class PoolInfo(TypedDict): slug: URL-friendly pool identifier unique_id: Unique numeric pool identifier """ - name: str slug: PoolSlug unique_id: int - class PoolSlugParam(TypedDict): slug: PoolSlug - class PoolStats(TypedDict): """ Mining pool with block statistics for a time period @@ -1018,7 +716,6 @@ class PoolStats(TypedDict): slug: URL-friendly pool identifier share: Pool's share of total blocks (0.0 - 1.0) """ - poolId: int name: str link: str @@ -1028,7 +725,6 @@ class PoolStats(TypedDict): slug: PoolSlug share: float - class PoolsSummary(TypedDict): """ Mining pools response for a time period @@ -1038,12 +734,10 @@ class PoolsSummary(TypedDict): blockCount: Total blocks in the time period lastEstimatedHashrate: Estimated network hashrate (hashes per second) """ - pools: List[PoolStats] blockCount: int lastEstimatedHashrate: int - class RecommendedFees(TypedDict): """ Recommended fee rates in sat/vB @@ -1055,14 +749,12 @@ class RecommendedFees(TypedDict): economyFee: Fee rate for economical confirmation minimumFee: Minimum relay fee rate """ - fastestFee: FeeRate halfHourFee: FeeRate hourFee: FeeRate economyFee: FeeRate minimumFee: FeeRate - class RewardStats(TypedDict): """ Block reward statistics over a range of blocks @@ -1071,14 +763,12 @@ class RewardStats(TypedDict): startBlock: First block in the range endBlock: Last block in the range """ - startBlock: Height endBlock: Height totalReward: Sats totalFee: Sats totalTx: int - class SupplyState(TypedDict): """ Current supply state tracking UTXO count and total value @@ -1087,19 +777,15 @@ class SupplyState(TypedDict): utxo_count: Number of unspent transaction outputs value: Total value in satoshis """ - utxo_count: int value: Sats - class TimePeriodParam(TypedDict): time_period: TimePeriod - class TimestampParam(TypedDict): timestamp: Timestamp - class TxOut(TypedDict): """ Transaction output @@ -1108,11 +794,9 @@ class TxOut(TypedDict): scriptpubkey: Script pubkey (locking script) value: Value of the output in satoshis """ - scriptpubkey: str value: Sats - class TxIn(TypedDict): """ Transaction input @@ -1126,7 +810,6 @@ class TxIn(TypedDict): sequence: Input sequence number inner_redeemscript_asm: Inner redeemscript in assembly format (for P2SH-wrapped SegWit) """ - txid: Txid vout: Vout prevout: Union[TxOut, None] @@ -1136,7 +819,6 @@ class TxIn(TypedDict): sequence: int inner_redeemscript_asm: Optional[str] - class TxStatus(TypedDict): """ Transaction confirmation status @@ -1147,13 +829,11 @@ class TxStatus(TypedDict): block_hash: Block hash (only present if confirmed) block_time: Block timestamp (only present if confirmed) """ - confirmed: bool block_height: Union[Height, None] block_hash: Union[BlockHash, None] block_time: Union[Timestamp, None] - class Transaction(TypedDict): """ Transaction information compatible with mempool.space API format @@ -1166,7 +846,6 @@ class Transaction(TypedDict): vin: Transaction inputs vout: Transaction outputs """ - index: Union[TxIndex, None] txid: Txid version: TxVersion @@ -1179,7 +858,6 @@ class Transaction(TypedDict): vout: List[TxOut] status: TxStatus - class TxOutspend(TypedDict): """ Status of an output indicating whether it has been spent @@ -1190,17 +868,14 @@ class TxOutspend(TypedDict): vin: Input index in the spending transaction (only present if spent) status: Status of the spending transaction (only present if spent) """ - spent: bool txid: Union[Txid, None] vin: Union[Vin, None] status: Union[TxStatus, None] - class TxidParam(TypedDict): txid: Txid - class TxidVout(TypedDict): """ Transaction output reference (txid + output index) @@ -1209,31 +884,25 @@ class TxidVout(TypedDict): txid: Transaction ID vout: Output index """ - txid: Txid vout: Vout - class Utxo(TypedDict): """ Unspent transaction output """ - txid: Txid vout: Vout status: TxStatus value: Sats - class ValidateAddressParam(TypedDict): """ Attributes: address: Bitcoin address to validate (can be any string) """ - address: str - class MetricLeafWithSchema(TypedDict): """ MetricLeaf with JSON Schema for client generation @@ -1244,7 +913,6 @@ class MetricLeafWithSchema(TypedDict): indexes: Available indexes for this metric type: JSON Schema type (e.g., "integer", "number", "string", "boolean", "array", "object") """ - name: str kind: str indexes: List[Index] @@ -1265,7 +933,7 @@ class BrkClientBase: def __init__(self, base_url: str, timeout: float = 30.0): parsed = urlparse(base_url) self._host = parsed.netloc - self._secure = parsed.scheme == "https" + self._secure = parsed.scheme == 'https' self._timeout = timeout self._conn: Optional[Union[HTTPSConnection, HTTPConnection]] = None @@ -1320,7 +988,6 @@ def _m(acc: str, s: str) -> str: class MetricData(TypedDict, Generic[T]): """Metric data with range information.""" - total: int start: int end: int @@ -1343,9 +1010,7 @@ class MetricEndpoint(Generic[T]): """Fetch all data points for this metric/index.""" return self._client.get_json(self.path()) - def range( - self, start: Optional[int] = None, end: Optional[int] = None - ) -> MetricData[T]: + def range(self, start: Optional[int] = None, end: Optional[int] = None) -> MetricData[T]: """Fetch data points within a range.""" params = [] if start is not None: @@ -1384,45 +1049,43 @@ class MetricPattern(Protocol[T]): # Index accessor classes - class _MetricPattern1By(Generic[T]): """Index endpoint methods container.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name def dateindex(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, "dateindex") + return MetricEndpoint(self._client, self._name, 'dateindex') def decadeindex(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, "decadeindex") + return MetricEndpoint(self._client, self._name, 'decadeindex') def difficultyepoch(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, "difficultyepoch") + return MetricEndpoint(self._client, self._name, 'difficultyepoch') def height(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, "height") + return MetricEndpoint(self._client, self._name, 'height') def monthindex(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, "monthindex") + return MetricEndpoint(self._client, self._name, 'monthindex') def quarterindex(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, "quarterindex") + return MetricEndpoint(self._client, self._name, 'quarterindex') def semesterindex(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, "semesterindex") + return MetricEndpoint(self._client, self._name, 'semesterindex') def weekindex(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, "weekindex") + return MetricEndpoint(self._client, self._name, 'weekindex') def yearindex(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, "yearindex") - + return MetricEndpoint(self._client, self._name, 'yearindex') class MetricPattern1(Generic[T]): """Index accessor for metrics with 9 indexes.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name @@ -1435,76 +1098,55 @@ class MetricPattern1(Generic[T]): def indexes(self) -> List[str]: """Get the list of available indexes.""" - return [ - "dateindex", - "decadeindex", - "difficultyepoch", - "height", - "monthindex", - "quarterindex", - "semesterindex", - "weekindex", - "yearindex", - ] + return ['dateindex', 'decadeindex', 'difficultyepoch', 'height', 'monthindex', 'quarterindex', 'semesterindex', 'weekindex', 'yearindex'] def get(self, index: str) -> Optional[MetricEndpoint[T]]: """Get an endpoint for a specific index, if supported.""" - if index == "dateindex": - return self.by.dateindex() - elif index == "decadeindex": - return self.by.decadeindex() - elif index == "difficultyepoch": - return self.by.difficultyepoch() - elif index == "height": - return self.by.height() - elif index == "monthindex": - return self.by.monthindex() - elif index == "quarterindex": - return self.by.quarterindex() - elif index == "semesterindex": - return self.by.semesterindex() - elif index == "weekindex": - return self.by.weekindex() - elif index == "yearindex": - return self.by.yearindex() + if index == 'dateindex': return self.by.dateindex() + elif index == 'decadeindex': return self.by.decadeindex() + elif index == 'difficultyepoch': return self.by.difficultyepoch() + elif index == 'height': return self.by.height() + elif index == 'monthindex': return self.by.monthindex() + elif index == 'quarterindex': return self.by.quarterindex() + elif index == 'semesterindex': return self.by.semesterindex() + elif index == 'weekindex': return self.by.weekindex() + elif index == 'yearindex': return self.by.yearindex() return None - class _MetricPattern2By(Generic[T]): """Index endpoint methods container.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name def dateindex(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, "dateindex") + return MetricEndpoint(self._client, self._name, 'dateindex') def decadeindex(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, "decadeindex") + return MetricEndpoint(self._client, self._name, 'decadeindex') def difficultyepoch(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, "difficultyepoch") + return MetricEndpoint(self._client, self._name, 'difficultyepoch') def monthindex(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, "monthindex") + return MetricEndpoint(self._client, self._name, 'monthindex') def quarterindex(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, "quarterindex") + return MetricEndpoint(self._client, self._name, 'quarterindex') def semesterindex(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, "semesterindex") + return MetricEndpoint(self._client, self._name, 'semesterindex') def weekindex(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, "weekindex") + return MetricEndpoint(self._client, self._name, 'weekindex') def yearindex(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, "yearindex") - + return MetricEndpoint(self._client, self._name, 'yearindex') class MetricPattern2(Generic[T]): """Index accessor for metrics with 8 indexes.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name @@ -1517,73 +1159,54 @@ class MetricPattern2(Generic[T]): def indexes(self) -> List[str]: """Get the list of available indexes.""" - return [ - "dateindex", - "decadeindex", - "difficultyepoch", - "monthindex", - "quarterindex", - "semesterindex", - "weekindex", - "yearindex", - ] + return ['dateindex', 'decadeindex', 'difficultyepoch', 'monthindex', 'quarterindex', 'semesterindex', 'weekindex', 'yearindex'] def get(self, index: str) -> Optional[MetricEndpoint[T]]: """Get an endpoint for a specific index, if supported.""" - if index == "dateindex": - return self.by.dateindex() - elif index == "decadeindex": - return self.by.decadeindex() - elif index == "difficultyepoch": - return self.by.difficultyepoch() - elif index == "monthindex": - return self.by.monthindex() - elif index == "quarterindex": - return self.by.quarterindex() - elif index == "semesterindex": - return self.by.semesterindex() - elif index == "weekindex": - return self.by.weekindex() - elif index == "yearindex": - return self.by.yearindex() + if index == 'dateindex': return self.by.dateindex() + elif index == 'decadeindex': return self.by.decadeindex() + elif index == 'difficultyepoch': return self.by.difficultyepoch() + elif index == 'monthindex': return self.by.monthindex() + elif index == 'quarterindex': return self.by.quarterindex() + elif index == 'semesterindex': return self.by.semesterindex() + elif index == 'weekindex': return self.by.weekindex() + elif index == 'yearindex': return self.by.yearindex() return None - class _MetricPattern3By(Generic[T]): """Index endpoint methods container.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name def dateindex(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, "dateindex") + return MetricEndpoint(self._client, self._name, 'dateindex') def decadeindex(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, "decadeindex") + return MetricEndpoint(self._client, self._name, 'decadeindex') def height(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, "height") + return MetricEndpoint(self._client, self._name, 'height') def monthindex(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, "monthindex") + return MetricEndpoint(self._client, self._name, 'monthindex') def quarterindex(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, "quarterindex") + return MetricEndpoint(self._client, self._name, 'quarterindex') def semesterindex(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, "semesterindex") + return MetricEndpoint(self._client, self._name, 'semesterindex') def weekindex(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, "weekindex") + return MetricEndpoint(self._client, self._name, 'weekindex') def yearindex(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, "yearindex") - + return MetricEndpoint(self._client, self._name, 'yearindex') class MetricPattern3(Generic[T]): """Index accessor for metrics with 8 indexes.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name @@ -1596,70 +1219,51 @@ class MetricPattern3(Generic[T]): def indexes(self) -> List[str]: """Get the list of available indexes.""" - return [ - "dateindex", - "decadeindex", - "height", - "monthindex", - "quarterindex", - "semesterindex", - "weekindex", - "yearindex", - ] + return ['dateindex', 'decadeindex', 'height', 'monthindex', 'quarterindex', 'semesterindex', 'weekindex', 'yearindex'] def get(self, index: str) -> Optional[MetricEndpoint[T]]: """Get an endpoint for a specific index, if supported.""" - if index == "dateindex": - return self.by.dateindex() - elif index == "decadeindex": - return self.by.decadeindex() - elif index == "height": - return self.by.height() - elif index == "monthindex": - return self.by.monthindex() - elif index == "quarterindex": - return self.by.quarterindex() - elif index == "semesterindex": - return self.by.semesterindex() - elif index == "weekindex": - return self.by.weekindex() - elif index == "yearindex": - return self.by.yearindex() + if index == 'dateindex': return self.by.dateindex() + elif index == 'decadeindex': return self.by.decadeindex() + elif index == 'height': return self.by.height() + elif index == 'monthindex': return self.by.monthindex() + elif index == 'quarterindex': return self.by.quarterindex() + elif index == 'semesterindex': return self.by.semesterindex() + elif index == 'weekindex': return self.by.weekindex() + elif index == 'yearindex': return self.by.yearindex() return None - class _MetricPattern4By(Generic[T]): """Index endpoint methods container.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name def dateindex(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, "dateindex") + return MetricEndpoint(self._client, self._name, 'dateindex') def decadeindex(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, "decadeindex") + return MetricEndpoint(self._client, self._name, 'decadeindex') def monthindex(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, "monthindex") + return MetricEndpoint(self._client, self._name, 'monthindex') def quarterindex(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, "quarterindex") + return MetricEndpoint(self._client, self._name, 'quarterindex') def semesterindex(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, "semesterindex") + return MetricEndpoint(self._client, self._name, 'semesterindex') def weekindex(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, "weekindex") + return MetricEndpoint(self._client, self._name, 'weekindex') def yearindex(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, "yearindex") - + return MetricEndpoint(self._client, self._name, 'yearindex') class MetricPattern4(Generic[T]): """Index accessor for metrics with 7 indexes.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name @@ -1672,52 +1276,35 @@ class MetricPattern4(Generic[T]): def indexes(self) -> List[str]: """Get the list of available indexes.""" - return [ - "dateindex", - "decadeindex", - "monthindex", - "quarterindex", - "semesterindex", - "weekindex", - "yearindex", - ] + return ['dateindex', 'decadeindex', 'monthindex', 'quarterindex', 'semesterindex', 'weekindex', 'yearindex'] def get(self, index: str) -> Optional[MetricEndpoint[T]]: """Get an endpoint for a specific index, if supported.""" - if index == "dateindex": - return self.by.dateindex() - elif index == "decadeindex": - return self.by.decadeindex() - elif index == "monthindex": - return self.by.monthindex() - elif index == "quarterindex": - return self.by.quarterindex() - elif index == "semesterindex": - return self.by.semesterindex() - elif index == "weekindex": - return self.by.weekindex() - elif index == "yearindex": - return self.by.yearindex() + if index == 'dateindex': return self.by.dateindex() + elif index == 'decadeindex': return self.by.decadeindex() + elif index == 'monthindex': return self.by.monthindex() + elif index == 'quarterindex': return self.by.quarterindex() + elif index == 'semesterindex': return self.by.semesterindex() + elif index == 'weekindex': return self.by.weekindex() + elif index == 'yearindex': return self.by.yearindex() return None - class _MetricPattern5By(Generic[T]): """Index endpoint methods container.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name def dateindex(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, "dateindex") + return MetricEndpoint(self._client, self._name, 'dateindex') def height(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, "height") - + return MetricEndpoint(self._client, self._name, 'height') class MetricPattern5(Generic[T]): """Index accessor for metrics with 2 indexes.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name @@ -1730,31 +1317,27 @@ class MetricPattern5(Generic[T]): def indexes(self) -> List[str]: """Get the list of available indexes.""" - return ["dateindex", "height"] + return ['dateindex', 'height'] def get(self, index: str) -> Optional[MetricEndpoint[T]]: """Get an endpoint for a specific index, if supported.""" - if index == "dateindex": - return self.by.dateindex() - elif index == "height": - return self.by.height() + if index == 'dateindex': return self.by.dateindex() + elif index == 'height': return self.by.height() return None - class _MetricPattern6By(Generic[T]): """Index endpoint methods container.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name def dateindex(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, "dateindex") - + return MetricEndpoint(self._client, self._name, 'dateindex') class MetricPattern6(Generic[T]): """Index accessor for metrics with 1 indexes.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name @@ -1767,29 +1350,26 @@ class MetricPattern6(Generic[T]): def indexes(self) -> List[str]: """Get the list of available indexes.""" - return ["dateindex"] + return ['dateindex'] def get(self, index: str) -> Optional[MetricEndpoint[T]]: """Get an endpoint for a specific index, if supported.""" - if index == "dateindex": - return self.by.dateindex() + if index == 'dateindex': return self.by.dateindex() return None - class _MetricPattern7By(Generic[T]): """Index endpoint methods container.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name def decadeindex(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, "decadeindex") - + return MetricEndpoint(self._client, self._name, 'decadeindex') class MetricPattern7(Generic[T]): """Index accessor for metrics with 1 indexes.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name @@ -1802,29 +1382,26 @@ class MetricPattern7(Generic[T]): def indexes(self) -> List[str]: """Get the list of available indexes.""" - return ["decadeindex"] + return ['decadeindex'] def get(self, index: str) -> Optional[MetricEndpoint[T]]: """Get an endpoint for a specific index, if supported.""" - if index == "decadeindex": - return self.by.decadeindex() + if index == 'decadeindex': return self.by.decadeindex() return None - class _MetricPattern8By(Generic[T]): """Index endpoint methods container.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name def difficultyepoch(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, "difficultyepoch") - + return MetricEndpoint(self._client, self._name, 'difficultyepoch') class MetricPattern8(Generic[T]): """Index accessor for metrics with 1 indexes.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name @@ -1837,29 +1414,26 @@ class MetricPattern8(Generic[T]): def indexes(self) -> List[str]: """Get the list of available indexes.""" - return ["difficultyepoch"] + return ['difficultyepoch'] def get(self, index: str) -> Optional[MetricEndpoint[T]]: """Get an endpoint for a specific index, if supported.""" - if index == "difficultyepoch": - return self.by.difficultyepoch() + if index == 'difficultyepoch': return self.by.difficultyepoch() return None - class _MetricPattern9By(Generic[T]): """Index endpoint methods container.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name def emptyoutputindex(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, "emptyoutputindex") - + return MetricEndpoint(self._client, self._name, 'emptyoutputindex') class MetricPattern9(Generic[T]): """Index accessor for metrics with 1 indexes.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name @@ -1872,29 +1446,26 @@ class MetricPattern9(Generic[T]): def indexes(self) -> List[str]: """Get the list of available indexes.""" - return ["emptyoutputindex"] + return ['emptyoutputindex'] def get(self, index: str) -> Optional[MetricEndpoint[T]]: """Get an endpoint for a specific index, if supported.""" - if index == "emptyoutputindex": - return self.by.emptyoutputindex() + if index == 'emptyoutputindex': return self.by.emptyoutputindex() return None - class _MetricPattern10By(Generic[T]): """Index endpoint methods container.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name def halvingepoch(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, "halvingepoch") - + return MetricEndpoint(self._client, self._name, 'halvingepoch') class MetricPattern10(Generic[T]): """Index accessor for metrics with 1 indexes.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name @@ -1907,29 +1478,26 @@ class MetricPattern10(Generic[T]): def indexes(self) -> List[str]: """Get the list of available indexes.""" - return ["halvingepoch"] + return ['halvingepoch'] def get(self, index: str) -> Optional[MetricEndpoint[T]]: """Get an endpoint for a specific index, if supported.""" - if index == "halvingepoch": - return self.by.halvingepoch() + if index == 'halvingepoch': return self.by.halvingepoch() return None - class _MetricPattern11By(Generic[T]): """Index endpoint methods container.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name def height(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, "height") - + return MetricEndpoint(self._client, self._name, 'height') class MetricPattern11(Generic[T]): """Index accessor for metrics with 1 indexes.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name @@ -1942,29 +1510,26 @@ class MetricPattern11(Generic[T]): def indexes(self) -> List[str]: """Get the list of available indexes.""" - return ["height"] + return ['height'] def get(self, index: str) -> Optional[MetricEndpoint[T]]: """Get an endpoint for a specific index, if supported.""" - if index == "height": - return self.by.height() + if index == 'height': return self.by.height() return None - class _MetricPattern12By(Generic[T]): """Index endpoint methods container.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name def txinindex(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, "txinindex") - + return MetricEndpoint(self._client, self._name, 'txinindex') class MetricPattern12(Generic[T]): """Index accessor for metrics with 1 indexes.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name @@ -1977,29 +1542,26 @@ class MetricPattern12(Generic[T]): def indexes(self) -> List[str]: """Get the list of available indexes.""" - return ["txinindex"] + return ['txinindex'] def get(self, index: str) -> Optional[MetricEndpoint[T]]: """Get an endpoint for a specific index, if supported.""" - if index == "txinindex": - return self.by.txinindex() + if index == 'txinindex': return self.by.txinindex() return None - class _MetricPattern13By(Generic[T]): """Index endpoint methods container.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name def monthindex(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, "monthindex") - + return MetricEndpoint(self._client, self._name, 'monthindex') class MetricPattern13(Generic[T]): """Index accessor for metrics with 1 indexes.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name @@ -2012,29 +1574,26 @@ class MetricPattern13(Generic[T]): def indexes(self) -> List[str]: """Get the list of available indexes.""" - return ["monthindex"] + return ['monthindex'] def get(self, index: str) -> Optional[MetricEndpoint[T]]: """Get an endpoint for a specific index, if supported.""" - if index == "monthindex": - return self.by.monthindex() + if index == 'monthindex': return self.by.monthindex() return None - class _MetricPattern14By(Generic[T]): """Index endpoint methods container.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name def opreturnindex(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, "opreturnindex") - + return MetricEndpoint(self._client, self._name, 'opreturnindex') class MetricPattern14(Generic[T]): """Index accessor for metrics with 1 indexes.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name @@ -2047,29 +1606,26 @@ class MetricPattern14(Generic[T]): def indexes(self) -> List[str]: """Get the list of available indexes.""" - return ["opreturnindex"] + return ['opreturnindex'] def get(self, index: str) -> Optional[MetricEndpoint[T]]: """Get an endpoint for a specific index, if supported.""" - if index == "opreturnindex": - return self.by.opreturnindex() + if index == 'opreturnindex': return self.by.opreturnindex() return None - class _MetricPattern15By(Generic[T]): """Index endpoint methods container.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name def txoutindex(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, "txoutindex") - + return MetricEndpoint(self._client, self._name, 'txoutindex') class MetricPattern15(Generic[T]): """Index accessor for metrics with 1 indexes.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name @@ -2082,29 +1638,26 @@ class MetricPattern15(Generic[T]): def indexes(self) -> List[str]: """Get the list of available indexes.""" - return ["txoutindex"] + return ['txoutindex'] def get(self, index: str) -> Optional[MetricEndpoint[T]]: """Get an endpoint for a specific index, if supported.""" - if index == "txoutindex": - return self.by.txoutindex() + if index == 'txoutindex': return self.by.txoutindex() return None - class _MetricPattern16By(Generic[T]): """Index endpoint methods container.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name def p2aaddressindex(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, "p2aaddressindex") - + return MetricEndpoint(self._client, self._name, 'p2aaddressindex') class MetricPattern16(Generic[T]): """Index accessor for metrics with 1 indexes.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name @@ -2117,29 +1670,26 @@ class MetricPattern16(Generic[T]): def indexes(self) -> List[str]: """Get the list of available indexes.""" - return ["p2aaddressindex"] + return ['p2aaddressindex'] def get(self, index: str) -> Optional[MetricEndpoint[T]]: """Get an endpoint for a specific index, if supported.""" - if index == "p2aaddressindex": - return self.by.p2aaddressindex() + if index == 'p2aaddressindex': return self.by.p2aaddressindex() return None - class _MetricPattern17By(Generic[T]): """Index endpoint methods container.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name def p2msoutputindex(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, "p2msoutputindex") - + return MetricEndpoint(self._client, self._name, 'p2msoutputindex') class MetricPattern17(Generic[T]): """Index accessor for metrics with 1 indexes.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name @@ -2152,29 +1702,26 @@ class MetricPattern17(Generic[T]): def indexes(self) -> List[str]: """Get the list of available indexes.""" - return ["p2msoutputindex"] + return ['p2msoutputindex'] def get(self, index: str) -> Optional[MetricEndpoint[T]]: """Get an endpoint for a specific index, if supported.""" - if index == "p2msoutputindex": - return self.by.p2msoutputindex() + if index == 'p2msoutputindex': return self.by.p2msoutputindex() return None - class _MetricPattern18By(Generic[T]): """Index endpoint methods container.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name def p2pk33addressindex(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, "p2pk33addressindex") - + return MetricEndpoint(self._client, self._name, 'p2pk33addressindex') class MetricPattern18(Generic[T]): """Index accessor for metrics with 1 indexes.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name @@ -2187,29 +1734,26 @@ class MetricPattern18(Generic[T]): def indexes(self) -> List[str]: """Get the list of available indexes.""" - return ["p2pk33addressindex"] + return ['p2pk33addressindex'] def get(self, index: str) -> Optional[MetricEndpoint[T]]: """Get an endpoint for a specific index, if supported.""" - if index == "p2pk33addressindex": - return self.by.p2pk33addressindex() + if index == 'p2pk33addressindex': return self.by.p2pk33addressindex() return None - class _MetricPattern19By(Generic[T]): """Index endpoint methods container.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name def p2pk65addressindex(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, "p2pk65addressindex") - + return MetricEndpoint(self._client, self._name, 'p2pk65addressindex') class MetricPattern19(Generic[T]): """Index accessor for metrics with 1 indexes.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name @@ -2222,29 +1766,26 @@ class MetricPattern19(Generic[T]): def indexes(self) -> List[str]: """Get the list of available indexes.""" - return ["p2pk65addressindex"] + return ['p2pk65addressindex'] def get(self, index: str) -> Optional[MetricEndpoint[T]]: """Get an endpoint for a specific index, if supported.""" - if index == "p2pk65addressindex": - return self.by.p2pk65addressindex() + if index == 'p2pk65addressindex': return self.by.p2pk65addressindex() return None - class _MetricPattern20By(Generic[T]): """Index endpoint methods container.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name def p2pkhaddressindex(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, "p2pkhaddressindex") - + return MetricEndpoint(self._client, self._name, 'p2pkhaddressindex') class MetricPattern20(Generic[T]): """Index accessor for metrics with 1 indexes.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name @@ -2257,29 +1798,26 @@ class MetricPattern20(Generic[T]): def indexes(self) -> List[str]: """Get the list of available indexes.""" - return ["p2pkhaddressindex"] + return ['p2pkhaddressindex'] def get(self, index: str) -> Optional[MetricEndpoint[T]]: """Get an endpoint for a specific index, if supported.""" - if index == "p2pkhaddressindex": - return self.by.p2pkhaddressindex() + if index == 'p2pkhaddressindex': return self.by.p2pkhaddressindex() return None - class _MetricPattern21By(Generic[T]): """Index endpoint methods container.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name def p2shaddressindex(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, "p2shaddressindex") - + return MetricEndpoint(self._client, self._name, 'p2shaddressindex') class MetricPattern21(Generic[T]): """Index accessor for metrics with 1 indexes.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name @@ -2292,29 +1830,26 @@ class MetricPattern21(Generic[T]): def indexes(self) -> List[str]: """Get the list of available indexes.""" - return ["p2shaddressindex"] + return ['p2shaddressindex'] def get(self, index: str) -> Optional[MetricEndpoint[T]]: """Get an endpoint for a specific index, if supported.""" - if index == "p2shaddressindex": - return self.by.p2shaddressindex() + if index == 'p2shaddressindex': return self.by.p2shaddressindex() return None - class _MetricPattern22By(Generic[T]): """Index endpoint methods container.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name def p2traddressindex(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, "p2traddressindex") - + return MetricEndpoint(self._client, self._name, 'p2traddressindex') class MetricPattern22(Generic[T]): """Index accessor for metrics with 1 indexes.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name @@ -2327,29 +1862,26 @@ class MetricPattern22(Generic[T]): def indexes(self) -> List[str]: """Get the list of available indexes.""" - return ["p2traddressindex"] + return ['p2traddressindex'] def get(self, index: str) -> Optional[MetricEndpoint[T]]: """Get an endpoint for a specific index, if supported.""" - if index == "p2traddressindex": - return self.by.p2traddressindex() + if index == 'p2traddressindex': return self.by.p2traddressindex() return None - class _MetricPattern23By(Generic[T]): """Index endpoint methods container.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name def p2wpkhaddressindex(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, "p2wpkhaddressindex") - + return MetricEndpoint(self._client, self._name, 'p2wpkhaddressindex') class MetricPattern23(Generic[T]): """Index accessor for metrics with 1 indexes.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name @@ -2362,29 +1894,26 @@ class MetricPattern23(Generic[T]): def indexes(self) -> List[str]: """Get the list of available indexes.""" - return ["p2wpkhaddressindex"] + return ['p2wpkhaddressindex'] def get(self, index: str) -> Optional[MetricEndpoint[T]]: """Get an endpoint for a specific index, if supported.""" - if index == "p2wpkhaddressindex": - return self.by.p2wpkhaddressindex() + if index == 'p2wpkhaddressindex': return self.by.p2wpkhaddressindex() return None - class _MetricPattern24By(Generic[T]): """Index endpoint methods container.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name def p2wshaddressindex(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, "p2wshaddressindex") - + return MetricEndpoint(self._client, self._name, 'p2wshaddressindex') class MetricPattern24(Generic[T]): """Index accessor for metrics with 1 indexes.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name @@ -2397,29 +1926,26 @@ class MetricPattern24(Generic[T]): def indexes(self) -> List[str]: """Get the list of available indexes.""" - return ["p2wshaddressindex"] + return ['p2wshaddressindex'] def get(self, index: str) -> Optional[MetricEndpoint[T]]: """Get an endpoint for a specific index, if supported.""" - if index == "p2wshaddressindex": - return self.by.p2wshaddressindex() + if index == 'p2wshaddressindex': return self.by.p2wshaddressindex() return None - class _MetricPattern25By(Generic[T]): """Index endpoint methods container.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name def quarterindex(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, "quarterindex") - + return MetricEndpoint(self._client, self._name, 'quarterindex') class MetricPattern25(Generic[T]): """Index accessor for metrics with 1 indexes.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name @@ -2432,29 +1958,26 @@ class MetricPattern25(Generic[T]): def indexes(self) -> List[str]: """Get the list of available indexes.""" - return ["quarterindex"] + return ['quarterindex'] def get(self, index: str) -> Optional[MetricEndpoint[T]]: """Get an endpoint for a specific index, if supported.""" - if index == "quarterindex": - return self.by.quarterindex() + if index == 'quarterindex': return self.by.quarterindex() return None - class _MetricPattern26By(Generic[T]): """Index endpoint methods container.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name def semesterindex(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, "semesterindex") - + return MetricEndpoint(self._client, self._name, 'semesterindex') class MetricPattern26(Generic[T]): """Index accessor for metrics with 1 indexes.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name @@ -2467,29 +1990,26 @@ class MetricPattern26(Generic[T]): def indexes(self) -> List[str]: """Get the list of available indexes.""" - return ["semesterindex"] + return ['semesterindex'] def get(self, index: str) -> Optional[MetricEndpoint[T]]: """Get an endpoint for a specific index, if supported.""" - if index == "semesterindex": - return self.by.semesterindex() + if index == 'semesterindex': return self.by.semesterindex() return None - class _MetricPattern27By(Generic[T]): """Index endpoint methods container.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name def txindex(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, "txindex") - + return MetricEndpoint(self._client, self._name, 'txindex') class MetricPattern27(Generic[T]): """Index accessor for metrics with 1 indexes.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name @@ -2502,29 +2022,26 @@ class MetricPattern27(Generic[T]): def indexes(self) -> List[str]: """Get the list of available indexes.""" - return ["txindex"] + return ['txindex'] def get(self, index: str) -> Optional[MetricEndpoint[T]]: """Get an endpoint for a specific index, if supported.""" - if index == "txindex": - return self.by.txindex() + if index == 'txindex': return self.by.txindex() return None - class _MetricPattern28By(Generic[T]): """Index endpoint methods container.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name def unknownoutputindex(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, "unknownoutputindex") - + return MetricEndpoint(self._client, self._name, 'unknownoutputindex') class MetricPattern28(Generic[T]): """Index accessor for metrics with 1 indexes.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name @@ -2537,29 +2054,26 @@ class MetricPattern28(Generic[T]): def indexes(self) -> List[str]: """Get the list of available indexes.""" - return ["unknownoutputindex"] + return ['unknownoutputindex'] def get(self, index: str) -> Optional[MetricEndpoint[T]]: """Get an endpoint for a specific index, if supported.""" - if index == "unknownoutputindex": - return self.by.unknownoutputindex() + if index == 'unknownoutputindex': return self.by.unknownoutputindex() return None - class _MetricPattern29By(Generic[T]): """Index endpoint methods container.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name def weekindex(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, "weekindex") - + return MetricEndpoint(self._client, self._name, 'weekindex') class MetricPattern29(Generic[T]): """Index accessor for metrics with 1 indexes.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name @@ -2572,29 +2086,26 @@ class MetricPattern29(Generic[T]): def indexes(self) -> List[str]: """Get the list of available indexes.""" - return ["weekindex"] + return ['weekindex'] def get(self, index: str) -> Optional[MetricEndpoint[T]]: """Get an endpoint for a specific index, if supported.""" - if index == "weekindex": - return self.by.weekindex() + if index == 'weekindex': return self.by.weekindex() return None - class _MetricPattern30By(Generic[T]): """Index endpoint methods container.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name def yearindex(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, "yearindex") - + return MetricEndpoint(self._client, self._name, 'yearindex') class MetricPattern30(Generic[T]): """Index accessor for metrics with 1 indexes.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name @@ -2607,29 +2118,26 @@ class MetricPattern30(Generic[T]): def indexes(self) -> List[str]: """Get the list of available indexes.""" - return ["yearindex"] + return ['yearindex'] def get(self, index: str) -> Optional[MetricEndpoint[T]]: """Get an endpoint for a specific index, if supported.""" - if index == "yearindex": - return self.by.yearindex() + if index == 'yearindex': return self.by.yearindex() return None - class _MetricPattern31By(Generic[T]): """Index endpoint methods container.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name def loadedaddressindex(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, "loadedaddressindex") - + return MetricEndpoint(self._client, self._name, 'loadedaddressindex') class MetricPattern31(Generic[T]): """Index accessor for metrics with 1 indexes.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name @@ -2642,29 +2150,26 @@ class MetricPattern31(Generic[T]): def indexes(self) -> List[str]: """Get the list of available indexes.""" - return ["loadedaddressindex"] + return ['loadedaddressindex'] def get(self, index: str) -> Optional[MetricEndpoint[T]]: """Get an endpoint for a specific index, if supported.""" - if index == "loadedaddressindex": - return self.by.loadedaddressindex() + if index == 'loadedaddressindex': return self.by.loadedaddressindex() return None - class _MetricPattern32By(Generic[T]): """Index endpoint methods container.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name def emptyaddressindex(self) -> MetricEndpoint[T]: - return MetricEndpoint(self._client, self._name, "emptyaddressindex") - + return MetricEndpoint(self._client, self._name, 'emptyaddressindex') class MetricPattern32(Generic[T]): """Index accessor for metrics with 1 indexes.""" - + def __init__(self, client: BrkClientBase, name: str): self._client = client self._name = name @@ -2677,1132 +2182,505 @@ class MetricPattern32(Generic[T]): def indexes(self) -> List[str]: """Get the list of available indexes.""" - return ["emptyaddressindex"] + return ['emptyaddressindex'] def get(self, index: str) -> Optional[MetricEndpoint[T]]: """Get an endpoint for a specific index, if supported.""" - if index == "emptyaddressindex": - return self.by.emptyaddressindex() + if index == 'emptyaddressindex': return self.by.emptyaddressindex() return None - # Reusable structural pattern classes - class RealizedPattern3: """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.adjusted_sopr: MetricPattern6[StoredF64] = MetricPattern6( - client, _m(acc, "adjusted_sopr") - ) - self.adjusted_sopr_30d_ema: MetricPattern6[StoredF64] = MetricPattern6( - client, _m(acc, "adjusted_sopr_30d_ema") - ) - self.adjusted_sopr_7d_ema: MetricPattern6[StoredF64] = MetricPattern6( - client, _m(acc, "adjusted_sopr_7d_ema") - ) - self.adjusted_value_created: MetricPattern1[Dollars] = MetricPattern1( - client, _m(acc, "adjusted_value_created") - ) - self.adjusted_value_destroyed: MetricPattern1[Dollars] = MetricPattern1( - client, _m(acc, "adjusted_value_destroyed") - ) - self.mvrv: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, "mvrv")) - self.neg_realized_loss: BitcoinPattern[Dollars] = BitcoinPattern( - client, _m(acc, "neg_realized_loss") - ) - self.net_realized_pnl: BlockCountPattern[Dollars] = BlockCountPattern( - client, _m(acc, "net_realized_pnl") - ) - self.net_realized_pnl_cumulative_30d_delta: MetricPattern4[Dollars] = ( - MetricPattern4(client, _m(acc, "net_realized_pnl_cumulative_30d_delta")) - ) - self.net_realized_pnl_cumulative_30d_delta_rel_to_market_cap: MetricPattern4[ - StoredF32 - ] = MetricPattern4( - client, _m(acc, "net_realized_pnl_cumulative_30d_delta_rel_to_market_cap") - ) - self.net_realized_pnl_cumulative_30d_delta_rel_to_realized_cap: MetricPattern4[ - StoredF32 - ] = MetricPattern4( - client, _m(acc, "net_realized_pnl_cumulative_30d_delta_rel_to_realized_cap") - ) - self.net_realized_pnl_rel_to_realized_cap: BlockCountPattern[StoredF32] = ( - BlockCountPattern(client, _m(acc, "net_realized_pnl_rel_to_realized_cap")) - ) - self.realized_cap: MetricPattern1[Dollars] = MetricPattern1( - client, _m(acc, "realized_cap") - ) - self.realized_cap_30d_delta: MetricPattern4[Dollars] = MetricPattern4( - client, _m(acc, "realized_cap_30d_delta") - ) - self.realized_cap_rel_to_own_market_cap: MetricPattern1[StoredF32] = ( - MetricPattern1(client, _m(acc, "realized_cap_rel_to_own_market_cap")) - ) - self.realized_loss: BlockCountPattern[Dollars] = BlockCountPattern( - client, _m(acc, "realized_loss") - ) - self.realized_loss_rel_to_realized_cap: BlockCountPattern[StoredF32] = ( - BlockCountPattern(client, _m(acc, "realized_loss_rel_to_realized_cap")) - ) - self.realized_price: MetricPattern1[Dollars] = MetricPattern1( - client, _m(acc, "realized_price") - ) - self.realized_price_extra: ActivePriceRatioPattern = ActivePriceRatioPattern( - client, _m(acc, "realized_price_ratio") - ) - self.realized_profit: BlockCountPattern[Dollars] = BlockCountPattern( - client, _m(acc, "realized_profit") - ) - self.realized_profit_rel_to_realized_cap: BlockCountPattern[StoredF32] = ( - BlockCountPattern(client, _m(acc, "realized_profit_rel_to_realized_cap")) - ) - self.realized_profit_to_loss_ratio: MetricPattern6[StoredF64] = MetricPattern6( - client, _m(acc, "realized_profit_to_loss_ratio") - ) - self.realized_value: MetricPattern1[Dollars] = MetricPattern1( - client, _m(acc, "realized_value") - ) - self.sell_side_risk_ratio: MetricPattern6[StoredF32] = MetricPattern6( - client, _m(acc, "sell_side_risk_ratio") - ) - self.sell_side_risk_ratio_30d_ema: MetricPattern6[StoredF32] = MetricPattern6( - client, _m(acc, "sell_side_risk_ratio_30d_ema") - ) - self.sell_side_risk_ratio_7d_ema: MetricPattern6[StoredF32] = MetricPattern6( - client, _m(acc, "sell_side_risk_ratio_7d_ema") - ) - self.sopr: MetricPattern6[StoredF64] = MetricPattern6(client, _m(acc, "sopr")) - self.sopr_30d_ema: MetricPattern6[StoredF64] = MetricPattern6( - client, _m(acc, "sopr_30d_ema") - ) - self.sopr_7d_ema: MetricPattern6[StoredF64] = MetricPattern6( - client, _m(acc, "sopr_7d_ema") - ) - self.total_realized_pnl: MetricPattern1[Dollars] = MetricPattern1( - client, _m(acc, "total_realized_pnl") - ) - self.value_created: MetricPattern1[Dollars] = MetricPattern1( - client, _m(acc, "value_created") - ) - self.value_destroyed: MetricPattern1[Dollars] = MetricPattern1( - client, _m(acc, "value_destroyed") - ) - + self.adjusted_sopr: MetricPattern6[StoredF64] = MetricPattern6(client, _m(acc, 'adjusted_sopr')) + self.adjusted_sopr_30d_ema: MetricPattern6[StoredF64] = MetricPattern6(client, _m(acc, 'adjusted_sopr_30d_ema')) + self.adjusted_sopr_7d_ema: MetricPattern6[StoredF64] = MetricPattern6(client, _m(acc, 'adjusted_sopr_7d_ema')) + self.adjusted_value_created: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'adjusted_value_created')) + self.adjusted_value_destroyed: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'adjusted_value_destroyed')) + self.mvrv: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'mvrv')) + self.neg_realized_loss: BitcoinPattern[Dollars] = BitcoinPattern(client, _m(acc, 'neg_realized_loss')) + self.net_realized_pnl: BlockCountPattern[Dollars] = BlockCountPattern(client, _m(acc, 'net_realized_pnl')) + self.net_realized_pnl_cumulative_30d_delta: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'net_realized_pnl_cumulative_30d_delta')) + self.net_realized_pnl_cumulative_30d_delta_rel_to_market_cap: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'net_realized_pnl_cumulative_30d_delta_rel_to_market_cap')) + self.net_realized_pnl_cumulative_30d_delta_rel_to_realized_cap: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'net_realized_pnl_cumulative_30d_delta_rel_to_realized_cap')) + self.net_realized_pnl_rel_to_realized_cap: BlockCountPattern[StoredF32] = BlockCountPattern(client, _m(acc, 'net_realized_pnl_rel_to_realized_cap')) + self.realized_cap: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'realized_cap')) + self.realized_cap_30d_delta: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'realized_cap_30d_delta')) + self.realized_cap_rel_to_own_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'realized_cap_rel_to_own_market_cap')) + self.realized_loss: BlockCountPattern[Dollars] = BlockCountPattern(client, _m(acc, 'realized_loss')) + self.realized_loss_rel_to_realized_cap: BlockCountPattern[StoredF32] = BlockCountPattern(client, _m(acc, 'realized_loss_rel_to_realized_cap')) + self.realized_price: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'realized_price')) + self.realized_price_extra: ActivePriceRatioPattern = ActivePriceRatioPattern(client, _m(acc, 'realized_price_ratio')) + self.realized_profit: BlockCountPattern[Dollars] = BlockCountPattern(client, _m(acc, 'realized_profit')) + self.realized_profit_rel_to_realized_cap: BlockCountPattern[StoredF32] = BlockCountPattern(client, _m(acc, 'realized_profit_rel_to_realized_cap')) + self.realized_profit_to_loss_ratio: MetricPattern6[StoredF64] = MetricPattern6(client, _m(acc, 'realized_profit_to_loss_ratio')) + self.realized_value: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'realized_value')) + self.sell_side_risk_ratio: MetricPattern6[StoredF32] = MetricPattern6(client, _m(acc, 'sell_side_risk_ratio')) + self.sell_side_risk_ratio_30d_ema: MetricPattern6[StoredF32] = MetricPattern6(client, _m(acc, 'sell_side_risk_ratio_30d_ema')) + self.sell_side_risk_ratio_7d_ema: MetricPattern6[StoredF32] = MetricPattern6(client, _m(acc, 'sell_side_risk_ratio_7d_ema')) + self.sopr: MetricPattern6[StoredF64] = MetricPattern6(client, _m(acc, 'sopr')) + self.sopr_30d_ema: MetricPattern6[StoredF64] = MetricPattern6(client, _m(acc, 'sopr_30d_ema')) + self.sopr_7d_ema: MetricPattern6[StoredF64] = MetricPattern6(client, _m(acc, 'sopr_7d_ema')) + self.total_realized_pnl: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'total_realized_pnl')) + self.value_created: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'value_created')) + self.value_destroyed: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'value_destroyed')) class RealizedPattern4: """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.adjusted_sopr: MetricPattern6[StoredF64] = MetricPattern6( - client, _m(acc, "adjusted_sopr") - ) - self.adjusted_sopr_30d_ema: MetricPattern6[StoredF64] = MetricPattern6( - client, _m(acc, "adjusted_sopr_30d_ema") - ) - self.adjusted_sopr_7d_ema: MetricPattern6[StoredF64] = MetricPattern6( - client, _m(acc, "adjusted_sopr_7d_ema") - ) - self.adjusted_value_created: MetricPattern1[Dollars] = MetricPattern1( - client, _m(acc, "adjusted_value_created") - ) - self.adjusted_value_destroyed: MetricPattern1[Dollars] = MetricPattern1( - client, _m(acc, "adjusted_value_destroyed") - ) - self.mvrv: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, "mvrv")) - self.neg_realized_loss: BitcoinPattern[Dollars] = BitcoinPattern( - client, _m(acc, "neg_realized_loss") - ) - self.net_realized_pnl: BlockCountPattern[Dollars] = BlockCountPattern( - client, _m(acc, "net_realized_pnl") - ) - self.net_realized_pnl_cumulative_30d_delta: MetricPattern4[Dollars] = ( - MetricPattern4(client, _m(acc, "net_realized_pnl_cumulative_30d_delta")) - ) - self.net_realized_pnl_cumulative_30d_delta_rel_to_market_cap: MetricPattern4[ - StoredF32 - ] = MetricPattern4( - client, _m(acc, "net_realized_pnl_cumulative_30d_delta_rel_to_market_cap") - ) - self.net_realized_pnl_cumulative_30d_delta_rel_to_realized_cap: MetricPattern4[ - StoredF32 - ] = MetricPattern4( - client, _m(acc, "net_realized_pnl_cumulative_30d_delta_rel_to_realized_cap") - ) - self.net_realized_pnl_rel_to_realized_cap: BlockCountPattern[StoredF32] = ( - BlockCountPattern(client, _m(acc, "net_realized_pnl_rel_to_realized_cap")) - ) - self.realized_cap: MetricPattern1[Dollars] = MetricPattern1( - client, _m(acc, "realized_cap") - ) - self.realized_cap_30d_delta: MetricPattern4[Dollars] = MetricPattern4( - client, _m(acc, "realized_cap_30d_delta") - ) - self.realized_loss: BlockCountPattern[Dollars] = BlockCountPattern( - client, _m(acc, "realized_loss") - ) - self.realized_loss_rel_to_realized_cap: BlockCountPattern[StoredF32] = ( - BlockCountPattern(client, _m(acc, "realized_loss_rel_to_realized_cap")) - ) - self.realized_price: MetricPattern1[Dollars] = MetricPattern1( - client, _m(acc, "realized_price") - ) - self.realized_price_extra: RealizedPriceExtraPattern = ( - RealizedPriceExtraPattern(client, _m(acc, "realized_price")) - ) - self.realized_profit: BlockCountPattern[Dollars] = BlockCountPattern( - client, _m(acc, "realized_profit") - ) - self.realized_profit_rel_to_realized_cap: BlockCountPattern[StoredF32] = ( - BlockCountPattern(client, _m(acc, "realized_profit_rel_to_realized_cap")) - ) - self.realized_value: MetricPattern1[Dollars] = MetricPattern1( - client, _m(acc, "realized_value") - ) - self.sell_side_risk_ratio: MetricPattern6[StoredF32] = MetricPattern6( - client, _m(acc, "sell_side_risk_ratio") - ) - self.sell_side_risk_ratio_30d_ema: MetricPattern6[StoredF32] = MetricPattern6( - client, _m(acc, "sell_side_risk_ratio_30d_ema") - ) - self.sell_side_risk_ratio_7d_ema: MetricPattern6[StoredF32] = MetricPattern6( - client, _m(acc, "sell_side_risk_ratio_7d_ema") - ) - self.sopr: MetricPattern6[StoredF64] = MetricPattern6(client, _m(acc, "sopr")) - self.sopr_30d_ema: MetricPattern6[StoredF64] = MetricPattern6( - client, _m(acc, "sopr_30d_ema") - ) - self.sopr_7d_ema: MetricPattern6[StoredF64] = MetricPattern6( - client, _m(acc, "sopr_7d_ema") - ) - self.total_realized_pnl: MetricPattern1[Dollars] = MetricPattern1( - client, _m(acc, "total_realized_pnl") - ) - self.value_created: MetricPattern1[Dollars] = MetricPattern1( - client, _m(acc, "value_created") - ) - self.value_destroyed: MetricPattern1[Dollars] = MetricPattern1( - client, _m(acc, "value_destroyed") - ) - + self.adjusted_sopr: MetricPattern6[StoredF64] = MetricPattern6(client, _m(acc, 'adjusted_sopr')) + self.adjusted_sopr_30d_ema: MetricPattern6[StoredF64] = MetricPattern6(client, _m(acc, 'adjusted_sopr_30d_ema')) + self.adjusted_sopr_7d_ema: MetricPattern6[StoredF64] = MetricPattern6(client, _m(acc, 'adjusted_sopr_7d_ema')) + self.adjusted_value_created: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'adjusted_value_created')) + self.adjusted_value_destroyed: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'adjusted_value_destroyed')) + self.mvrv: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'mvrv')) + self.neg_realized_loss: BitcoinPattern[Dollars] = BitcoinPattern(client, _m(acc, 'neg_realized_loss')) + self.net_realized_pnl: BlockCountPattern[Dollars] = BlockCountPattern(client, _m(acc, 'net_realized_pnl')) + self.net_realized_pnl_cumulative_30d_delta: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'net_realized_pnl_cumulative_30d_delta')) + self.net_realized_pnl_cumulative_30d_delta_rel_to_market_cap: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'net_realized_pnl_cumulative_30d_delta_rel_to_market_cap')) + self.net_realized_pnl_cumulative_30d_delta_rel_to_realized_cap: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'net_realized_pnl_cumulative_30d_delta_rel_to_realized_cap')) + self.net_realized_pnl_rel_to_realized_cap: BlockCountPattern[StoredF32] = BlockCountPattern(client, _m(acc, 'net_realized_pnl_rel_to_realized_cap')) + self.realized_cap: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'realized_cap')) + self.realized_cap_30d_delta: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'realized_cap_30d_delta')) + self.realized_loss: BlockCountPattern[Dollars] = BlockCountPattern(client, _m(acc, 'realized_loss')) + self.realized_loss_rel_to_realized_cap: BlockCountPattern[StoredF32] = BlockCountPattern(client, _m(acc, 'realized_loss_rel_to_realized_cap')) + self.realized_price: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'realized_price')) + self.realized_price_extra: RealizedPriceExtraPattern = RealizedPriceExtraPattern(client, _m(acc, 'realized_price')) + self.realized_profit: BlockCountPattern[Dollars] = BlockCountPattern(client, _m(acc, 'realized_profit')) + self.realized_profit_rel_to_realized_cap: BlockCountPattern[StoredF32] = BlockCountPattern(client, _m(acc, 'realized_profit_rel_to_realized_cap')) + self.realized_value: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'realized_value')) + self.sell_side_risk_ratio: MetricPattern6[StoredF32] = MetricPattern6(client, _m(acc, 'sell_side_risk_ratio')) + self.sell_side_risk_ratio_30d_ema: MetricPattern6[StoredF32] = MetricPattern6(client, _m(acc, 'sell_side_risk_ratio_30d_ema')) + self.sell_side_risk_ratio_7d_ema: MetricPattern6[StoredF32] = MetricPattern6(client, _m(acc, 'sell_side_risk_ratio_7d_ema')) + self.sopr: MetricPattern6[StoredF64] = MetricPattern6(client, _m(acc, 'sopr')) + self.sopr_30d_ema: MetricPattern6[StoredF64] = MetricPattern6(client, _m(acc, 'sopr_30d_ema')) + self.sopr_7d_ema: MetricPattern6[StoredF64] = MetricPattern6(client, _m(acc, 'sopr_7d_ema')) + self.total_realized_pnl: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'total_realized_pnl')) + self.value_created: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'value_created')) + self.value_destroyed: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'value_destroyed')) class Ratio1ySdPattern: """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self._0sd_usd: MetricPattern4[Dollars] = MetricPattern4( - client, _m(acc, "0sd_usd") - ) - self.m0_5sd: MetricPattern4[StoredF32] = MetricPattern4( - client, _m(acc, "m0_5sd") - ) - self.m0_5sd_usd: MetricPattern4[Dollars] = MetricPattern4( - client, _m(acc, "m0_5sd_usd") - ) - self.m1_5sd: MetricPattern4[StoredF32] = MetricPattern4( - client, _m(acc, "m1_5sd") - ) - self.m1_5sd_usd: MetricPattern4[Dollars] = MetricPattern4( - client, _m(acc, "m1_5sd_usd") - ) - self.m1sd: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, "m1sd")) - self.m1sd_usd: MetricPattern4[Dollars] = MetricPattern4( - client, _m(acc, "m1sd_usd") - ) - self.m2_5sd: MetricPattern4[StoredF32] = MetricPattern4( - client, _m(acc, "m2_5sd") - ) - self.m2_5sd_usd: MetricPattern4[Dollars] = MetricPattern4( - client, _m(acc, "m2_5sd_usd") - ) - self.m2sd: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, "m2sd")) - self.m2sd_usd: MetricPattern4[Dollars] = MetricPattern4( - client, _m(acc, "m2sd_usd") - ) - self.m3sd: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, "m3sd")) - self.m3sd_usd: MetricPattern4[Dollars] = MetricPattern4( - client, _m(acc, "m3sd_usd") - ) - self.p0_5sd: MetricPattern4[StoredF32] = MetricPattern4( - client, _m(acc, "p0_5sd") - ) - self.p0_5sd_usd: MetricPattern4[Dollars] = MetricPattern4( - client, _m(acc, "p0_5sd_usd") - ) - self.p1_5sd: MetricPattern4[StoredF32] = MetricPattern4( - client, _m(acc, "p1_5sd") - ) - self.p1_5sd_usd: MetricPattern4[Dollars] = MetricPattern4( - client, _m(acc, "p1_5sd_usd") - ) - self.p1sd: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, "p1sd")) - self.p1sd_usd: MetricPattern4[Dollars] = MetricPattern4( - client, _m(acc, "p1sd_usd") - ) - self.p2_5sd: MetricPattern4[StoredF32] = MetricPattern4( - client, _m(acc, "p2_5sd") - ) - self.p2_5sd_usd: MetricPattern4[Dollars] = MetricPattern4( - client, _m(acc, "p2_5sd_usd") - ) - self.p2sd: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, "p2sd")) - self.p2sd_usd: MetricPattern4[Dollars] = MetricPattern4( - client, _m(acc, "p2sd_usd") - ) - self.p3sd: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, "p3sd")) - self.p3sd_usd: MetricPattern4[Dollars] = MetricPattern4( - client, _m(acc, "p3sd_usd") - ) - self.sd: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, "sd")) - self.sma: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, "sma")) - self.zscore: MetricPattern4[StoredF32] = MetricPattern4( - client, _m(acc, "zscore") - ) - + self._0sd_usd: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, '0sd_usd')) + self.m0_5sd: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'm0_5sd')) + self.m0_5sd_usd: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'm0_5sd_usd')) + self.m1_5sd: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'm1_5sd')) + self.m1_5sd_usd: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'm1_5sd_usd')) + self.m1sd: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'm1sd')) + self.m1sd_usd: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'm1sd_usd')) + self.m2_5sd: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'm2_5sd')) + self.m2_5sd_usd: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'm2_5sd_usd')) + self.m2sd: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'm2sd')) + self.m2sd_usd: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'm2sd_usd')) + self.m3sd: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'm3sd')) + self.m3sd_usd: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'm3sd_usd')) + self.p0_5sd: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'p0_5sd')) + self.p0_5sd_usd: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'p0_5sd_usd')) + self.p1_5sd: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'p1_5sd')) + self.p1_5sd_usd: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'p1_5sd_usd')) + self.p1sd: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'p1sd')) + self.p1sd_usd: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'p1sd_usd')) + self.p2_5sd: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'p2_5sd')) + self.p2_5sd_usd: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'p2_5sd_usd')) + self.p2sd: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'p2sd')) + self.p2sd_usd: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'p2sd_usd')) + self.p3sd: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'p3sd')) + self.p3sd_usd: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'p3sd_usd')) + self.sd: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'sd')) + self.sma: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'sma')) + self.zscore: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'zscore')) class RealizedPattern2: """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.mvrv: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, "mvrv")) - self.neg_realized_loss: BitcoinPattern[Dollars] = BitcoinPattern( - client, _m(acc, "neg_realized_loss") - ) - self.net_realized_pnl: BlockCountPattern[Dollars] = BlockCountPattern( - client, _m(acc, "net_realized_pnl") - ) - self.net_realized_pnl_cumulative_30d_delta: MetricPattern4[Dollars] = ( - MetricPattern4(client, _m(acc, "net_realized_pnl_cumulative_30d_delta")) - ) - self.net_realized_pnl_cumulative_30d_delta_rel_to_market_cap: MetricPattern4[ - StoredF32 - ] = MetricPattern4( - client, _m(acc, "net_realized_pnl_cumulative_30d_delta_rel_to_market_cap") - ) - self.net_realized_pnl_cumulative_30d_delta_rel_to_realized_cap: MetricPattern4[ - StoredF32 - ] = MetricPattern4( - client, _m(acc, "net_realized_pnl_cumulative_30d_delta_rel_to_realized_cap") - ) - self.net_realized_pnl_rel_to_realized_cap: BlockCountPattern[StoredF32] = ( - BlockCountPattern(client, _m(acc, "net_realized_pnl_rel_to_realized_cap")) - ) - self.realized_cap: MetricPattern1[Dollars] = MetricPattern1( - client, _m(acc, "realized_cap") - ) - self.realized_cap_30d_delta: MetricPattern4[Dollars] = MetricPattern4( - client, _m(acc, "realized_cap_30d_delta") - ) - self.realized_cap_rel_to_own_market_cap: MetricPattern1[StoredF32] = ( - MetricPattern1(client, _m(acc, "realized_cap_rel_to_own_market_cap")) - ) - self.realized_loss: BlockCountPattern[Dollars] = BlockCountPattern( - client, _m(acc, "realized_loss") - ) - self.realized_loss_rel_to_realized_cap: BlockCountPattern[StoredF32] = ( - BlockCountPattern(client, _m(acc, "realized_loss_rel_to_realized_cap")) - ) - self.realized_price: MetricPattern1[Dollars] = MetricPattern1( - client, _m(acc, "realized_price") - ) - self.realized_price_extra: ActivePriceRatioPattern = ActivePriceRatioPattern( - client, _m(acc, "realized_price_ratio") - ) - self.realized_profit: BlockCountPattern[Dollars] = BlockCountPattern( - client, _m(acc, "realized_profit") - ) - self.realized_profit_rel_to_realized_cap: BlockCountPattern[StoredF32] = ( - BlockCountPattern(client, _m(acc, "realized_profit_rel_to_realized_cap")) - ) - self.realized_profit_to_loss_ratio: MetricPattern6[StoredF64] = MetricPattern6( - client, _m(acc, "realized_profit_to_loss_ratio") - ) - self.realized_value: MetricPattern1[Dollars] = MetricPattern1( - client, _m(acc, "realized_value") - ) - self.sell_side_risk_ratio: MetricPattern6[StoredF32] = MetricPattern6( - client, _m(acc, "sell_side_risk_ratio") - ) - self.sell_side_risk_ratio_30d_ema: MetricPattern6[StoredF32] = MetricPattern6( - client, _m(acc, "sell_side_risk_ratio_30d_ema") - ) - self.sell_side_risk_ratio_7d_ema: MetricPattern6[StoredF32] = MetricPattern6( - client, _m(acc, "sell_side_risk_ratio_7d_ema") - ) - self.sopr: MetricPattern6[StoredF64] = MetricPattern6(client, _m(acc, "sopr")) - self.sopr_30d_ema: MetricPattern6[StoredF64] = MetricPattern6( - client, _m(acc, "sopr_30d_ema") - ) - self.sopr_7d_ema: MetricPattern6[StoredF64] = MetricPattern6( - client, _m(acc, "sopr_7d_ema") - ) - self.total_realized_pnl: MetricPattern1[Dollars] = MetricPattern1( - client, _m(acc, "total_realized_pnl") - ) - self.value_created: MetricPattern1[Dollars] = MetricPattern1( - client, _m(acc, "value_created") - ) - self.value_destroyed: MetricPattern1[Dollars] = MetricPattern1( - client, _m(acc, "value_destroyed") - ) - + self.mvrv: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'mvrv')) + self.neg_realized_loss: BitcoinPattern[Dollars] = BitcoinPattern(client, _m(acc, 'neg_realized_loss')) + self.net_realized_pnl: BlockCountPattern[Dollars] = BlockCountPattern(client, _m(acc, 'net_realized_pnl')) + self.net_realized_pnl_cumulative_30d_delta: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'net_realized_pnl_cumulative_30d_delta')) + self.net_realized_pnl_cumulative_30d_delta_rel_to_market_cap: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'net_realized_pnl_cumulative_30d_delta_rel_to_market_cap')) + self.net_realized_pnl_cumulative_30d_delta_rel_to_realized_cap: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'net_realized_pnl_cumulative_30d_delta_rel_to_realized_cap')) + self.net_realized_pnl_rel_to_realized_cap: BlockCountPattern[StoredF32] = BlockCountPattern(client, _m(acc, 'net_realized_pnl_rel_to_realized_cap')) + self.realized_cap: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'realized_cap')) + self.realized_cap_30d_delta: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'realized_cap_30d_delta')) + self.realized_cap_rel_to_own_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'realized_cap_rel_to_own_market_cap')) + self.realized_loss: BlockCountPattern[Dollars] = BlockCountPattern(client, _m(acc, 'realized_loss')) + self.realized_loss_rel_to_realized_cap: BlockCountPattern[StoredF32] = BlockCountPattern(client, _m(acc, 'realized_loss_rel_to_realized_cap')) + self.realized_price: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'realized_price')) + self.realized_price_extra: ActivePriceRatioPattern = ActivePriceRatioPattern(client, _m(acc, 'realized_price_ratio')) + self.realized_profit: BlockCountPattern[Dollars] = BlockCountPattern(client, _m(acc, 'realized_profit')) + self.realized_profit_rel_to_realized_cap: BlockCountPattern[StoredF32] = BlockCountPattern(client, _m(acc, 'realized_profit_rel_to_realized_cap')) + self.realized_profit_to_loss_ratio: MetricPattern6[StoredF64] = MetricPattern6(client, _m(acc, 'realized_profit_to_loss_ratio')) + self.realized_value: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'realized_value')) + self.sell_side_risk_ratio: MetricPattern6[StoredF32] = MetricPattern6(client, _m(acc, 'sell_side_risk_ratio')) + self.sell_side_risk_ratio_30d_ema: MetricPattern6[StoredF32] = MetricPattern6(client, _m(acc, 'sell_side_risk_ratio_30d_ema')) + self.sell_side_risk_ratio_7d_ema: MetricPattern6[StoredF32] = MetricPattern6(client, _m(acc, 'sell_side_risk_ratio_7d_ema')) + self.sopr: MetricPattern6[StoredF64] = MetricPattern6(client, _m(acc, 'sopr')) + self.sopr_30d_ema: MetricPattern6[StoredF64] = MetricPattern6(client, _m(acc, 'sopr_30d_ema')) + self.sopr_7d_ema: MetricPattern6[StoredF64] = MetricPattern6(client, _m(acc, 'sopr_7d_ema')) + self.total_realized_pnl: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'total_realized_pnl')) + self.value_created: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'value_created')) + self.value_destroyed: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'value_destroyed')) class RealizedPattern: """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.mvrv: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, "mvrv")) - self.neg_realized_loss: BitcoinPattern[Dollars] = BitcoinPattern( - client, _m(acc, "neg_realized_loss") - ) - self.net_realized_pnl: BlockCountPattern[Dollars] = BlockCountPattern( - client, _m(acc, "net_realized_pnl") - ) - self.net_realized_pnl_cumulative_30d_delta: MetricPattern4[Dollars] = ( - MetricPattern4(client, _m(acc, "net_realized_pnl_cumulative_30d_delta")) - ) - self.net_realized_pnl_cumulative_30d_delta_rel_to_market_cap: MetricPattern4[ - StoredF32 - ] = MetricPattern4( - client, _m(acc, "net_realized_pnl_cumulative_30d_delta_rel_to_market_cap") - ) - self.net_realized_pnl_cumulative_30d_delta_rel_to_realized_cap: MetricPattern4[ - StoredF32 - ] = MetricPattern4( - client, _m(acc, "net_realized_pnl_cumulative_30d_delta_rel_to_realized_cap") - ) - self.net_realized_pnl_rel_to_realized_cap: BlockCountPattern[StoredF32] = ( - BlockCountPattern(client, _m(acc, "net_realized_pnl_rel_to_realized_cap")) - ) - self.realized_cap: MetricPattern1[Dollars] = MetricPattern1( - client, _m(acc, "realized_cap") - ) - self.realized_cap_30d_delta: MetricPattern4[Dollars] = MetricPattern4( - client, _m(acc, "realized_cap_30d_delta") - ) - self.realized_loss: BlockCountPattern[Dollars] = BlockCountPattern( - client, _m(acc, "realized_loss") - ) - self.realized_loss_rel_to_realized_cap: BlockCountPattern[StoredF32] = ( - BlockCountPattern(client, _m(acc, "realized_loss_rel_to_realized_cap")) - ) - self.realized_price: MetricPattern1[Dollars] = MetricPattern1( - client, _m(acc, "realized_price") - ) - self.realized_price_extra: RealizedPriceExtraPattern = ( - RealizedPriceExtraPattern(client, _m(acc, "realized_price")) - ) - self.realized_profit: BlockCountPattern[Dollars] = BlockCountPattern( - client, _m(acc, "realized_profit") - ) - self.realized_profit_rel_to_realized_cap: BlockCountPattern[StoredF32] = ( - BlockCountPattern(client, _m(acc, "realized_profit_rel_to_realized_cap")) - ) - self.realized_value: MetricPattern1[Dollars] = MetricPattern1( - client, _m(acc, "realized_value") - ) - self.sell_side_risk_ratio: MetricPattern6[StoredF32] = MetricPattern6( - client, _m(acc, "sell_side_risk_ratio") - ) - self.sell_side_risk_ratio_30d_ema: MetricPattern6[StoredF32] = MetricPattern6( - client, _m(acc, "sell_side_risk_ratio_30d_ema") - ) - self.sell_side_risk_ratio_7d_ema: MetricPattern6[StoredF32] = MetricPattern6( - client, _m(acc, "sell_side_risk_ratio_7d_ema") - ) - self.sopr: MetricPattern6[StoredF64] = MetricPattern6(client, _m(acc, "sopr")) - self.sopr_30d_ema: MetricPattern6[StoredF64] = MetricPattern6( - client, _m(acc, "sopr_30d_ema") - ) - self.sopr_7d_ema: MetricPattern6[StoredF64] = MetricPattern6( - client, _m(acc, "sopr_7d_ema") - ) - self.total_realized_pnl: MetricPattern1[Dollars] = MetricPattern1( - client, _m(acc, "total_realized_pnl") - ) - self.value_created: MetricPattern1[Dollars] = MetricPattern1( - client, _m(acc, "value_created") - ) - self.value_destroyed: MetricPattern1[Dollars] = MetricPattern1( - client, _m(acc, "value_destroyed") - ) - + self.mvrv: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'mvrv')) + self.neg_realized_loss: BitcoinPattern[Dollars] = BitcoinPattern(client, _m(acc, 'neg_realized_loss')) + self.net_realized_pnl: BlockCountPattern[Dollars] = BlockCountPattern(client, _m(acc, 'net_realized_pnl')) + self.net_realized_pnl_cumulative_30d_delta: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'net_realized_pnl_cumulative_30d_delta')) + self.net_realized_pnl_cumulative_30d_delta_rel_to_market_cap: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'net_realized_pnl_cumulative_30d_delta_rel_to_market_cap')) + self.net_realized_pnl_cumulative_30d_delta_rel_to_realized_cap: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'net_realized_pnl_cumulative_30d_delta_rel_to_realized_cap')) + self.net_realized_pnl_rel_to_realized_cap: BlockCountPattern[StoredF32] = BlockCountPattern(client, _m(acc, 'net_realized_pnl_rel_to_realized_cap')) + self.realized_cap: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'realized_cap')) + self.realized_cap_30d_delta: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'realized_cap_30d_delta')) + self.realized_loss: BlockCountPattern[Dollars] = BlockCountPattern(client, _m(acc, 'realized_loss')) + self.realized_loss_rel_to_realized_cap: BlockCountPattern[StoredF32] = BlockCountPattern(client, _m(acc, 'realized_loss_rel_to_realized_cap')) + self.realized_price: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'realized_price')) + self.realized_price_extra: RealizedPriceExtraPattern = RealizedPriceExtraPattern(client, _m(acc, 'realized_price')) + self.realized_profit: BlockCountPattern[Dollars] = BlockCountPattern(client, _m(acc, 'realized_profit')) + self.realized_profit_rel_to_realized_cap: BlockCountPattern[StoredF32] = BlockCountPattern(client, _m(acc, 'realized_profit_rel_to_realized_cap')) + self.realized_value: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'realized_value')) + self.sell_side_risk_ratio: MetricPattern6[StoredF32] = MetricPattern6(client, _m(acc, 'sell_side_risk_ratio')) + self.sell_side_risk_ratio_30d_ema: MetricPattern6[StoredF32] = MetricPattern6(client, _m(acc, 'sell_side_risk_ratio_30d_ema')) + self.sell_side_risk_ratio_7d_ema: MetricPattern6[StoredF32] = MetricPattern6(client, _m(acc, 'sell_side_risk_ratio_7d_ema')) + self.sopr: MetricPattern6[StoredF64] = MetricPattern6(client, _m(acc, 'sopr')) + self.sopr_30d_ema: MetricPattern6[StoredF64] = MetricPattern6(client, _m(acc, 'sopr_30d_ema')) + self.sopr_7d_ema: MetricPattern6[StoredF64] = MetricPattern6(client, _m(acc, 'sopr_7d_ema')) + self.total_realized_pnl: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'total_realized_pnl')) + self.value_created: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'value_created')) + self.value_destroyed: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'value_destroyed')) class Price111dSmaPattern: """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" self.price: MetricPattern4[Dollars] = MetricPattern4(client, acc) - self.ratio: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, "ratio")) - self.ratio_1m_sma: MetricPattern4[StoredF32] = MetricPattern4( - client, _m(acc, "ratio_1m_sma") - ) - self.ratio_1w_sma: MetricPattern4[StoredF32] = MetricPattern4( - client, _m(acc, "ratio_1w_sma") - ) - self.ratio_1y_sd: Ratio1ySdPattern = Ratio1ySdPattern( - client, _m(acc, "ratio_1y") - ) - self.ratio_2y_sd: Ratio1ySdPattern = Ratio1ySdPattern( - client, _m(acc, "ratio_2y") - ) - self.ratio_4y_sd: Ratio1ySdPattern = Ratio1ySdPattern( - client, _m(acc, "ratio_4y") - ) - self.ratio_pct1: MetricPattern4[StoredF32] = MetricPattern4( - client, _m(acc, "ratio_pct1") - ) - self.ratio_pct1_usd: MetricPattern4[Dollars] = MetricPattern4( - client, _m(acc, "ratio_pct1_usd") - ) - self.ratio_pct2: MetricPattern4[StoredF32] = MetricPattern4( - client, _m(acc, "ratio_pct2") - ) - self.ratio_pct2_usd: MetricPattern4[Dollars] = MetricPattern4( - client, _m(acc, "ratio_pct2_usd") - ) - self.ratio_pct5: MetricPattern4[StoredF32] = MetricPattern4( - client, _m(acc, "ratio_pct5") - ) - self.ratio_pct5_usd: MetricPattern4[Dollars] = MetricPattern4( - client, _m(acc, "ratio_pct5_usd") - ) - self.ratio_pct95: MetricPattern4[StoredF32] = MetricPattern4( - client, _m(acc, "ratio_pct95") - ) - self.ratio_pct95_usd: MetricPattern4[Dollars] = MetricPattern4( - client, _m(acc, "ratio_pct95_usd") - ) - self.ratio_pct98: MetricPattern4[StoredF32] = MetricPattern4( - client, _m(acc, "ratio_pct98") - ) - self.ratio_pct98_usd: MetricPattern4[Dollars] = MetricPattern4( - client, _m(acc, "ratio_pct98_usd") - ) - self.ratio_pct99: MetricPattern4[StoredF32] = MetricPattern4( - client, _m(acc, "ratio_pct99") - ) - self.ratio_pct99_usd: MetricPattern4[Dollars] = MetricPattern4( - client, _m(acc, "ratio_pct99_usd") - ) - self.ratio_sd: Ratio1ySdPattern = Ratio1ySdPattern(client, _m(acc, "ratio")) - - -class PercentilesPattern: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.cost_basis_pct05: MetricPattern4[Dollars] = MetricPattern4( - client, _m(acc, "pct05") - ) - self.cost_basis_pct10: MetricPattern4[Dollars] = MetricPattern4( - client, _m(acc, "pct10") - ) - self.cost_basis_pct15: MetricPattern4[Dollars] = MetricPattern4( - client, _m(acc, "pct15") - ) - self.cost_basis_pct20: MetricPattern4[Dollars] = MetricPattern4( - client, _m(acc, "pct20") - ) - self.cost_basis_pct25: MetricPattern4[Dollars] = MetricPattern4( - client, _m(acc, "pct25") - ) - self.cost_basis_pct30: MetricPattern4[Dollars] = MetricPattern4( - client, _m(acc, "pct30") - ) - self.cost_basis_pct35: MetricPattern4[Dollars] = MetricPattern4( - client, _m(acc, "pct35") - ) - self.cost_basis_pct40: MetricPattern4[Dollars] = MetricPattern4( - client, _m(acc, "pct40") - ) - self.cost_basis_pct45: MetricPattern4[Dollars] = MetricPattern4( - client, _m(acc, "pct45") - ) - self.cost_basis_pct50: MetricPattern4[Dollars] = MetricPattern4( - client, _m(acc, "pct50") - ) - self.cost_basis_pct55: MetricPattern4[Dollars] = MetricPattern4( - client, _m(acc, "pct55") - ) - self.cost_basis_pct60: MetricPattern4[Dollars] = MetricPattern4( - client, _m(acc, "pct60") - ) - self.cost_basis_pct65: MetricPattern4[Dollars] = MetricPattern4( - client, _m(acc, "pct65") - ) - self.cost_basis_pct70: MetricPattern4[Dollars] = MetricPattern4( - client, _m(acc, "pct70") - ) - self.cost_basis_pct75: MetricPattern4[Dollars] = MetricPattern4( - client, _m(acc, "pct75") - ) - self.cost_basis_pct80: MetricPattern4[Dollars] = MetricPattern4( - client, _m(acc, "pct80") - ) - self.cost_basis_pct85: MetricPattern4[Dollars] = MetricPattern4( - client, _m(acc, "pct85") - ) - self.cost_basis_pct90: MetricPattern4[Dollars] = MetricPattern4( - client, _m(acc, "pct90") - ) - self.cost_basis_pct95: MetricPattern4[Dollars] = MetricPattern4( - client, _m(acc, "pct95") - ) - + self.ratio: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'ratio')) + self.ratio_1m_sma: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'ratio_1m_sma')) + self.ratio_1w_sma: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'ratio_1w_sma')) + self.ratio_1y_sd: Ratio1ySdPattern = Ratio1ySdPattern(client, _m(acc, 'ratio_1y')) + self.ratio_2y_sd: Ratio1ySdPattern = Ratio1ySdPattern(client, _m(acc, 'ratio_2y')) + self.ratio_4y_sd: Ratio1ySdPattern = Ratio1ySdPattern(client, _m(acc, 'ratio_4y')) + self.ratio_pct1: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'ratio_pct1')) + self.ratio_pct1_usd: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'ratio_pct1_usd')) + self.ratio_pct2: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'ratio_pct2')) + self.ratio_pct2_usd: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'ratio_pct2_usd')) + self.ratio_pct5: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'ratio_pct5')) + self.ratio_pct5_usd: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'ratio_pct5_usd')) + self.ratio_pct95: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'ratio_pct95')) + self.ratio_pct95_usd: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'ratio_pct95_usd')) + self.ratio_pct98: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'ratio_pct98')) + self.ratio_pct98_usd: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'ratio_pct98_usd')) + self.ratio_pct99: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'ratio_pct99')) + self.ratio_pct99_usd: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'ratio_pct99_usd')) + self.ratio_sd: Ratio1ySdPattern = Ratio1ySdPattern(client, _m(acc, 'ratio')) class ActivePriceRatioPattern: """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" self.ratio: MetricPattern4[StoredF32] = MetricPattern4(client, acc) - self.ratio_1m_sma: MetricPattern4[StoredF32] = MetricPattern4( - client, _m(acc, "1m_sma") - ) - self.ratio_1w_sma: MetricPattern4[StoredF32] = MetricPattern4( - client, _m(acc, "1w_sma") - ) - self.ratio_1y_sd: Ratio1ySdPattern = Ratio1ySdPattern(client, _m(acc, "1y")) - self.ratio_2y_sd: Ratio1ySdPattern = Ratio1ySdPattern(client, _m(acc, "2y")) - self.ratio_4y_sd: Ratio1ySdPattern = Ratio1ySdPattern(client, _m(acc, "4y")) - self.ratio_pct1: MetricPattern4[StoredF32] = MetricPattern4( - client, _m(acc, "pct1") - ) - self.ratio_pct1_usd: MetricPattern4[Dollars] = MetricPattern4( - client, _m(acc, "pct1_usd") - ) - self.ratio_pct2: MetricPattern4[StoredF32] = MetricPattern4( - client, _m(acc, "pct2") - ) - self.ratio_pct2_usd: MetricPattern4[Dollars] = MetricPattern4( - client, _m(acc, "pct2_usd") - ) - self.ratio_pct5: MetricPattern4[StoredF32] = MetricPattern4( - client, _m(acc, "pct5") - ) - self.ratio_pct5_usd: MetricPattern4[Dollars] = MetricPattern4( - client, _m(acc, "pct5_usd") - ) - self.ratio_pct95: MetricPattern4[StoredF32] = MetricPattern4( - client, _m(acc, "pct95") - ) - self.ratio_pct95_usd: MetricPattern4[Dollars] = MetricPattern4( - client, _m(acc, "pct95_usd") - ) - self.ratio_pct98: MetricPattern4[StoredF32] = MetricPattern4( - client, _m(acc, "pct98") - ) - self.ratio_pct98_usd: MetricPattern4[Dollars] = MetricPattern4( - client, _m(acc, "pct98_usd") - ) - self.ratio_pct99: MetricPattern4[StoredF32] = MetricPattern4( - client, _m(acc, "pct99") - ) - self.ratio_pct99_usd: MetricPattern4[Dollars] = MetricPattern4( - client, _m(acc, "pct99_usd") - ) + self.ratio_1m_sma: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, '1m_sma')) + self.ratio_1w_sma: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, '1w_sma')) + self.ratio_1y_sd: Ratio1ySdPattern = Ratio1ySdPattern(client, _m(acc, '1y')) + self.ratio_2y_sd: Ratio1ySdPattern = Ratio1ySdPattern(client, _m(acc, '2y')) + self.ratio_4y_sd: Ratio1ySdPattern = Ratio1ySdPattern(client, _m(acc, '4y')) + self.ratio_pct1: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'pct1')) + self.ratio_pct1_usd: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'pct1_usd')) + self.ratio_pct2: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'pct2')) + self.ratio_pct2_usd: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'pct2_usd')) + self.ratio_pct5: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'pct5')) + self.ratio_pct5_usd: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'pct5_usd')) + self.ratio_pct95: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'pct95')) + self.ratio_pct95_usd: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'pct95_usd')) + self.ratio_pct98: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'pct98')) + self.ratio_pct98_usd: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'pct98_usd')) + self.ratio_pct99: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'pct99')) + self.ratio_pct99_usd: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'pct99_usd')) self.ratio_sd: Ratio1ySdPattern = Ratio1ySdPattern(client, acc) +class PercentilesPattern: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self.cost_basis_pct05: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'pct05')) + self.cost_basis_pct10: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'pct10')) + self.cost_basis_pct15: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'pct15')) + self.cost_basis_pct20: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'pct20')) + self.cost_basis_pct25: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'pct25')) + self.cost_basis_pct30: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'pct30')) + self.cost_basis_pct35: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'pct35')) + self.cost_basis_pct40: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'pct40')) + self.cost_basis_pct45: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'pct45')) + self.cost_basis_pct50: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'pct50')) + self.cost_basis_pct55: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'pct55')) + self.cost_basis_pct60: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'pct60')) + self.cost_basis_pct65: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'pct65')) + self.cost_basis_pct70: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'pct70')) + self.cost_basis_pct75: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'pct75')) + self.cost_basis_pct80: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'pct80')) + self.cost_basis_pct85: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'pct85')) + self.cost_basis_pct90: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'pct90')) + self.cost_basis_pct95: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'pct95')) class RelativePattern5: """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.neg_unrealized_loss_rel_to_market_cap: MetricPattern1[StoredF32] = ( - MetricPattern1(client, _m(acc, "neg_unrealized_loss_rel_to_market_cap")) - ) - self.neg_unrealized_loss_rel_to_own_market_cap: MetricPattern1[StoredF32] = ( - MetricPattern1(client, _m(acc, "neg_unrealized_loss_rel_to_own_market_cap")) - ) - self.neg_unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1[ - StoredF32 - ] = MetricPattern1( - client, _m(acc, "neg_unrealized_loss_rel_to_own_total_unrealized_pnl") - ) - self.net_unrealized_pnl_rel_to_market_cap: MetricPattern1[StoredF32] = ( - MetricPattern1(client, _m(acc, "net_unrealized_pnl_rel_to_market_cap")) - ) - self.net_unrealized_pnl_rel_to_own_market_cap: MetricPattern1[StoredF32] = ( - MetricPattern1(client, _m(acc, "net_unrealized_pnl_rel_to_own_market_cap")) - ) - self.net_unrealized_pnl_rel_to_own_total_unrealized_pnl: MetricPattern1[ - StoredF32 - ] = MetricPattern1( - client, _m(acc, "net_unrealized_pnl_rel_to_own_total_unrealized_pnl") - ) - self.nupl: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, "nupl")) - self.supply_in_loss_rel_to_circulating_supply: MetricPattern1[StoredF64] = ( - MetricPattern1(client, _m(acc, "supply_in_loss_rel_to_circulating_supply")) - ) - self.supply_in_loss_rel_to_own_supply: MetricPattern1[StoredF64] = ( - MetricPattern1(client, _m(acc, "supply_in_loss_rel_to_own_supply")) - ) - self.supply_in_profit_rel_to_circulating_supply: MetricPattern1[StoredF64] = ( - MetricPattern1( - client, _m(acc, "supply_in_profit_rel_to_circulating_supply") - ) - ) - self.supply_in_profit_rel_to_own_supply: MetricPattern1[StoredF64] = ( - MetricPattern1(client, _m(acc, "supply_in_profit_rel_to_own_supply")) - ) - self.supply_rel_to_circulating_supply: MetricPattern4[StoredF64] = ( - MetricPattern4(client, _m(acc, "supply_rel_to_circulating_supply")) - ) - self.unrealized_loss_rel_to_market_cap: MetricPattern1[StoredF32] = ( - MetricPattern1(client, _m(acc, "unrealized_loss_rel_to_market_cap")) - ) - self.unrealized_loss_rel_to_own_market_cap: MetricPattern1[StoredF32] = ( - MetricPattern1(client, _m(acc, "unrealized_loss_rel_to_own_market_cap")) - ) - self.unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1[ - StoredF32 - ] = MetricPattern1( - client, _m(acc, "unrealized_loss_rel_to_own_total_unrealized_pnl") - ) - self.unrealized_profit_rel_to_market_cap: MetricPattern1[StoredF32] = ( - MetricPattern1(client, _m(acc, "unrealized_profit_rel_to_market_cap")) - ) - self.unrealized_profit_rel_to_own_market_cap: MetricPattern1[StoredF32] = ( - MetricPattern1(client, _m(acc, "unrealized_profit_rel_to_own_market_cap")) - ) - self.unrealized_profit_rel_to_own_total_unrealized_pnl: MetricPattern1[ - StoredF32 - ] = MetricPattern1( - client, _m(acc, "unrealized_profit_rel_to_own_total_unrealized_pnl") - ) - + self.neg_unrealized_loss_rel_to_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'neg_unrealized_loss_rel_to_market_cap')) + self.neg_unrealized_loss_rel_to_own_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'neg_unrealized_loss_rel_to_own_market_cap')) + self.neg_unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'neg_unrealized_loss_rel_to_own_total_unrealized_pnl')) + self.net_unrealized_pnl_rel_to_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'net_unrealized_pnl_rel_to_market_cap')) + self.net_unrealized_pnl_rel_to_own_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'net_unrealized_pnl_rel_to_own_market_cap')) + self.net_unrealized_pnl_rel_to_own_total_unrealized_pnl: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'net_unrealized_pnl_rel_to_own_total_unrealized_pnl')) + self.nupl: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'nupl')) + self.supply_in_loss_rel_to_circulating_supply: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'supply_in_loss_rel_to_circulating_supply')) + self.supply_in_loss_rel_to_own_supply: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'supply_in_loss_rel_to_own_supply')) + self.supply_in_profit_rel_to_circulating_supply: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'supply_in_profit_rel_to_circulating_supply')) + self.supply_in_profit_rel_to_own_supply: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'supply_in_profit_rel_to_own_supply')) + self.supply_rel_to_circulating_supply: MetricPattern4[StoredF64] = MetricPattern4(client, _m(acc, 'supply_rel_to_circulating_supply')) + self.unrealized_loss_rel_to_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'unrealized_loss_rel_to_market_cap')) + self.unrealized_loss_rel_to_own_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'unrealized_loss_rel_to_own_market_cap')) + self.unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'unrealized_loss_rel_to_own_total_unrealized_pnl')) + self.unrealized_profit_rel_to_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'unrealized_profit_rel_to_market_cap')) + self.unrealized_profit_rel_to_own_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'unrealized_profit_rel_to_own_market_cap')) + self.unrealized_profit_rel_to_own_total_unrealized_pnl: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'unrealized_profit_rel_to_own_total_unrealized_pnl')) class AaopoolPattern: """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self._1m_blocks_mined: MetricPattern1[StoredU32] = MetricPattern1( - client, _m(acc, "1m_blocks_mined") - ) - self._1m_dominance: MetricPattern1[StoredF32] = MetricPattern1( - client, _m(acc, "1m_dominance") - ) - self._1w_blocks_mined: MetricPattern1[StoredU32] = MetricPattern1( - client, _m(acc, "1w_blocks_mined") - ) - self._1w_dominance: MetricPattern1[StoredF32] = MetricPattern1( - client, _m(acc, "1w_dominance") - ) - self._1y_blocks_mined: MetricPattern1[StoredU32] = MetricPattern1( - client, _m(acc, "1y_blocks_mined") - ) - self._1y_dominance: MetricPattern1[StoredF32] = MetricPattern1( - client, _m(acc, "1y_dominance") - ) - self._24h_blocks_mined: MetricPattern1[StoredU32] = MetricPattern1( - client, _m(acc, "24h_blocks_mined") - ) - self._24h_dominance: MetricPattern1[StoredF32] = MetricPattern1( - client, _m(acc, "24h_dominance") - ) - self.blocks_mined: BlockCountPattern[StoredU32] = BlockCountPattern( - client, _m(acc, "blocks_mined") - ) - self.coinbase: CoinbasePattern2 = CoinbasePattern2(client, _m(acc, "coinbase")) - self.days_since_block: MetricPattern4[StoredU16] = MetricPattern4( - client, _m(acc, "days_since_block") - ) - self.dominance: MetricPattern1[StoredF32] = MetricPattern1( - client, _m(acc, "dominance") - ) - self.fee: UnclaimedRewardsPattern = UnclaimedRewardsPattern( - client, _m(acc, "fee") - ) - self.subsidy: UnclaimedRewardsPattern = UnclaimedRewardsPattern( - client, _m(acc, "subsidy") - ) - + self._1m_blocks_mined: MetricPattern1[StoredU32] = MetricPattern1(client, _m(acc, '1m_blocks_mined')) + self._1m_dominance: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, '1m_dominance')) + self._1w_blocks_mined: MetricPattern1[StoredU32] = MetricPattern1(client, _m(acc, '1w_blocks_mined')) + self._1w_dominance: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, '1w_dominance')) + self._1y_blocks_mined: MetricPattern1[StoredU32] = MetricPattern1(client, _m(acc, '1y_blocks_mined')) + self._1y_dominance: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, '1y_dominance')) + self._24h_blocks_mined: MetricPattern1[StoredU32] = MetricPattern1(client, _m(acc, '24h_blocks_mined')) + self._24h_dominance: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, '24h_dominance')) + self.blocks_mined: BlockCountPattern[StoredU32] = BlockCountPattern(client, _m(acc, 'blocks_mined')) + self.coinbase: CoinbasePattern2 = CoinbasePattern2(client, _m(acc, 'coinbase')) + self.days_since_block: MetricPattern4[StoredU16] = MetricPattern4(client, _m(acc, 'days_since_block')) + self.dominance: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'dominance')) + self.fee: UnclaimedRewardsPattern = UnclaimedRewardsPattern(client, _m(acc, 'fee')) + self.subsidy: UnclaimedRewardsPattern = UnclaimedRewardsPattern(client, _m(acc, 'subsidy')) class PriceAgoPattern(Generic[T]): """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, base_path: str): - self._10y: MetricPattern4[T] = MetricPattern4(client, f"{base_path}_10y") - self._1d: MetricPattern4[T] = MetricPattern4(client, f"{base_path}_1d") - self._1m: MetricPattern4[T] = MetricPattern4(client, f"{base_path}_1m") - self._1w: MetricPattern4[T] = MetricPattern4(client, f"{base_path}_1w") - self._1y: MetricPattern4[T] = MetricPattern4(client, f"{base_path}_1y") - self._2y: MetricPattern4[T] = MetricPattern4(client, f"{base_path}_2y") - self._3m: MetricPattern4[T] = MetricPattern4(client, f"{base_path}_3m") - self._3y: MetricPattern4[T] = MetricPattern4(client, f"{base_path}_3y") - self._4y: MetricPattern4[T] = MetricPattern4(client, f"{base_path}_4y") - self._5y: MetricPattern4[T] = MetricPattern4(client, f"{base_path}_5y") - self._6m: MetricPattern4[T] = MetricPattern4(client, f"{base_path}_6m") - self._6y: MetricPattern4[T] = MetricPattern4(client, f"{base_path}_6y") - self._8y: MetricPattern4[T] = MetricPattern4(client, f"{base_path}_8y") - + self._10y: MetricPattern4[T] = MetricPattern4(client, f'{base_path}_10y') + self._1d: MetricPattern4[T] = MetricPattern4(client, f'{base_path}_1d') + self._1m: MetricPattern4[T] = MetricPattern4(client, f'{base_path}_1m') + self._1w: MetricPattern4[T] = MetricPattern4(client, f'{base_path}_1w') + self._1y: MetricPattern4[T] = MetricPattern4(client, f'{base_path}_1y') + self._2y: MetricPattern4[T] = MetricPattern4(client, f'{base_path}_2y') + self._3m: MetricPattern4[T] = MetricPattern4(client, f'{base_path}_3m') + self._3y: MetricPattern4[T] = MetricPattern4(client, f'{base_path}_3y') + self._4y: MetricPattern4[T] = MetricPattern4(client, f'{base_path}_4y') + self._5y: MetricPattern4[T] = MetricPattern4(client, f'{base_path}_5y') + self._6m: MetricPattern4[T] = MetricPattern4(client, f'{base_path}_6m') + self._6y: MetricPattern4[T] = MetricPattern4(client, f'{base_path}_6y') + self._8y: MetricPattern4[T] = MetricPattern4(client, f'{base_path}_8y') class PeriodLumpSumStackPattern: """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self._10y: _2015Pattern = _2015Pattern(client, (f"10y_{acc}" if acc else "10y")) - self._1m: _2015Pattern = _2015Pattern(client, (f"1m_{acc}" if acc else "1m")) - self._1w: _2015Pattern = _2015Pattern(client, (f"1w_{acc}" if acc else "1w")) - self._1y: _2015Pattern = _2015Pattern(client, (f"1y_{acc}" if acc else "1y")) - self._2y: _2015Pattern = _2015Pattern(client, (f"2y_{acc}" if acc else "2y")) - self._3m: _2015Pattern = _2015Pattern(client, (f"3m_{acc}" if acc else "3m")) - self._3y: _2015Pattern = _2015Pattern(client, (f"3y_{acc}" if acc else "3y")) - self._4y: _2015Pattern = _2015Pattern(client, (f"4y_{acc}" if acc else "4y")) - self._5y: _2015Pattern = _2015Pattern(client, (f"5y_{acc}" if acc else "5y")) - self._6m: _2015Pattern = _2015Pattern(client, (f"6m_{acc}" if acc else "6m")) - self._6y: _2015Pattern = _2015Pattern(client, (f"6y_{acc}" if acc else "6y")) - self._8y: _2015Pattern = _2015Pattern(client, (f"8y_{acc}" if acc else "8y")) - + self._10y: _2015Pattern = _2015Pattern(client, (f'10y_{acc}' if acc else '10y')) + self._1m: _2015Pattern = _2015Pattern(client, (f'1m_{acc}' if acc else '1m')) + self._1w: _2015Pattern = _2015Pattern(client, (f'1w_{acc}' if acc else '1w')) + self._1y: _2015Pattern = _2015Pattern(client, (f'1y_{acc}' if acc else '1y')) + self._2y: _2015Pattern = _2015Pattern(client, (f'2y_{acc}' if acc else '2y')) + self._3m: _2015Pattern = _2015Pattern(client, (f'3m_{acc}' if acc else '3m')) + self._3y: _2015Pattern = _2015Pattern(client, (f'3y_{acc}' if acc else '3y')) + self._4y: _2015Pattern = _2015Pattern(client, (f'4y_{acc}' if acc else '4y')) + self._5y: _2015Pattern = _2015Pattern(client, (f'5y_{acc}' if acc else '5y')) + self._6m: _2015Pattern = _2015Pattern(client, (f'6m_{acc}' if acc else '6m')) + self._6y: _2015Pattern = _2015Pattern(client, (f'6y_{acc}' if acc else '6y')) + self._8y: _2015Pattern = _2015Pattern(client, (f'8y_{acc}' if acc else '8y')) class PeriodAveragePricePattern(Generic[T]): """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self._10y: MetricPattern4[T] = MetricPattern4( - client, (f"10y_{acc}" if acc else "10y") - ) - self._1m: MetricPattern4[T] = MetricPattern4( - client, (f"1m_{acc}" if acc else "1m") - ) - self._1w: MetricPattern4[T] = MetricPattern4( - client, (f"1w_{acc}" if acc else "1w") - ) - self._1y: MetricPattern4[T] = MetricPattern4( - client, (f"1y_{acc}" if acc else "1y") - ) - self._2y: MetricPattern4[T] = MetricPattern4( - client, (f"2y_{acc}" if acc else "2y") - ) - self._3m: MetricPattern4[T] = MetricPattern4( - client, (f"3m_{acc}" if acc else "3m") - ) - self._3y: MetricPattern4[T] = MetricPattern4( - client, (f"3y_{acc}" if acc else "3y") - ) - self._4y: MetricPattern4[T] = MetricPattern4( - client, (f"4y_{acc}" if acc else "4y") - ) - self._5y: MetricPattern4[T] = MetricPattern4( - client, (f"5y_{acc}" if acc else "5y") - ) - self._6m: MetricPattern4[T] = MetricPattern4( - client, (f"6m_{acc}" if acc else "6m") - ) - self._6y: MetricPattern4[T] = MetricPattern4( - client, (f"6y_{acc}" if acc else "6y") - ) - self._8y: MetricPattern4[T] = MetricPattern4( - client, (f"8y_{acc}" if acc else "8y") - ) - - -class ClassAveragePricePattern(Generic[T]): - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClientBase, base_path: str): - self._2015: MetricPattern4[T] = MetricPattern4(client, f"{base_path}_2015") - self._2016: MetricPattern4[T] = MetricPattern4(client, f"{base_path}_2016") - self._2017: MetricPattern4[T] = MetricPattern4(client, f"{base_path}_2017") - self._2018: MetricPattern4[T] = MetricPattern4(client, f"{base_path}_2018") - self._2019: MetricPattern4[T] = MetricPattern4(client, f"{base_path}_2019") - self._2020: MetricPattern4[T] = MetricPattern4(client, f"{base_path}_2020") - self._2021: MetricPattern4[T] = MetricPattern4(client, f"{base_path}_2021") - self._2022: MetricPattern4[T] = MetricPattern4(client, f"{base_path}_2022") - self._2023: MetricPattern4[T] = MetricPattern4(client, f"{base_path}_2023") - self._2024: MetricPattern4[T] = MetricPattern4(client, f"{base_path}_2024") - self._2025: MetricPattern4[T] = MetricPattern4(client, f"{base_path}_2025") - - -class DollarsPattern(Generic[T]): - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.average: MetricPattern2[T] = MetricPattern2(client, _m(acc, "average")) - self.base: MetricPattern11[T] = MetricPattern11(client, acc) - self.cumulative: MetricPattern1[T] = MetricPattern1( - client, _m(acc, "cumulative") - ) - self.max: MetricPattern2[T] = MetricPattern2(client, _m(acc, "max")) - self.median: MetricPattern6[T] = MetricPattern6(client, _m(acc, "median")) - self.min: MetricPattern2[T] = MetricPattern2(client, _m(acc, "min")) - self.pct10: MetricPattern6[T] = MetricPattern6(client, _m(acc, "pct10")) - self.pct25: MetricPattern6[T] = MetricPattern6(client, _m(acc, "pct25")) - self.pct75: MetricPattern6[T] = MetricPattern6(client, _m(acc, "pct75")) - self.pct90: MetricPattern6[T] = MetricPattern6(client, _m(acc, "pct90")) - self.sum: MetricPattern2[T] = MetricPattern2(client, _m(acc, "sum")) - + self._10y: MetricPattern4[T] = MetricPattern4(client, (f'10y_{acc}' if acc else '10y')) + self._1m: MetricPattern4[T] = MetricPattern4(client, (f'1m_{acc}' if acc else '1m')) + self._1w: MetricPattern4[T] = MetricPattern4(client, (f'1w_{acc}' if acc else '1w')) + self._1y: MetricPattern4[T] = MetricPattern4(client, (f'1y_{acc}' if acc else '1y')) + self._2y: MetricPattern4[T] = MetricPattern4(client, (f'2y_{acc}' if acc else '2y')) + self._3m: MetricPattern4[T] = MetricPattern4(client, (f'3m_{acc}' if acc else '3m')) + self._3y: MetricPattern4[T] = MetricPattern4(client, (f'3y_{acc}' if acc else '3y')) + self._4y: MetricPattern4[T] = MetricPattern4(client, (f'4y_{acc}' if acc else '4y')) + self._5y: MetricPattern4[T] = MetricPattern4(client, (f'5y_{acc}' if acc else '5y')) + self._6m: MetricPattern4[T] = MetricPattern4(client, (f'6m_{acc}' if acc else '6m')) + self._6y: MetricPattern4[T] = MetricPattern4(client, (f'6y_{acc}' if acc else '6y')) + self._8y: MetricPattern4[T] = MetricPattern4(client, (f'8y_{acc}' if acc else '8y')) class FullnessPattern(Generic[T]): """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.average: MetricPattern2[T] = MetricPattern2(client, _m(acc, "average")) + self.average: MetricPattern2[T] = MetricPattern2(client, _m(acc, 'average')) self.base: MetricPattern11[T] = MetricPattern11(client, acc) - self.cumulative: MetricPattern2[T] = MetricPattern2( - client, _m(acc, "cumulative") - ) - self.max: MetricPattern2[T] = MetricPattern2(client, _m(acc, "max")) - self.median: MetricPattern6[T] = MetricPattern6(client, _m(acc, "median")) - self.min: MetricPattern2[T] = MetricPattern2(client, _m(acc, "min")) - self.pct10: MetricPattern6[T] = MetricPattern6(client, _m(acc, "pct10")) - self.pct25: MetricPattern6[T] = MetricPattern6(client, _m(acc, "pct25")) - self.pct75: MetricPattern6[T] = MetricPattern6(client, _m(acc, "pct75")) - self.pct90: MetricPattern6[T] = MetricPattern6(client, _m(acc, "pct90")) - self.sum: MetricPattern2[T] = MetricPattern2(client, _m(acc, "sum")) + self.cumulative: MetricPattern2[T] = MetricPattern2(client, _m(acc, 'cumulative')) + self.max: MetricPattern2[T] = MetricPattern2(client, _m(acc, 'max')) + self.median: MetricPattern6[T] = MetricPattern6(client, _m(acc, 'median')) + self.min: MetricPattern2[T] = MetricPattern2(client, _m(acc, 'min')) + self.pct10: MetricPattern6[T] = MetricPattern6(client, _m(acc, 'pct10')) + self.pct25: MetricPattern6[T] = MetricPattern6(client, _m(acc, 'pct25')) + self.pct75: MetricPattern6[T] = MetricPattern6(client, _m(acc, 'pct75')) + self.pct90: MetricPattern6[T] = MetricPattern6(client, _m(acc, 'pct90')) + self.sum: MetricPattern2[T] = MetricPattern2(client, _m(acc, 'sum')) +class ClassAveragePricePattern(Generic[T]): + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, base_path: str): + self._2015: MetricPattern4[T] = MetricPattern4(client, f'{base_path}_2015') + self._2016: MetricPattern4[T] = MetricPattern4(client, f'{base_path}_2016') + self._2017: MetricPattern4[T] = MetricPattern4(client, f'{base_path}_2017') + self._2018: MetricPattern4[T] = MetricPattern4(client, f'{base_path}_2018') + self._2019: MetricPattern4[T] = MetricPattern4(client, f'{base_path}_2019') + self._2020: MetricPattern4[T] = MetricPattern4(client, f'{base_path}_2020') + self._2021: MetricPattern4[T] = MetricPattern4(client, f'{base_path}_2021') + self._2022: MetricPattern4[T] = MetricPattern4(client, f'{base_path}_2022') + self._2023: MetricPattern4[T] = MetricPattern4(client, f'{base_path}_2023') + self._2024: MetricPattern4[T] = MetricPattern4(client, f'{base_path}_2024') + self._2025: MetricPattern4[T] = MetricPattern4(client, f'{base_path}_2025') + +class DollarsPattern(Generic[T]): + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self.average: MetricPattern2[T] = MetricPattern2(client, _m(acc, 'average')) + self.base: MetricPattern11[T] = MetricPattern11(client, acc) + self.cumulative: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'cumulative')) + self.max: MetricPattern2[T] = MetricPattern2(client, _m(acc, 'max')) + self.median: MetricPattern6[T] = MetricPattern6(client, _m(acc, 'median')) + self.min: MetricPattern2[T] = MetricPattern2(client, _m(acc, 'min')) + self.pct10: MetricPattern6[T] = MetricPattern6(client, _m(acc, 'pct10')) + self.pct25: MetricPattern6[T] = MetricPattern6(client, _m(acc, 'pct25')) + self.pct75: MetricPattern6[T] = MetricPattern6(client, _m(acc, 'pct75')) + self.pct90: MetricPattern6[T] = MetricPattern6(client, _m(acc, 'pct90')) + self.sum: MetricPattern2[T] = MetricPattern2(client, _m(acc, 'sum')) class RelativePattern2: """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.neg_unrealized_loss_rel_to_own_market_cap: MetricPattern1[StoredF32] = ( - MetricPattern1(client, _m(acc, "neg_unrealized_loss_rel_to_own_market_cap")) - ) - self.neg_unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1[ - StoredF32 - ] = MetricPattern1( - client, _m(acc, "neg_unrealized_loss_rel_to_own_total_unrealized_pnl") - ) - self.net_unrealized_pnl_rel_to_own_market_cap: MetricPattern1[StoredF32] = ( - MetricPattern1(client, _m(acc, "net_unrealized_pnl_rel_to_own_market_cap")) - ) - self.net_unrealized_pnl_rel_to_own_total_unrealized_pnl: MetricPattern1[ - StoredF32 - ] = MetricPattern1( - client, _m(acc, "net_unrealized_pnl_rel_to_own_total_unrealized_pnl") - ) - self.supply_in_loss_rel_to_own_supply: MetricPattern1[StoredF64] = ( - MetricPattern1(client, _m(acc, "supply_in_loss_rel_to_own_supply")) - ) - self.supply_in_profit_rel_to_own_supply: MetricPattern1[StoredF64] = ( - MetricPattern1(client, _m(acc, "supply_in_profit_rel_to_own_supply")) - ) - self.unrealized_loss_rel_to_own_market_cap: MetricPattern1[StoredF32] = ( - MetricPattern1(client, _m(acc, "unrealized_loss_rel_to_own_market_cap")) - ) - self.unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1[ - StoredF32 - ] = MetricPattern1( - client, _m(acc, "unrealized_loss_rel_to_own_total_unrealized_pnl") - ) - self.unrealized_profit_rel_to_own_market_cap: MetricPattern1[StoredF32] = ( - MetricPattern1(client, _m(acc, "unrealized_profit_rel_to_own_market_cap")) - ) - self.unrealized_profit_rel_to_own_total_unrealized_pnl: MetricPattern1[ - StoredF32 - ] = MetricPattern1( - client, _m(acc, "unrealized_profit_rel_to_own_total_unrealized_pnl") - ) - + self.neg_unrealized_loss_rel_to_own_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'neg_unrealized_loss_rel_to_own_market_cap')) + self.neg_unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'neg_unrealized_loss_rel_to_own_total_unrealized_pnl')) + self.net_unrealized_pnl_rel_to_own_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'net_unrealized_pnl_rel_to_own_market_cap')) + self.net_unrealized_pnl_rel_to_own_total_unrealized_pnl: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'net_unrealized_pnl_rel_to_own_total_unrealized_pnl')) + self.supply_in_loss_rel_to_own_supply: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'supply_in_loss_rel_to_own_supply')) + self.supply_in_profit_rel_to_own_supply: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'supply_in_profit_rel_to_own_supply')) + self.unrealized_loss_rel_to_own_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'unrealized_loss_rel_to_own_market_cap')) + self.unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'unrealized_loss_rel_to_own_total_unrealized_pnl')) + self.unrealized_profit_rel_to_own_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'unrealized_profit_rel_to_own_market_cap')) + self.unrealized_profit_rel_to_own_total_unrealized_pnl: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'unrealized_profit_rel_to_own_total_unrealized_pnl')) class RelativePattern: """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.neg_unrealized_loss_rel_to_market_cap: MetricPattern1[StoredF32] = ( - MetricPattern1(client, _m(acc, "neg_unrealized_loss_rel_to_market_cap")) - ) - self.net_unrealized_pnl_rel_to_market_cap: MetricPattern1[StoredF32] = ( - MetricPattern1(client, _m(acc, "net_unrealized_pnl_rel_to_market_cap")) - ) - self.nupl: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, "nupl")) - self.supply_in_loss_rel_to_circulating_supply: MetricPattern1[StoredF64] = ( - MetricPattern1(client, _m(acc, "supply_in_loss_rel_to_circulating_supply")) - ) - self.supply_in_loss_rel_to_own_supply: MetricPattern1[StoredF64] = ( - MetricPattern1(client, _m(acc, "supply_in_loss_rel_to_own_supply")) - ) - self.supply_in_profit_rel_to_circulating_supply: MetricPattern1[StoredF64] = ( - MetricPattern1( - client, _m(acc, "supply_in_profit_rel_to_circulating_supply") - ) - ) - self.supply_in_profit_rel_to_own_supply: MetricPattern1[StoredF64] = ( - MetricPattern1(client, _m(acc, "supply_in_profit_rel_to_own_supply")) - ) - self.supply_rel_to_circulating_supply: MetricPattern4[StoredF64] = ( - MetricPattern4(client, _m(acc, "supply_rel_to_circulating_supply")) - ) - self.unrealized_loss_rel_to_market_cap: MetricPattern1[StoredF32] = ( - MetricPattern1(client, _m(acc, "unrealized_loss_rel_to_market_cap")) - ) - self.unrealized_profit_rel_to_market_cap: MetricPattern1[StoredF32] = ( - MetricPattern1(client, _m(acc, "unrealized_profit_rel_to_market_cap")) - ) - + self.neg_unrealized_loss_rel_to_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'neg_unrealized_loss_rel_to_market_cap')) + self.net_unrealized_pnl_rel_to_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'net_unrealized_pnl_rel_to_market_cap')) + self.nupl: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'nupl')) + self.supply_in_loss_rel_to_circulating_supply: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'supply_in_loss_rel_to_circulating_supply')) + self.supply_in_loss_rel_to_own_supply: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'supply_in_loss_rel_to_own_supply')) + self.supply_in_profit_rel_to_circulating_supply: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'supply_in_profit_rel_to_circulating_supply')) + self.supply_in_profit_rel_to_own_supply: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'supply_in_profit_rel_to_own_supply')) + self.supply_rel_to_circulating_supply: MetricPattern4[StoredF64] = MetricPattern4(client, _m(acc, 'supply_rel_to_circulating_supply')) + self.unrealized_loss_rel_to_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'unrealized_loss_rel_to_market_cap')) + self.unrealized_profit_rel_to_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'unrealized_profit_rel_to_market_cap')) class CountPattern2(Generic[T]): """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.average: MetricPattern1[T] = MetricPattern1(client, _m(acc, "average")) - self.cumulative: MetricPattern1[T] = MetricPattern1( - client, _m(acc, "cumulative") - ) - self.max: MetricPattern1[T] = MetricPattern1(client, _m(acc, "max")) - self.median: MetricPattern11[T] = MetricPattern11(client, _m(acc, "median")) - self.min: MetricPattern1[T] = MetricPattern1(client, _m(acc, "min")) - self.pct10: MetricPattern11[T] = MetricPattern11(client, _m(acc, "pct10")) - self.pct25: MetricPattern11[T] = MetricPattern11(client, _m(acc, "pct25")) - self.pct75: MetricPattern11[T] = MetricPattern11(client, _m(acc, "pct75")) - self.pct90: MetricPattern11[T] = MetricPattern11(client, _m(acc, "pct90")) - self.sum: MetricPattern1[T] = MetricPattern1(client, _m(acc, "sum")) - + self.average: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'average')) + self.cumulative: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'cumulative')) + self.max: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'max')) + self.median: MetricPattern11[T] = MetricPattern11(client, _m(acc, 'median')) + self.min: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'min')) + self.pct10: MetricPattern11[T] = MetricPattern11(client, _m(acc, 'pct10')) + self.pct25: MetricPattern11[T] = MetricPattern11(client, _m(acc, 'pct25')) + self.pct75: MetricPattern11[T] = MetricPattern11(client, _m(acc, 'pct75')) + self.pct90: MetricPattern11[T] = MetricPattern11(client, _m(acc, 'pct90')) + self.sum: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'sum')) class AddrCountPattern: """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, base_path: str): - self.all: MetricPattern1[StoredU64] = MetricPattern1(client, f"{base_path}_all") - self.p2a: MetricPattern1[StoredU64] = MetricPattern1(client, f"{base_path}_p2a") - self.p2pk33: MetricPattern1[StoredU64] = MetricPattern1( - client, f"{base_path}_p2pk33" - ) - self.p2pk65: MetricPattern1[StoredU64] = MetricPattern1( - client, f"{base_path}_p2pk65" - ) - self.p2pkh: MetricPattern1[StoredU64] = MetricPattern1( - client, f"{base_path}_p2pkh" - ) - self.p2sh: MetricPattern1[StoredU64] = MetricPattern1( - client, f"{base_path}_p2sh" - ) - self.p2tr: MetricPattern1[StoredU64] = MetricPattern1( - client, f"{base_path}_p2tr" - ) - self.p2wpkh: MetricPattern1[StoredU64] = MetricPattern1( - client, f"{base_path}_p2wpkh" - ) - self.p2wsh: MetricPattern1[StoredU64] = MetricPattern1( - client, f"{base_path}_p2wsh" - ) - + self.all: MetricPattern1[StoredU64] = MetricPattern1(client, f'{base_path}_all') + self.p2a: MetricPattern1[StoredU64] = MetricPattern1(client, f'{base_path}_p2a') + self.p2pk33: MetricPattern1[StoredU64] = MetricPattern1(client, f'{base_path}_p2pk33') + self.p2pk65: MetricPattern1[StoredU64] = MetricPattern1(client, f'{base_path}_p2pk65') + self.p2pkh: MetricPattern1[StoredU64] = MetricPattern1(client, f'{base_path}_p2pkh') + self.p2sh: MetricPattern1[StoredU64] = MetricPattern1(client, f'{base_path}_p2sh') + self.p2tr: MetricPattern1[StoredU64] = MetricPattern1(client, f'{base_path}_p2tr') + self.p2wpkh: MetricPattern1[StoredU64] = MetricPattern1(client, f'{base_path}_p2wpkh') + self.p2wsh: MetricPattern1[StoredU64] = MetricPattern1(client, f'{base_path}_p2wsh') class FeeRatePattern(Generic[T]): """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.average: MetricPattern1[T] = MetricPattern1(client, _m(acc, "average")) - self.max: MetricPattern1[T] = MetricPattern1(client, _m(acc, "max")) - self.median: MetricPattern11[T] = MetricPattern11(client, _m(acc, "median")) - self.min: MetricPattern1[T] = MetricPattern1(client, _m(acc, "min")) - self.pct10: MetricPattern11[T] = MetricPattern11(client, _m(acc, "pct10")) - self.pct25: MetricPattern11[T] = MetricPattern11(client, _m(acc, "pct25")) - self.pct75: MetricPattern11[T] = MetricPattern11(client, _m(acc, "pct75")) - self.pct90: MetricPattern11[T] = MetricPattern11(client, _m(acc, "pct90")) + self.average: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'average')) + self.max: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'max')) + self.median: MetricPattern11[T] = MetricPattern11(client, _m(acc, 'median')) + self.min: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'min')) + self.pct10: MetricPattern11[T] = MetricPattern11(client, _m(acc, 'pct10')) + self.pct25: MetricPattern11[T] = MetricPattern11(client, _m(acc, 'pct25')) + self.pct75: MetricPattern11[T] = MetricPattern11(client, _m(acc, 'pct75')) + self.pct90: MetricPattern11[T] = MetricPattern11(client, _m(acc, 'pct90')) self.txindex: MetricPattern27[T] = MetricPattern27(client, acc) - class _0satsPattern: """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" self.activity: ActivityPattern2 = ActivityPattern2(client, acc) - self.addr_count: MetricPattern1[StoredU64] = MetricPattern1( - client, _m(acc, "addr_count") - ) + self.addr_count: MetricPattern1[StoredU64] = MetricPattern1(client, _m(acc, 'addr_count')) self.cost_basis: CostBasisPattern = CostBasisPattern(client, acc) self.outputs: OutputsPattern = OutputsPattern(client, acc) self.realized: RealizedPattern = RealizedPattern(client, acc) self.relative: RelativePattern = RelativePattern(client, acc) - self.supply: SupplyPattern2 = SupplyPattern2(client, _m(acc, "supply")) + self.supply: SupplyPattern2 = SupplyPattern2(client, _m(acc, 'supply')) self.unrealized: UnrealizedPattern = UnrealizedPattern(client, acc) - -class _0satsPattern2: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.activity: ActivityPattern2 = ActivityPattern2(client, acc) - self.cost_basis: CostBasisPattern = CostBasisPattern(client, acc) - self.outputs: OutputsPattern = OutputsPattern(client, acc) - self.realized: RealizedPattern = RealizedPattern(client, acc) - self.relative: RelativePattern4 = RelativePattern4(client, _m(acc, "supply_in")) - self.supply: SupplyPattern2 = SupplyPattern2(client, _m(acc, "supply")) - self.unrealized: UnrealizedPattern = UnrealizedPattern(client, acc) - - -class _100btcPattern: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.activity: ActivityPattern2 = ActivityPattern2(client, acc) - self.cost_basis: CostBasisPattern = CostBasisPattern(client, acc) - self.outputs: OutputsPattern = OutputsPattern(client, acc) - self.realized: RealizedPattern = RealizedPattern(client, acc) - self.relative: RelativePattern = RelativePattern(client, acc) - self.supply: SupplyPattern2 = SupplyPattern2(client, _m(acc, "supply")) - self.unrealized: UnrealizedPattern = UnrealizedPattern(client, acc) - - -class _10yPattern: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.activity: ActivityPattern2 = ActivityPattern2(client, acc) - self.cost_basis: CostBasisPattern = CostBasisPattern(client, acc) - self.outputs: OutputsPattern = OutputsPattern(client, acc) - self.realized: RealizedPattern4 = RealizedPattern4(client, acc) - self.relative: RelativePattern = RelativePattern(client, acc) - self.supply: SupplyPattern2 = SupplyPattern2(client, _m(acc, "supply")) - self.unrealized: UnrealizedPattern = UnrealizedPattern(client, acc) - - -class PeriodCagrPattern: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self._10y: MetricPattern4[StoredF32] = MetricPattern4( - client, (f"10y_{acc}" if acc else "10y") - ) - self._2y: MetricPattern4[StoredF32] = MetricPattern4( - client, (f"2y_{acc}" if acc else "2y") - ) - self._3y: MetricPattern4[StoredF32] = MetricPattern4( - client, (f"3y_{acc}" if acc else "3y") - ) - self._4y: MetricPattern4[StoredF32] = MetricPattern4( - client, (f"4y_{acc}" if acc else "4y") - ) - self._5y: MetricPattern4[StoredF32] = MetricPattern4( - client, (f"5y_{acc}" if acc else "5y") - ) - self._6y: MetricPattern4[StoredF32] = MetricPattern4( - client, (f"6y_{acc}" if acc else "6y") - ) - self._8y: MetricPattern4[StoredF32] = MetricPattern4( - client, (f"8y_{acc}" if acc else "8y") - ) - - class _10yTo12yPattern: """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" self.activity: ActivityPattern2 = ActivityPattern2(client, acc) @@ -3810,2812 +2688,1740 @@ class _10yTo12yPattern: self.outputs: OutputsPattern = OutputsPattern(client, acc) self.realized: RealizedPattern2 = RealizedPattern2(client, acc) self.relative: RelativePattern2 = RelativePattern2(client, acc) - self.supply: SupplyPattern2 = SupplyPattern2(client, _m(acc, "supply")) + self.supply: SupplyPattern2 = SupplyPattern2(client, _m(acc, 'supply')) self.unrealized: UnrealizedPattern = UnrealizedPattern(client, acc) +class _10yPattern: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self.activity: ActivityPattern2 = ActivityPattern2(client, acc) + self.cost_basis: CostBasisPattern = CostBasisPattern(client, acc) + self.outputs: OutputsPattern = OutputsPattern(client, acc) + self.realized: RealizedPattern4 = RealizedPattern4(client, acc) + self.relative: RelativePattern = RelativePattern(client, acc) + self.supply: SupplyPattern2 = SupplyPattern2(client, _m(acc, 'supply')) + self.unrealized: UnrealizedPattern = UnrealizedPattern(client, acc) class UnrealizedPattern: """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.neg_unrealized_loss: MetricPattern1[Dollars] = MetricPattern1( - client, _m(acc, "neg_unrealized_loss") - ) - self.net_unrealized_pnl: MetricPattern1[Dollars] = MetricPattern1( - client, _m(acc, "net_unrealized_pnl") - ) - self.supply_in_loss: ActiveSupplyPattern = ActiveSupplyPattern( - client, _m(acc, "supply_in_loss") - ) - self.supply_in_profit: ActiveSupplyPattern = ActiveSupplyPattern( - client, _m(acc, "supply_in_profit") - ) - self.total_unrealized_pnl: MetricPattern1[Dollars] = MetricPattern1( - client, _m(acc, "total_unrealized_pnl") - ) - self.unrealized_loss: MetricPattern1[Dollars] = MetricPattern1( - client, _m(acc, "unrealized_loss") - ) - self.unrealized_profit: MetricPattern1[Dollars] = MetricPattern1( - client, _m(acc, "unrealized_profit") - ) + self.neg_unrealized_loss: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'neg_unrealized_loss')) + self.net_unrealized_pnl: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'net_unrealized_pnl')) + self.supply_in_loss: ActiveSupplyPattern = ActiveSupplyPattern(client, _m(acc, 'supply_in_loss')) + self.supply_in_profit: ActiveSupplyPattern = ActiveSupplyPattern(client, _m(acc, 'supply_in_profit')) + self.total_unrealized_pnl: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'total_unrealized_pnl')) + self.unrealized_loss: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'unrealized_loss')) + self.unrealized_profit: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'unrealized_profit')) +class _0satsPattern2: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self.activity: ActivityPattern2 = ActivityPattern2(client, acc) + self.cost_basis: CostBasisPattern = CostBasisPattern(client, acc) + self.outputs: OutputsPattern = OutputsPattern(client, acc) + self.realized: RealizedPattern = RealizedPattern(client, acc) + self.relative: RelativePattern4 = RelativePattern4(client, _m(acc, 'supply_in')) + self.supply: SupplyPattern2 = SupplyPattern2(client, _m(acc, 'supply')) + self.unrealized: UnrealizedPattern = UnrealizedPattern(client, acc) + +class _100btcPattern: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self.activity: ActivityPattern2 = ActivityPattern2(client, acc) + self.cost_basis: CostBasisPattern = CostBasisPattern(client, acc) + self.outputs: OutputsPattern = OutputsPattern(client, acc) + self.realized: RealizedPattern = RealizedPattern(client, acc) + self.relative: RelativePattern = RelativePattern(client, acc) + self.supply: SupplyPattern2 = SupplyPattern2(client, _m(acc, 'supply')) + self.unrealized: UnrealizedPattern = UnrealizedPattern(client, acc) + +class PeriodCagrPattern: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self._10y: MetricPattern4[StoredF32] = MetricPattern4(client, (f'10y_{acc}' if acc else '10y')) + self._2y: MetricPattern4[StoredF32] = MetricPattern4(client, (f'2y_{acc}' if acc else '2y')) + self._3y: MetricPattern4[StoredF32] = MetricPattern4(client, (f'3y_{acc}' if acc else '3y')) + self._4y: MetricPattern4[StoredF32] = MetricPattern4(client, (f'4y_{acc}' if acc else '4y')) + self._5y: MetricPattern4[StoredF32] = MetricPattern4(client, (f'5y_{acc}' if acc else '5y')) + self._6y: MetricPattern4[StoredF32] = MetricPattern4(client, (f'6y_{acc}' if acc else '6y')) + self._8y: MetricPattern4[StoredF32] = MetricPattern4(client, (f'8y_{acc}' if acc else '8y')) class ActivityPattern2: """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.coinblocks_destroyed: BlockCountPattern[StoredF64] = BlockCountPattern( - client, _m(acc, "coinblocks_destroyed") - ) - self.coindays_destroyed: BlockCountPattern[StoredF64] = BlockCountPattern( - client, _m(acc, "coindays_destroyed") - ) - self.satblocks_destroyed: MetricPattern11[Sats] = MetricPattern11( - client, _m(acc, "satblocks_destroyed") - ) - self.satdays_destroyed: MetricPattern11[Sats] = MetricPattern11( - client, _m(acc, "satdays_destroyed") - ) - self.sent: UnclaimedRewardsPattern = UnclaimedRewardsPattern( - client, _m(acc, "sent") - ) - + self.coinblocks_destroyed: BlockCountPattern[StoredF64] = BlockCountPattern(client, _m(acc, 'coinblocks_destroyed')) + self.coindays_destroyed: BlockCountPattern[StoredF64] = BlockCountPattern(client, _m(acc, 'coindays_destroyed')) + self.satblocks_destroyed: MetricPattern11[Sats] = MetricPattern11(client, _m(acc, 'satblocks_destroyed')) + self.satdays_destroyed: MetricPattern11[Sats] = MetricPattern11(client, _m(acc, 'satdays_destroyed')) + self.sent: UnclaimedRewardsPattern = UnclaimedRewardsPattern(client, _m(acc, 'sent')) class SplitPattern2(Generic[T]): """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.close: MetricPattern1[T] = MetricPattern1(client, _m(acc, "close")) - self.high: MetricPattern1[T] = MetricPattern1(client, _m(acc, "high")) - self.low: MetricPattern1[T] = MetricPattern1(client, _m(acc, "low")) - self.open: MetricPattern1[T] = MetricPattern1(client, _m(acc, "open")) - - -class CostBasisPattern2: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClientBase, base_path: str): - self.max: MetricPattern1[Dollars] = MetricPattern1(client, f"{base_path}_max") - self.min: MetricPattern1[Dollars] = MetricPattern1(client, f"{base_path}_min") - self.percentiles: PercentilesPattern = PercentilesPattern( - client, f"{base_path}_percentiles" - ) - - -class ActiveSupplyPattern: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.bitcoin: MetricPattern1[Bitcoin] = MetricPattern1(client, _m(acc, "btc")) - self.dollars: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, "usd")) - self.sats: MetricPattern1[Sats] = MetricPattern1(client, acc) - - -class _2015Pattern: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.bitcoin: MetricPattern4[Bitcoin] = MetricPattern4(client, _m(acc, "btc")) - self.dollars: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, "usd")) - self.sats: MetricPattern4[Sats] = MetricPattern4(client, acc) - - -class CoinbasePattern2: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.bitcoin: BlockCountPattern[Bitcoin] = BlockCountPattern( - client, _m(acc, "btc") - ) - self.dollars: BlockCountPattern[Dollars] = BlockCountPattern( - client, _m(acc, "usd") - ) - self.sats: BlockCountPattern[Sats] = BlockCountPattern(client, acc) - - -class CoinbasePattern: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.bitcoin: FullnessPattern[Bitcoin] = FullnessPattern(client, _m(acc, "btc")) - self.dollars: DollarsPattern[Dollars] = DollarsPattern(client, _m(acc, "usd")) - self.sats: DollarsPattern[Sats] = DollarsPattern(client, acc) - - -class SegwitAdoptionPattern: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.base: MetricPattern11[StoredF32] = MetricPattern11(client, acc) - self.cumulative: MetricPattern2[StoredF32] = MetricPattern2( - client, _m(acc, "cumulative") - ) - self.sum: MetricPattern2[StoredF32] = MetricPattern2(client, _m(acc, "sum")) - + self.close: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'close')) + self.high: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'high')) + self.low: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'low')) + self.open: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'open')) class UnclaimedRewardsPattern: """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.bitcoin: BitcoinPattern[Bitcoin] = BitcoinPattern(client, _m(acc, "btc")) - self.dollars: BlockCountPattern[Dollars] = BlockCountPattern( - client, _m(acc, "usd") - ) + self.bitcoin: BitcoinPattern[Bitcoin] = BitcoinPattern(client, _m(acc, 'btc')) + self.dollars: BlockCountPattern[Dollars] = BlockCountPattern(client, _m(acc, 'usd')) self.sats: BlockCountPattern[Sats] = BlockCountPattern(client, acc) +class ActiveSupplyPattern: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self.bitcoin: MetricPattern1[Bitcoin] = MetricPattern1(client, _m(acc, 'btc')) + self.dollars: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'usd')) + self.sats: MetricPattern1[Sats] = MetricPattern1(client, acc) + +class CoinbasePattern: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self.bitcoin: FullnessPattern[Bitcoin] = FullnessPattern(client, _m(acc, 'btc')) + self.dollars: DollarsPattern[Dollars] = DollarsPattern(client, _m(acc, 'usd')) + self.sats: DollarsPattern[Sats] = DollarsPattern(client, acc) + +class SegwitAdoptionPattern: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self.base: MetricPattern11[StoredF32] = MetricPattern11(client, acc) + self.cumulative: MetricPattern2[StoredF32] = MetricPattern2(client, _m(acc, 'cumulative')) + self.sum: MetricPattern2[StoredF32] = MetricPattern2(client, _m(acc, 'sum')) + +class _2015Pattern: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self.bitcoin: MetricPattern4[Bitcoin] = MetricPattern4(client, _m(acc, 'btc')) + self.dollars: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'usd')) + self.sats: MetricPattern4[Sats] = MetricPattern4(client, acc) + +class CoinbasePattern2: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self.bitcoin: BlockCountPattern[Bitcoin] = BlockCountPattern(client, _m(acc, 'btc')) + self.dollars: BlockCountPattern[Dollars] = BlockCountPattern(client, _m(acc, 'usd')) + self.sats: BlockCountPattern[Sats] = BlockCountPattern(client, acc) + +class CostBasisPattern2: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, base_path: str): + self.max: MetricPattern1[Dollars] = MetricPattern1(client, f'{base_path}_max') + self.min: MetricPattern1[Dollars] = MetricPattern1(client, f'{base_path}_min') + self.percentiles: PercentilesPattern = PercentilesPattern(client, f'{base_path}_percentiles') class CostBasisPattern: """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.max: MetricPattern1[Dollars] = MetricPattern1( - client, _m(acc, "max_cost_basis") - ) - self.min: MetricPattern1[Dollars] = MetricPattern1( - client, _m(acc, "min_cost_basis") - ) - + self.max: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'max_cost_basis')) + self.min: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'min_cost_basis')) class _1dReturns1mSdPattern: """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.sd: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, "sd")) - self.sma: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, "sma")) - - -class RelativePattern4: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.supply_in_loss_rel_to_own_supply: MetricPattern1[StoredF64] = ( - MetricPattern1(client, _m(acc, "loss_rel_to_own_supply")) - ) - self.supply_in_profit_rel_to_own_supply: MetricPattern1[StoredF64] = ( - MetricPattern1(client, _m(acc, "profit_rel_to_own_supply")) - ) - + self.sd: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'sd')) + self.sma: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'sma')) class SupplyPattern2: """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.halved: ActiveSupplyPattern = ActiveSupplyPattern(client, _m(acc, "half")) + self.halved: ActiveSupplyPattern = ActiveSupplyPattern(client, _m(acc, 'half')) self.total: ActiveSupplyPattern = ActiveSupplyPattern(client, acc) - -class SatsPattern(Generic[T]): +class RelativePattern4: """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClientBase, base_path: str): - self.ohlc: MetricPattern1[T] = MetricPattern1(client, f"{base_path}_ohlc") - self.split: SplitPattern2[Any] = SplitPattern2(client, f"{base_path}_split") - + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self.supply_in_loss_rel_to_own_supply: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'loss_rel_to_own_supply')) + self.supply_in_profit_rel_to_own_supply: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'profit_rel_to_own_supply')) class BitcoinPattern(Generic[T]): """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.cumulative: MetricPattern2[T] = MetricPattern2( - client, _m(acc, "cumulative") - ) + self.cumulative: MetricPattern2[T] = MetricPattern2(client, _m(acc, 'cumulative')) self.sum: MetricPattern1[T] = MetricPattern1(client, acc) - class BlockCountPattern(Generic[T]): """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.cumulative: MetricPattern1[T] = MetricPattern1( - client, _m(acc, "cumulative") - ) + self.cumulative: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'cumulative')) self.sum: MetricPattern1[T] = MetricPattern1(client, acc) +class SatsPattern(Generic[T]): + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, base_path: str): + self.ohlc: MetricPattern1[T] = MetricPattern1(client, f'{base_path}_ohlc') + self.split: SplitPattern2[Any] = SplitPattern2(client, f'{base_path}_split') class RealizedPriceExtraPattern: """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.ratio: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, "ratio")) - + self.ratio: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'ratio')) class OutputsPattern: """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.utxo_count: MetricPattern1[StoredU64] = MetricPattern1( - client, _m(acc, "utxo_count") - ) - + self.utxo_count: MetricPattern1[StoredU64] = MetricPattern1(client, _m(acc, 'utxo_count')) # Metrics tree classes - class MetricsTree_Addresses: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.first_p2aaddressindex: MetricPattern11[P2AAddressIndex] = MetricPattern11( - client, "first_p2aaddressindex" - ) - self.first_p2pk33addressindex: MetricPattern11[P2PK33AddressIndex] = ( - MetricPattern11(client, "first_p2pk33addressindex") - ) - self.first_p2pk65addressindex: MetricPattern11[P2PK65AddressIndex] = ( - MetricPattern11(client, "first_p2pk65addressindex") - ) - self.first_p2pkhaddressindex: MetricPattern11[P2PKHAddressIndex] = ( - MetricPattern11(client, "first_p2pkhaddressindex") - ) - self.first_p2shaddressindex: MetricPattern11[P2SHAddressIndex] = ( - MetricPattern11(client, "first_p2shaddressindex") - ) - self.first_p2traddressindex: MetricPattern11[P2TRAddressIndex] = ( - MetricPattern11(client, "first_p2traddressindex") - ) - self.first_p2wpkhaddressindex: MetricPattern11[P2WPKHAddressIndex] = ( - MetricPattern11(client, "first_p2wpkhaddressindex") - ) - self.first_p2wshaddressindex: MetricPattern11[P2WSHAddressIndex] = ( - MetricPattern11(client, "first_p2wshaddressindex") - ) - self.p2abytes: MetricPattern16[P2ABytes] = MetricPattern16(client, "p2abytes") - self.p2pk33bytes: MetricPattern18[P2PK33Bytes] = MetricPattern18( - client, "p2pk33bytes" - ) - self.p2pk65bytes: MetricPattern19[P2PK65Bytes] = MetricPattern19( - client, "p2pk65bytes" - ) - self.p2pkhbytes: MetricPattern20[P2PKHBytes] = MetricPattern20( - client, "p2pkhbytes" - ) - self.p2shbytes: MetricPattern21[P2SHBytes] = MetricPattern21( - client, "p2shbytes" - ) - self.p2trbytes: MetricPattern22[P2TRBytes] = MetricPattern22( - client, "p2trbytes" - ) - self.p2wpkhbytes: MetricPattern23[P2WPKHBytes] = MetricPattern23( - client, "p2wpkhbytes" - ) - self.p2wshbytes: MetricPattern24[P2WSHBytes] = MetricPattern24( - client, "p2wshbytes" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.first_p2aaddressindex: MetricPattern11[P2AAddressIndex] = MetricPattern11(client, 'first_p2aaddressindex') + self.first_p2pk33addressindex: MetricPattern11[P2PK33AddressIndex] = MetricPattern11(client, 'first_p2pk33addressindex') + self.first_p2pk65addressindex: MetricPattern11[P2PK65AddressIndex] = MetricPattern11(client, 'first_p2pk65addressindex') + self.first_p2pkhaddressindex: MetricPattern11[P2PKHAddressIndex] = MetricPattern11(client, 'first_p2pkhaddressindex') + self.first_p2shaddressindex: MetricPattern11[P2SHAddressIndex] = MetricPattern11(client, 'first_p2shaddressindex') + self.first_p2traddressindex: MetricPattern11[P2TRAddressIndex] = MetricPattern11(client, 'first_p2traddressindex') + self.first_p2wpkhaddressindex: MetricPattern11[P2WPKHAddressIndex] = MetricPattern11(client, 'first_p2wpkhaddressindex') + self.first_p2wshaddressindex: MetricPattern11[P2WSHAddressIndex] = MetricPattern11(client, 'first_p2wshaddressindex') + self.p2abytes: MetricPattern16[P2ABytes] = MetricPattern16(client, 'p2abytes') + self.p2pk33bytes: MetricPattern18[P2PK33Bytes] = MetricPattern18(client, 'p2pk33bytes') + self.p2pk65bytes: MetricPattern19[P2PK65Bytes] = MetricPattern19(client, 'p2pk65bytes') + self.p2pkhbytes: MetricPattern20[P2PKHBytes] = MetricPattern20(client, 'p2pkhbytes') + self.p2shbytes: MetricPattern21[P2SHBytes] = MetricPattern21(client, 'p2shbytes') + self.p2trbytes: MetricPattern22[P2TRBytes] = MetricPattern22(client, 'p2trbytes') + self.p2wpkhbytes: MetricPattern23[P2WPKHBytes] = MetricPattern23(client, 'p2wpkhbytes') + self.p2wshbytes: MetricPattern24[P2WSHBytes] = MetricPattern24(client, 'p2wshbytes') class MetricsTree_Blocks_Count: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self._1m_block_count: MetricPattern1[StoredU32] = MetricPattern1( - client, "1m_block_count" - ) - self._1m_start: MetricPattern11[Height] = MetricPattern11(client, "1m_start") - self._1w_block_count: MetricPattern1[StoredU32] = MetricPattern1( - client, "1w_block_count" - ) - self._1w_start: MetricPattern11[Height] = MetricPattern11(client, "1w_start") - self._1y_block_count: MetricPattern1[StoredU32] = MetricPattern1( - client, "1y_block_count" - ) - self._1y_start: MetricPattern11[Height] = MetricPattern11(client, "1y_start") - self._24h_block_count: MetricPattern1[StoredU32] = MetricPattern1( - client, "24h_block_count" - ) - self._24h_start: MetricPattern11[Height] = MetricPattern11(client, "24h_start") - self.block_count: BlockCountPattern[StoredU32] = BlockCountPattern( - client, "block_count" - ) - self.block_count_target: MetricPattern4[StoredU64] = MetricPattern4( - client, "block_count_target" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self._1m_block_count: MetricPattern1[StoredU32] = MetricPattern1(client, '1m_block_count') + self._1m_start: MetricPattern11[Height] = MetricPattern11(client, '1m_start') + self._1w_block_count: MetricPattern1[StoredU32] = MetricPattern1(client, '1w_block_count') + self._1w_start: MetricPattern11[Height] = MetricPattern11(client, '1w_start') + self._1y_block_count: MetricPattern1[StoredU32] = MetricPattern1(client, '1y_block_count') + self._1y_start: MetricPattern11[Height] = MetricPattern11(client, '1y_start') + self._24h_block_count: MetricPattern1[StoredU32] = MetricPattern1(client, '24h_block_count') + self._24h_start: MetricPattern11[Height] = MetricPattern11(client, '24h_start') + self.block_count: BlockCountPattern[StoredU32] = BlockCountPattern(client, 'block_count') + self.block_count_target: MetricPattern4[StoredU64] = MetricPattern4(client, 'block_count_target') class MetricsTree_Blocks_Difficulty: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.adjustment: MetricPattern1[StoredF32] = MetricPattern1( - client, "difficulty_adjustment" - ) - self.as_hash: MetricPattern1[StoredF32] = MetricPattern1( - client, "difficulty_as_hash" - ) - self.blocks_before_next_adjustment: MetricPattern1[StoredU32] = MetricPattern1( - client, "blocks_before_next_difficulty_adjustment" - ) - self.days_before_next_adjustment: MetricPattern1[StoredF32] = MetricPattern1( - client, "days_before_next_difficulty_adjustment" - ) - self.epoch: MetricPattern4[DifficultyEpoch] = MetricPattern4( - client, "difficultyepoch" - ) - self.raw: MetricPattern1[StoredF64] = MetricPattern1(client, "difficulty") - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.adjustment: MetricPattern1[StoredF32] = MetricPattern1(client, 'difficulty_adjustment') + self.as_hash: MetricPattern1[StoredF32] = MetricPattern1(client, 'difficulty_as_hash') + self.blocks_before_next_adjustment: MetricPattern1[StoredU32] = MetricPattern1(client, 'blocks_before_next_difficulty_adjustment') + self.days_before_next_adjustment: MetricPattern1[StoredF32] = MetricPattern1(client, 'days_before_next_difficulty_adjustment') + self.epoch: MetricPattern4[DifficultyEpoch] = MetricPattern4(client, 'difficultyepoch') + self.raw: MetricPattern1[StoredF64] = MetricPattern1(client, 'difficulty') class MetricsTree_Blocks_Halving: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.blocks_before_next_halving: MetricPattern1[StoredU32] = MetricPattern1( - client, "blocks_before_next_halving" - ) - self.days_before_next_halving: MetricPattern1[StoredF32] = MetricPattern1( - client, "days_before_next_halving" - ) - self.epoch: MetricPattern4[HalvingEpoch] = MetricPattern4( - client, "halvingepoch" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.blocks_before_next_halving: MetricPattern1[StoredU32] = MetricPattern1(client, 'blocks_before_next_halving') + self.days_before_next_halving: MetricPattern1[StoredF32] = MetricPattern1(client, 'days_before_next_halving') + self.epoch: MetricPattern4[HalvingEpoch] = MetricPattern4(client, 'halvingepoch') class MetricsTree_Blocks_Interval: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.average: MetricPattern2[Timestamp] = MetricPattern2( - client, "block_interval_average" - ) - self.base: MetricPattern11[Timestamp] = MetricPattern11( - client, "block_interval" - ) - self.max: MetricPattern2[Timestamp] = MetricPattern2( - client, "block_interval_max" - ) - self.median: MetricPattern6[Timestamp] = MetricPattern6( - client, "block_interval_median" - ) - self.min: MetricPattern2[Timestamp] = MetricPattern2( - client, "block_interval_min" - ) - self.pct10: MetricPattern6[Timestamp] = MetricPattern6( - client, "block_interval_pct10" - ) - self.pct25: MetricPattern6[Timestamp] = MetricPattern6( - client, "block_interval_pct25" - ) - self.pct75: MetricPattern6[Timestamp] = MetricPattern6( - client, "block_interval_pct75" - ) - self.pct90: MetricPattern6[Timestamp] = MetricPattern6( - client, "block_interval_pct90" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.average: MetricPattern2[Timestamp] = MetricPattern2(client, 'block_interval_average') + self.base: MetricPattern11[Timestamp] = MetricPattern11(client, 'block_interval') + self.max: MetricPattern2[Timestamp] = MetricPattern2(client, 'block_interval_max') + self.median: MetricPattern6[Timestamp] = MetricPattern6(client, 'block_interval_median') + self.min: MetricPattern2[Timestamp] = MetricPattern2(client, 'block_interval_min') + self.pct10: MetricPattern6[Timestamp] = MetricPattern6(client, 'block_interval_pct10') + self.pct25: MetricPattern6[Timestamp] = MetricPattern6(client, 'block_interval_pct25') + self.pct75: MetricPattern6[Timestamp] = MetricPattern6(client, 'block_interval_pct75') + self.pct90: MetricPattern6[Timestamp] = MetricPattern6(client, 'block_interval_pct90') class MetricsTree_Blocks_Mining: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.hash_price_phs: MetricPattern1[StoredF32] = MetricPattern1( - client, "hash_price_phs" - ) - self.hash_price_phs_min: MetricPattern1[StoredF32] = MetricPattern1( - client, "hash_price_phs_min" - ) - self.hash_price_rebound: MetricPattern1[StoredF32] = MetricPattern1( - client, "hash_price_rebound" - ) - self.hash_price_ths: MetricPattern1[StoredF32] = MetricPattern1( - client, "hash_price_ths" - ) - self.hash_price_ths_min: MetricPattern1[StoredF32] = MetricPattern1( - client, "hash_price_ths_min" - ) - self.hash_rate: MetricPattern1[StoredF64] = MetricPattern1(client, "hash_rate") - self.hash_rate_1m_sma: MetricPattern4[StoredF32] = MetricPattern4( - client, "hash_rate_1m_sma" - ) - self.hash_rate_1w_sma: MetricPattern4[StoredF64] = MetricPattern4( - client, "hash_rate_1w_sma" - ) - self.hash_rate_1y_sma: MetricPattern4[StoredF32] = MetricPattern4( - client, "hash_rate_1y_sma" - ) - self.hash_rate_2m_sma: MetricPattern4[StoredF32] = MetricPattern4( - client, "hash_rate_2m_sma" - ) - self.hash_value_phs: MetricPattern1[StoredF32] = MetricPattern1( - client, "hash_value_phs" - ) - self.hash_value_phs_min: MetricPattern1[StoredF32] = MetricPattern1( - client, "hash_value_phs_min" - ) - self.hash_value_rebound: MetricPattern1[StoredF32] = MetricPattern1( - client, "hash_value_rebound" - ) - self.hash_value_ths: MetricPattern1[StoredF32] = MetricPattern1( - client, "hash_value_ths" - ) - self.hash_value_ths_min: MetricPattern1[StoredF32] = MetricPattern1( - client, "hash_value_ths_min" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.hash_price_phs: MetricPattern1[StoredF32] = MetricPattern1(client, 'hash_price_phs') + self.hash_price_phs_min: MetricPattern1[StoredF32] = MetricPattern1(client, 'hash_price_phs_min') + self.hash_price_rebound: MetricPattern1[StoredF32] = MetricPattern1(client, 'hash_price_rebound') + self.hash_price_ths: MetricPattern1[StoredF32] = MetricPattern1(client, 'hash_price_ths') + self.hash_price_ths_min: MetricPattern1[StoredF32] = MetricPattern1(client, 'hash_price_ths_min') + self.hash_rate: MetricPattern1[StoredF64] = MetricPattern1(client, 'hash_rate') + self.hash_rate_1m_sma: MetricPattern4[StoredF32] = MetricPattern4(client, 'hash_rate_1m_sma') + self.hash_rate_1w_sma: MetricPattern4[StoredF64] = MetricPattern4(client, 'hash_rate_1w_sma') + self.hash_rate_1y_sma: MetricPattern4[StoredF32] = MetricPattern4(client, 'hash_rate_1y_sma') + self.hash_rate_2m_sma: MetricPattern4[StoredF32] = MetricPattern4(client, 'hash_rate_2m_sma') + self.hash_value_phs: MetricPattern1[StoredF32] = MetricPattern1(client, 'hash_value_phs') + self.hash_value_phs_min: MetricPattern1[StoredF32] = MetricPattern1(client, 'hash_value_phs_min') + self.hash_value_rebound: MetricPattern1[StoredF32] = MetricPattern1(client, 'hash_value_rebound') + self.hash_value_ths: MetricPattern1[StoredF32] = MetricPattern1(client, 'hash_value_ths') + self.hash_value_ths_min: MetricPattern1[StoredF32] = MetricPattern1(client, 'hash_value_ths_min') class MetricsTree_Blocks_Rewards_24hCoinbaseSum: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.bitcoin: MetricPattern11[Bitcoin] = MetricPattern11( - client, "24h_coinbase_sum_btc" - ) - self.dollars: MetricPattern11[Dollars] = MetricPattern11( - client, "24h_coinbase_sum_usd" - ) - self.sats: MetricPattern11[Sats] = MetricPattern11(client, "24h_coinbase_sum") - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.bitcoin: MetricPattern11[Bitcoin] = MetricPattern11(client, '24h_coinbase_sum_btc') + self.dollars: MetricPattern11[Dollars] = MetricPattern11(client, '24h_coinbase_sum_usd') + self.sats: MetricPattern11[Sats] = MetricPattern11(client, '24h_coinbase_sum') class MetricsTree_Blocks_Rewards: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self._24h_coinbase_sum: MetricsTree_Blocks_Rewards_24hCoinbaseSum = ( - MetricsTree_Blocks_Rewards_24hCoinbaseSum(client) - ) - self.coinbase: CoinbasePattern = CoinbasePattern(client, "coinbase") - self.fee_dominance: MetricPattern6[StoredF32] = MetricPattern6( - client, "fee_dominance" - ) - self.subsidy: CoinbasePattern = CoinbasePattern(client, "subsidy") - self.subsidy_dominance: MetricPattern6[StoredF32] = MetricPattern6( - client, "subsidy_dominance" - ) - self.subsidy_usd_1y_sma: MetricPattern4[Dollars] = MetricPattern4( - client, "subsidy_usd_1y_sma" - ) - self.unclaimed_rewards: UnclaimedRewardsPattern = UnclaimedRewardsPattern( - client, "unclaimed_rewards" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self._24h_coinbase_sum: MetricsTree_Blocks_Rewards_24hCoinbaseSum = MetricsTree_Blocks_Rewards_24hCoinbaseSum(client) + self.coinbase: CoinbasePattern = CoinbasePattern(client, 'coinbase') + self.fee_dominance: MetricPattern6[StoredF32] = MetricPattern6(client, 'fee_dominance') + self.subsidy: CoinbasePattern = CoinbasePattern(client, 'subsidy') + self.subsidy_dominance: MetricPattern6[StoredF32] = MetricPattern6(client, 'subsidy_dominance') + self.subsidy_usd_1y_sma: MetricPattern4[Dollars] = MetricPattern4(client, 'subsidy_usd_1y_sma') + self.unclaimed_rewards: UnclaimedRewardsPattern = UnclaimedRewardsPattern(client, 'unclaimed_rewards') class MetricsTree_Blocks_Size: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.average: MetricPattern2[StoredU64] = MetricPattern2( - client, "block_size_average" - ) - self.cumulative: MetricPattern1[StoredU64] = MetricPattern1( - client, "block_size_cumulative" - ) - self.max: MetricPattern2[StoredU64] = MetricPattern2(client, "block_size_max") - self.median: MetricPattern6[StoredU64] = MetricPattern6( - client, "block_size_median" - ) - self.min: MetricPattern2[StoredU64] = MetricPattern2(client, "block_size_min") - self.pct10: MetricPattern6[StoredU64] = MetricPattern6( - client, "block_size_pct10" - ) - self.pct25: MetricPattern6[StoredU64] = MetricPattern6( - client, "block_size_pct25" - ) - self.pct75: MetricPattern6[StoredU64] = MetricPattern6( - client, "block_size_pct75" - ) - self.pct90: MetricPattern6[StoredU64] = MetricPattern6( - client, "block_size_pct90" - ) - self.sum: MetricPattern2[StoredU64] = MetricPattern2(client, "block_size_sum") - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.average: MetricPattern2[StoredU64] = MetricPattern2(client, 'block_size_average') + self.cumulative: MetricPattern1[StoredU64] = MetricPattern1(client, 'block_size_cumulative') + self.max: MetricPattern2[StoredU64] = MetricPattern2(client, 'block_size_max') + self.median: MetricPattern6[StoredU64] = MetricPattern6(client, 'block_size_median') + self.min: MetricPattern2[StoredU64] = MetricPattern2(client, 'block_size_min') + self.pct10: MetricPattern6[StoredU64] = MetricPattern6(client, 'block_size_pct10') + self.pct25: MetricPattern6[StoredU64] = MetricPattern6(client, 'block_size_pct25') + self.pct75: MetricPattern6[StoredU64] = MetricPattern6(client, 'block_size_pct75') + self.pct90: MetricPattern6[StoredU64] = MetricPattern6(client, 'block_size_pct90') + self.sum: MetricPattern2[StoredU64] = MetricPattern2(client, 'block_size_sum') class MetricsTree_Blocks_Time: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.date: MetricPattern11[Date] = MetricPattern11(client, "date") - self.date_fixed: MetricPattern11[Date] = MetricPattern11(client, "date_fixed") - self.timestamp: MetricPattern1[Timestamp] = MetricPattern1(client, "timestamp") - self.timestamp_fixed: MetricPattern11[Timestamp] = MetricPattern11( - client, "timestamp_fixed" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.date: MetricPattern11[Date] = MetricPattern11(client, 'date') + self.date_fixed: MetricPattern11[Date] = MetricPattern11(client, 'date_fixed') + self.timestamp: MetricPattern1[Timestamp] = MetricPattern1(client, 'timestamp') + self.timestamp_fixed: MetricPattern11[Timestamp] = MetricPattern11(client, 'timestamp_fixed') class MetricsTree_Blocks: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.blockhash: MetricPattern11[BlockHash] = MetricPattern11( - client, "blockhash" - ) + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.blockhash: MetricPattern11[BlockHash] = MetricPattern11(client, 'blockhash') self.count: MetricsTree_Blocks_Count = MetricsTree_Blocks_Count(client) - self.difficulty: MetricsTree_Blocks_Difficulty = MetricsTree_Blocks_Difficulty( - client - ) - self.fullness: FullnessPattern[StoredF32] = FullnessPattern( - client, "block_fullness" - ) + self.difficulty: MetricsTree_Blocks_Difficulty = MetricsTree_Blocks_Difficulty(client) + self.fullness: FullnessPattern[StoredF32] = FullnessPattern(client, 'block_fullness') self.halving: MetricsTree_Blocks_Halving = MetricsTree_Blocks_Halving(client) self.interval: MetricsTree_Blocks_Interval = MetricsTree_Blocks_Interval(client) self.mining: MetricsTree_Blocks_Mining = MetricsTree_Blocks_Mining(client) self.rewards: MetricsTree_Blocks_Rewards = MetricsTree_Blocks_Rewards(client) self.size: MetricsTree_Blocks_Size = MetricsTree_Blocks_Size(client) self.time: MetricsTree_Blocks_Time = MetricsTree_Blocks_Time(client) - self.total_size: MetricPattern11[StoredU64] = MetricPattern11( - client, "total_size" - ) - self.vbytes: DollarsPattern[StoredU64] = DollarsPattern(client, "block_vbytes") - self.weight: DollarsPattern[Weight] = DollarsPattern( - client, "block_weight_average" - ) - + self.total_size: MetricPattern11[StoredU64] = MetricPattern11(client, 'total_size') + self.vbytes: DollarsPattern[StoredU64] = DollarsPattern(client, 'block_vbytes') + self.weight: DollarsPattern[Weight] = DollarsPattern(client, 'block_weight_average') class MetricsTree_Cointime_Activity: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.activity_to_vaultedness_ratio: MetricPattern1[StoredF64] = MetricPattern1( - client, "activity_to_vaultedness_ratio" - ) - self.coinblocks_created: BlockCountPattern[StoredF64] = BlockCountPattern( - client, "coinblocks_created" - ) - self.coinblocks_stored: BlockCountPattern[StoredF64] = BlockCountPattern( - client, "coinblocks_stored" - ) - self.liveliness: MetricPattern1[StoredF64] = MetricPattern1( - client, "liveliness" - ) - self.vaultedness: MetricPattern1[StoredF64] = MetricPattern1( - client, "vaultedness" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.activity_to_vaultedness_ratio: MetricPattern1[StoredF64] = MetricPattern1(client, 'activity_to_vaultedness_ratio') + self.coinblocks_created: BlockCountPattern[StoredF64] = BlockCountPattern(client, 'coinblocks_created') + self.coinblocks_stored: BlockCountPattern[StoredF64] = BlockCountPattern(client, 'coinblocks_stored') + self.liveliness: MetricPattern1[StoredF64] = MetricPattern1(client, 'liveliness') + self.vaultedness: MetricPattern1[StoredF64] = MetricPattern1(client, 'vaultedness') class MetricsTree_Cointime_Adjusted: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.cointime_adj_inflation_rate: MetricPattern4[StoredF32] = MetricPattern4( - client, "cointime_adj_inflation_rate" - ) - self.cointime_adj_tx_btc_velocity: MetricPattern4[StoredF64] = MetricPattern4( - client, "cointime_adj_tx_btc_velocity" - ) - self.cointime_adj_tx_usd_velocity: MetricPattern4[StoredF64] = MetricPattern4( - client, "cointime_adj_tx_usd_velocity" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.cointime_adj_inflation_rate: MetricPattern4[StoredF32] = MetricPattern4(client, 'cointime_adj_inflation_rate') + self.cointime_adj_tx_btc_velocity: MetricPattern4[StoredF64] = MetricPattern4(client, 'cointime_adj_tx_btc_velocity') + self.cointime_adj_tx_usd_velocity: MetricPattern4[StoredF64] = MetricPattern4(client, 'cointime_adj_tx_usd_velocity') class MetricsTree_Cointime_Cap: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.active_cap: MetricPattern1[Dollars] = MetricPattern1(client, "active_cap") - self.cointime_cap: MetricPattern1[Dollars] = MetricPattern1( - client, "cointime_cap" - ) - self.investor_cap: MetricPattern1[Dollars] = MetricPattern1( - client, "investor_cap" - ) - self.thermo_cap: MetricPattern1[Dollars] = MetricPattern1(client, "thermo_cap") - self.vaulted_cap: MetricPattern1[Dollars] = MetricPattern1( - client, "vaulted_cap" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.active_cap: MetricPattern1[Dollars] = MetricPattern1(client, 'active_cap') + self.cointime_cap: MetricPattern1[Dollars] = MetricPattern1(client, 'cointime_cap') + self.investor_cap: MetricPattern1[Dollars] = MetricPattern1(client, 'investor_cap') + self.thermo_cap: MetricPattern1[Dollars] = MetricPattern1(client, 'thermo_cap') + self.vaulted_cap: MetricPattern1[Dollars] = MetricPattern1(client, 'vaulted_cap') class MetricsTree_Cointime_Pricing: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.active_price: MetricPattern1[Dollars] = MetricPattern1( - client, "active_price" - ) - self.active_price_ratio: ActivePriceRatioPattern = ActivePriceRatioPattern( - client, "active_price_ratio" - ) - self.cointime_price: MetricPattern1[Dollars] = MetricPattern1( - client, "cointime_price" - ) - self.cointime_price_ratio: ActivePriceRatioPattern = ActivePriceRatioPattern( - client, "cointime_price_ratio" - ) - self.true_market_mean: MetricPattern1[Dollars] = MetricPattern1( - client, "true_market_mean" - ) - self.true_market_mean_ratio: ActivePriceRatioPattern = ActivePriceRatioPattern( - client, "true_market_mean_ratio" - ) - self.vaulted_price: MetricPattern1[Dollars] = MetricPattern1( - client, "vaulted_price" - ) - self.vaulted_price_ratio: ActivePriceRatioPattern = ActivePriceRatioPattern( - client, "vaulted_price_ratio" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.active_price: MetricPattern1[Dollars] = MetricPattern1(client, 'active_price') + self.active_price_ratio: ActivePriceRatioPattern = ActivePriceRatioPattern(client, 'active_price_ratio') + self.cointime_price: MetricPattern1[Dollars] = MetricPattern1(client, 'cointime_price') + self.cointime_price_ratio: ActivePriceRatioPattern = ActivePriceRatioPattern(client, 'cointime_price_ratio') + self.true_market_mean: MetricPattern1[Dollars] = MetricPattern1(client, 'true_market_mean') + self.true_market_mean_ratio: ActivePriceRatioPattern = ActivePriceRatioPattern(client, 'true_market_mean_ratio') + self.vaulted_price: MetricPattern1[Dollars] = MetricPattern1(client, 'vaulted_price') + self.vaulted_price_ratio: ActivePriceRatioPattern = ActivePriceRatioPattern(client, 'vaulted_price_ratio') class MetricsTree_Cointime_Supply: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.active_supply: ActiveSupplyPattern = ActiveSupplyPattern( - client, "active_supply" - ) - self.vaulted_supply: ActiveSupplyPattern = ActiveSupplyPattern( - client, "vaulted_supply" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.active_supply: ActiveSupplyPattern = ActiveSupplyPattern(client, 'active_supply') + self.vaulted_supply: ActiveSupplyPattern = ActiveSupplyPattern(client, 'vaulted_supply') class MetricsTree_Cointime_Value: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.cointime_value_created: BlockCountPattern[StoredF64] = BlockCountPattern( - client, "cointime_value_created" - ) - self.cointime_value_destroyed: BlockCountPattern[StoredF64] = BlockCountPattern( - client, "cointime_value_destroyed" - ) - self.cointime_value_stored: BlockCountPattern[StoredF64] = BlockCountPattern( - client, "cointime_value_stored" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.cointime_value_created: BlockCountPattern[StoredF64] = BlockCountPattern(client, 'cointime_value_created') + self.cointime_value_destroyed: BlockCountPattern[StoredF64] = BlockCountPattern(client, 'cointime_value_destroyed') + self.cointime_value_stored: BlockCountPattern[StoredF64] = BlockCountPattern(client, 'cointime_value_stored') class MetricsTree_Cointime: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.activity: MetricsTree_Cointime_Activity = MetricsTree_Cointime_Activity( - client - ) - self.adjusted: MetricsTree_Cointime_Adjusted = MetricsTree_Cointime_Adjusted( - client - ) + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.activity: MetricsTree_Cointime_Activity = MetricsTree_Cointime_Activity(client) + self.adjusted: MetricsTree_Cointime_Adjusted = MetricsTree_Cointime_Adjusted(client) self.cap: MetricsTree_Cointime_Cap = MetricsTree_Cointime_Cap(client) - self.pricing: MetricsTree_Cointime_Pricing = MetricsTree_Cointime_Pricing( - client - ) + self.pricing: MetricsTree_Cointime_Pricing = MetricsTree_Cointime_Pricing(client) self.supply: MetricsTree_Cointime_Supply = MetricsTree_Cointime_Supply(client) self.value: MetricsTree_Cointime_Value = MetricsTree_Cointime_Value(client) - class MetricsTree_Constants: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.constant_0: MetricPattern1[StoredU16] = MetricPattern1( - client, "constant_0" - ) - self.constant_1: MetricPattern1[StoredU16] = MetricPattern1( - client, "constant_1" - ) - self.constant_100: MetricPattern1[StoredU16] = MetricPattern1( - client, "constant_100" - ) - self.constant_2: MetricPattern1[StoredU16] = MetricPattern1( - client, "constant_2" - ) - self.constant_20: MetricPattern1[StoredU16] = MetricPattern1( - client, "constant_20" - ) - self.constant_3: MetricPattern1[StoredU16] = MetricPattern1( - client, "constant_3" - ) - self.constant_30: MetricPattern1[StoredU16] = MetricPattern1( - client, "constant_30" - ) - self.constant_38_2: MetricPattern1[StoredF32] = MetricPattern1( - client, "constant_38_2" - ) - self.constant_4: MetricPattern1[StoredU16] = MetricPattern1( - client, "constant_4" - ) - self.constant_50: MetricPattern1[StoredU16] = MetricPattern1( - client, "constant_50" - ) - self.constant_600: MetricPattern1[StoredU16] = MetricPattern1( - client, "constant_600" - ) - self.constant_61_8: MetricPattern1[StoredF32] = MetricPattern1( - client, "constant_61_8" - ) - self.constant_70: MetricPattern1[StoredU16] = MetricPattern1( - client, "constant_70" - ) - self.constant_80: MetricPattern1[StoredU16] = MetricPattern1( - client, "constant_80" - ) - self.constant_minus_1: MetricPattern1[StoredI16] = MetricPattern1( - client, "constant_minus_1" - ) - self.constant_minus_2: MetricPattern1[StoredI16] = MetricPattern1( - client, "constant_minus_2" - ) - self.constant_minus_3: MetricPattern1[StoredI16] = MetricPattern1( - client, "constant_minus_3" - ) - self.constant_minus_4: MetricPattern1[StoredI16] = MetricPattern1( - client, "constant_minus_4" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.constant_0: MetricPattern1[StoredU16] = MetricPattern1(client, 'constant_0') + self.constant_1: MetricPattern1[StoredU16] = MetricPattern1(client, 'constant_1') + self.constant_100: MetricPattern1[StoredU16] = MetricPattern1(client, 'constant_100') + self.constant_2: MetricPattern1[StoredU16] = MetricPattern1(client, 'constant_2') + self.constant_20: MetricPattern1[StoredU16] = MetricPattern1(client, 'constant_20') + self.constant_3: MetricPattern1[StoredU16] = MetricPattern1(client, 'constant_3') + self.constant_30: MetricPattern1[StoredU16] = MetricPattern1(client, 'constant_30') + self.constant_38_2: MetricPattern1[StoredF32] = MetricPattern1(client, 'constant_38_2') + self.constant_4: MetricPattern1[StoredU16] = MetricPattern1(client, 'constant_4') + self.constant_50: MetricPattern1[StoredU16] = MetricPattern1(client, 'constant_50') + self.constant_600: MetricPattern1[StoredU16] = MetricPattern1(client, 'constant_600') + self.constant_61_8: MetricPattern1[StoredF32] = MetricPattern1(client, 'constant_61_8') + self.constant_70: MetricPattern1[StoredU16] = MetricPattern1(client, 'constant_70') + self.constant_80: MetricPattern1[StoredU16] = MetricPattern1(client, 'constant_80') + self.constant_minus_1: MetricPattern1[StoredI16] = MetricPattern1(client, 'constant_minus_1') + self.constant_minus_2: MetricPattern1[StoredI16] = MetricPattern1(client, 'constant_minus_2') + self.constant_minus_3: MetricPattern1[StoredI16] = MetricPattern1(client, 'constant_minus_3') + self.constant_minus_4: MetricPattern1[StoredI16] = MetricPattern1(client, 'constant_minus_4') class MetricsTree_Distribution_AddrCount: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.all: MetricPattern1[StoredU64] = MetricPattern1(client, "addr_count") - self.p2a: MetricPattern1[StoredU64] = MetricPattern1(client, "p2a_addr_count") - self.p2pk33: MetricPattern1[StoredU64] = MetricPattern1( - client, "p2pk33_addr_count" - ) - self.p2pk65: MetricPattern1[StoredU64] = MetricPattern1( - client, "p2pk65_addr_count" - ) - self.p2pkh: MetricPattern1[StoredU64] = MetricPattern1( - client, "p2pkh_addr_count" - ) - self.p2sh: MetricPattern1[StoredU64] = MetricPattern1(client, "p2sh_addr_count") - self.p2tr: MetricPattern1[StoredU64] = MetricPattern1(client, "p2tr_addr_count") - self.p2wpkh: MetricPattern1[StoredU64] = MetricPattern1( - client, "p2wpkh_addr_count" - ) - self.p2wsh: MetricPattern1[StoredU64] = MetricPattern1( - client, "p2wsh_addr_count" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.all: MetricPattern1[StoredU64] = MetricPattern1(client, 'addr_count') + self.p2a: MetricPattern1[StoredU64] = MetricPattern1(client, 'p2a_addr_count') + self.p2pk33: MetricPattern1[StoredU64] = MetricPattern1(client, 'p2pk33_addr_count') + self.p2pk65: MetricPattern1[StoredU64] = MetricPattern1(client, 'p2pk65_addr_count') + self.p2pkh: MetricPattern1[StoredU64] = MetricPattern1(client, 'p2pkh_addr_count') + self.p2sh: MetricPattern1[StoredU64] = MetricPattern1(client, 'p2sh_addr_count') + self.p2tr: MetricPattern1[StoredU64] = MetricPattern1(client, 'p2tr_addr_count') + self.p2wpkh: MetricPattern1[StoredU64] = MetricPattern1(client, 'p2wpkh_addr_count') + self.p2wsh: MetricPattern1[StoredU64] = MetricPattern1(client, 'p2wsh_addr_count') class MetricsTree_Distribution_AddressCohorts_AmountRange: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self._0sats: _0satsPattern = _0satsPattern(client, "addrs_with_0sats") - self._100btc_to_1k_btc: _0satsPattern = _0satsPattern( - client, "addrs_above_100btc_under_1k_btc" - ) - self._100k_btc_or_more: _0satsPattern = _0satsPattern( - client, "addrs_above_100k_btc" - ) - self._100k_sats_to_1m_sats: _0satsPattern = _0satsPattern( - client, "addrs_above_100k_sats_under_1m_sats" - ) - self._100sats_to_1k_sats: _0satsPattern = _0satsPattern( - client, "addrs_above_100sats_under_1k_sats" - ) - self._10btc_to_100btc: _0satsPattern = _0satsPattern( - client, "addrs_above_10btc_under_100btc" - ) - self._10k_btc_to_100k_btc: _0satsPattern = _0satsPattern( - client, "addrs_above_10k_btc_under_100k_btc" - ) - self._10k_sats_to_100k_sats: _0satsPattern = _0satsPattern( - client, "addrs_above_10k_sats_under_100k_sats" - ) - self._10m_sats_to_1btc: _0satsPattern = _0satsPattern( - client, "addrs_above_10m_sats_under_1btc" - ) - self._10sats_to_100sats: _0satsPattern = _0satsPattern( - client, "addrs_above_10sats_under_100sats" - ) - self._1btc_to_10btc: _0satsPattern = _0satsPattern( - client, "addrs_above_1btc_under_10btc" - ) - self._1k_btc_to_10k_btc: _0satsPattern = _0satsPattern( - client, "addrs_above_1k_btc_under_10k_btc" - ) - self._1k_sats_to_10k_sats: _0satsPattern = _0satsPattern( - client, "addrs_above_1k_sats_under_10k_sats" - ) - self._1m_sats_to_10m_sats: _0satsPattern = _0satsPattern( - client, "addrs_above_1m_sats_under_10m_sats" - ) - self._1sat_to_10sats: _0satsPattern = _0satsPattern( - client, "addrs_above_1sat_under_10sats" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self._0sats: _0satsPattern = _0satsPattern(client, 'addrs_with_0sats') + self._100btc_to_1k_btc: _0satsPattern = _0satsPattern(client, 'addrs_above_100btc_under_1k_btc') + self._100k_btc_or_more: _0satsPattern = _0satsPattern(client, 'addrs_above_100k_btc') + self._100k_sats_to_1m_sats: _0satsPattern = _0satsPattern(client, 'addrs_above_100k_sats_under_1m_sats') + self._100sats_to_1k_sats: _0satsPattern = _0satsPattern(client, 'addrs_above_100sats_under_1k_sats') + self._10btc_to_100btc: _0satsPattern = _0satsPattern(client, 'addrs_above_10btc_under_100btc') + self._10k_btc_to_100k_btc: _0satsPattern = _0satsPattern(client, 'addrs_above_10k_btc_under_100k_btc') + self._10k_sats_to_100k_sats: _0satsPattern = _0satsPattern(client, 'addrs_above_10k_sats_under_100k_sats') + self._10m_sats_to_1btc: _0satsPattern = _0satsPattern(client, 'addrs_above_10m_sats_under_1btc') + self._10sats_to_100sats: _0satsPattern = _0satsPattern(client, 'addrs_above_10sats_under_100sats') + self._1btc_to_10btc: _0satsPattern = _0satsPattern(client, 'addrs_above_1btc_under_10btc') + self._1k_btc_to_10k_btc: _0satsPattern = _0satsPattern(client, 'addrs_above_1k_btc_under_10k_btc') + self._1k_sats_to_10k_sats: _0satsPattern = _0satsPattern(client, 'addrs_above_1k_sats_under_10k_sats') + self._1m_sats_to_10m_sats: _0satsPattern = _0satsPattern(client, 'addrs_above_1m_sats_under_10m_sats') + self._1sat_to_10sats: _0satsPattern = _0satsPattern(client, 'addrs_above_1sat_under_10sats') class MetricsTree_Distribution_AddressCohorts_GeAmount: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self._100btc: _0satsPattern = _0satsPattern(client, "addrs_above_100btc") - self._100k_sats: _0satsPattern = _0satsPattern(client, "addrs_above_100k_sats") - self._100sats: _0satsPattern = _0satsPattern(client, "addrs_above_100sats") - self._10btc: _0satsPattern = _0satsPattern(client, "addrs_above_10btc") - self._10k_btc: _0satsPattern = _0satsPattern(client, "addrs_above_10k_btc") - self._10k_sats: _0satsPattern = _0satsPattern(client, "addrs_above_10k_sats") - self._10m_sats: _0satsPattern = _0satsPattern(client, "addrs_above_10m_sats") - self._10sats: _0satsPattern = _0satsPattern(client, "addrs_above_10sats") - self._1btc: _0satsPattern = _0satsPattern(client, "addrs_above_1btc") - self._1k_btc: _0satsPattern = _0satsPattern(client, "addrs_above_1k_btc") - self._1k_sats: _0satsPattern = _0satsPattern(client, "addrs_above_1k_sats") - self._1m_sats: _0satsPattern = _0satsPattern(client, "addrs_above_1m_sats") - self._1sat: _0satsPattern = _0satsPattern(client, "addrs_above_1sat") - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self._100btc: _0satsPattern = _0satsPattern(client, 'addrs_above_100btc') + self._100k_sats: _0satsPattern = _0satsPattern(client, 'addrs_above_100k_sats') + self._100sats: _0satsPattern = _0satsPattern(client, 'addrs_above_100sats') + self._10btc: _0satsPattern = _0satsPattern(client, 'addrs_above_10btc') + self._10k_btc: _0satsPattern = _0satsPattern(client, 'addrs_above_10k_btc') + self._10k_sats: _0satsPattern = _0satsPattern(client, 'addrs_above_10k_sats') + self._10m_sats: _0satsPattern = _0satsPattern(client, 'addrs_above_10m_sats') + self._10sats: _0satsPattern = _0satsPattern(client, 'addrs_above_10sats') + self._1btc: _0satsPattern = _0satsPattern(client, 'addrs_above_1btc') + self._1k_btc: _0satsPattern = _0satsPattern(client, 'addrs_above_1k_btc') + self._1k_sats: _0satsPattern = _0satsPattern(client, 'addrs_above_1k_sats') + self._1m_sats: _0satsPattern = _0satsPattern(client, 'addrs_above_1m_sats') + self._1sat: _0satsPattern = _0satsPattern(client, 'addrs_above_1sat') class MetricsTree_Distribution_AddressCohorts_LtAmount: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self._100btc: _0satsPattern = _0satsPattern(client, "addrs_under_100btc") - self._100k_btc: _0satsPattern = _0satsPattern(client, "addrs_under_100k_btc") - self._100k_sats: _0satsPattern = _0satsPattern(client, "addrs_under_100k_sats") - self._100sats: _0satsPattern = _0satsPattern(client, "addrs_under_100sats") - self._10btc: _0satsPattern = _0satsPattern(client, "addrs_under_10btc") - self._10k_btc: _0satsPattern = _0satsPattern(client, "addrs_under_10k_btc") - self._10k_sats: _0satsPattern = _0satsPattern(client, "addrs_under_10k_sats") - self._10m_sats: _0satsPattern = _0satsPattern(client, "addrs_under_10m_sats") - self._10sats: _0satsPattern = _0satsPattern(client, "addrs_under_10sats") - self._1btc: _0satsPattern = _0satsPattern(client, "addrs_under_1btc") - self._1k_btc: _0satsPattern = _0satsPattern(client, "addrs_under_1k_btc") - self._1k_sats: _0satsPattern = _0satsPattern(client, "addrs_under_1k_sats") - self._1m_sats: _0satsPattern = _0satsPattern(client, "addrs_under_1m_sats") - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self._100btc: _0satsPattern = _0satsPattern(client, 'addrs_under_100btc') + self._100k_btc: _0satsPattern = _0satsPattern(client, 'addrs_under_100k_btc') + self._100k_sats: _0satsPattern = _0satsPattern(client, 'addrs_under_100k_sats') + self._100sats: _0satsPattern = _0satsPattern(client, 'addrs_under_100sats') + self._10btc: _0satsPattern = _0satsPattern(client, 'addrs_under_10btc') + self._10k_btc: _0satsPattern = _0satsPattern(client, 'addrs_under_10k_btc') + self._10k_sats: _0satsPattern = _0satsPattern(client, 'addrs_under_10k_sats') + self._10m_sats: _0satsPattern = _0satsPattern(client, 'addrs_under_10m_sats') + self._10sats: _0satsPattern = _0satsPattern(client, 'addrs_under_10sats') + self._1btc: _0satsPattern = _0satsPattern(client, 'addrs_under_1btc') + self._1k_btc: _0satsPattern = _0satsPattern(client, 'addrs_under_1k_btc') + self._1k_sats: _0satsPattern = _0satsPattern(client, 'addrs_under_1k_sats') + self._1m_sats: _0satsPattern = _0satsPattern(client, 'addrs_under_1m_sats') class MetricsTree_Distribution_AddressCohorts: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.amount_range: MetricsTree_Distribution_AddressCohorts_AmountRange = ( - MetricsTree_Distribution_AddressCohorts_AmountRange(client) - ) - self.ge_amount: MetricsTree_Distribution_AddressCohorts_GeAmount = ( - MetricsTree_Distribution_AddressCohorts_GeAmount(client) - ) - self.lt_amount: MetricsTree_Distribution_AddressCohorts_LtAmount = ( - MetricsTree_Distribution_AddressCohorts_LtAmount(client) - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.amount_range: MetricsTree_Distribution_AddressCohorts_AmountRange = MetricsTree_Distribution_AddressCohorts_AmountRange(client) + self.ge_amount: MetricsTree_Distribution_AddressCohorts_GeAmount = MetricsTree_Distribution_AddressCohorts_GeAmount(client) + self.lt_amount: MetricsTree_Distribution_AddressCohorts_LtAmount = MetricsTree_Distribution_AddressCohorts_LtAmount(client) class MetricsTree_Distribution_AddressesData: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.empty: MetricPattern32[EmptyAddressData] = MetricPattern32( - client, "emptyaddressdata" - ) - self.loaded: MetricPattern31[LoadedAddressData] = MetricPattern31( - client, "loadedaddressdata" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.empty: MetricPattern32[EmptyAddressData] = MetricPattern32(client, 'emptyaddressdata') + self.loaded: MetricPattern31[LoadedAddressData] = MetricPattern31(client, 'loadedaddressdata') class MetricsTree_Distribution_AnyAddressIndexes: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.p2a: MetricPattern16[AnyAddressIndex] = MetricPattern16( - client, "anyaddressindex" - ) - self.p2pk33: MetricPattern18[AnyAddressIndex] = MetricPattern18( - client, "anyaddressindex" - ) - self.p2pk65: MetricPattern19[AnyAddressIndex] = MetricPattern19( - client, "anyaddressindex" - ) - self.p2pkh: MetricPattern20[AnyAddressIndex] = MetricPattern20( - client, "anyaddressindex" - ) - self.p2sh: MetricPattern21[AnyAddressIndex] = MetricPattern21( - client, "anyaddressindex" - ) - self.p2tr: MetricPattern22[AnyAddressIndex] = MetricPattern22( - client, "anyaddressindex" - ) - self.p2wpkh: MetricPattern23[AnyAddressIndex] = MetricPattern23( - client, "anyaddressindex" - ) - self.p2wsh: MetricPattern24[AnyAddressIndex] = MetricPattern24( - client, "anyaddressindex" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.p2a: MetricPattern16[AnyAddressIndex] = MetricPattern16(client, 'anyaddressindex') + self.p2pk33: MetricPattern18[AnyAddressIndex] = MetricPattern18(client, 'anyaddressindex') + self.p2pk65: MetricPattern19[AnyAddressIndex] = MetricPattern19(client, 'anyaddressindex') + self.p2pkh: MetricPattern20[AnyAddressIndex] = MetricPattern20(client, 'anyaddressindex') + self.p2sh: MetricPattern21[AnyAddressIndex] = MetricPattern21(client, 'anyaddressindex') + self.p2tr: MetricPattern22[AnyAddressIndex] = MetricPattern22(client, 'anyaddressindex') + self.p2wpkh: MetricPattern23[AnyAddressIndex] = MetricPattern23(client, 'anyaddressindex') + self.p2wsh: MetricPattern24[AnyAddressIndex] = MetricPattern24(client, 'anyaddressindex') class MetricsTree_Distribution_EmptyAddrCount: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.all: MetricPattern1[StoredU64] = MetricPattern1(client, "empty_addr_count") - self.p2a: MetricPattern1[StoredU64] = MetricPattern1( - client, "p2a_empty_addr_count" - ) - self.p2pk33: MetricPattern1[StoredU64] = MetricPattern1( - client, "p2pk33_empty_addr_count" - ) - self.p2pk65: MetricPattern1[StoredU64] = MetricPattern1( - client, "p2pk65_empty_addr_count" - ) - self.p2pkh: MetricPattern1[StoredU64] = MetricPattern1( - client, "p2pkh_empty_addr_count" - ) - self.p2sh: MetricPattern1[StoredU64] = MetricPattern1( - client, "p2sh_empty_addr_count" - ) - self.p2tr: MetricPattern1[StoredU64] = MetricPattern1( - client, "p2tr_empty_addr_count" - ) - self.p2wpkh: MetricPattern1[StoredU64] = MetricPattern1( - client, "p2wpkh_empty_addr_count" - ) - self.p2wsh: MetricPattern1[StoredU64] = MetricPattern1( - client, "p2wsh_empty_addr_count" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.all: MetricPattern1[StoredU64] = MetricPattern1(client, 'empty_addr_count') + self.p2a: MetricPattern1[StoredU64] = MetricPattern1(client, 'p2a_empty_addr_count') + self.p2pk33: MetricPattern1[StoredU64] = MetricPattern1(client, 'p2pk33_empty_addr_count') + self.p2pk65: MetricPattern1[StoredU64] = MetricPattern1(client, 'p2pk65_empty_addr_count') + self.p2pkh: MetricPattern1[StoredU64] = MetricPattern1(client, 'p2pkh_empty_addr_count') + self.p2sh: MetricPattern1[StoredU64] = MetricPattern1(client, 'p2sh_empty_addr_count') + self.p2tr: MetricPattern1[StoredU64] = MetricPattern1(client, 'p2tr_empty_addr_count') + self.p2wpkh: MetricPattern1[StoredU64] = MetricPattern1(client, 'p2wpkh_empty_addr_count') + self.p2wsh: MetricPattern1[StoredU64] = MetricPattern1(client, 'p2wsh_empty_addr_count') class MetricsTree_Distribution_UtxoCohorts_AgeRange: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self._10y_to_12y: _10yTo12yPattern = _10yTo12yPattern( - client, "utxos_at_least_10y_up_to_12y_old" - ) - self._12y_to_15y: _10yTo12yPattern = _10yTo12yPattern( - client, "utxos_at_least_12y_up_to_15y_old" - ) - self._1d_to_1w: _10yTo12yPattern = _10yTo12yPattern( - client, "utxos_at_least_1d_up_to_1w_old" - ) - self._1h_to_1d: _10yTo12yPattern = _10yTo12yPattern( - client, "utxos_at_least_1h_up_to_1d_old" - ) - self._1m_to_2m: _10yTo12yPattern = _10yTo12yPattern( - client, "utxos_at_least_1m_up_to_2m_old" - ) - self._1w_to_1m: _10yTo12yPattern = _10yTo12yPattern( - client, "utxos_at_least_1w_up_to_1m_old" - ) - self._1y_to_2y: _10yTo12yPattern = _10yTo12yPattern( - client, "utxos_at_least_1y_up_to_2y_old" - ) - self._2m_to_3m: _10yTo12yPattern = _10yTo12yPattern( - client, "utxos_at_least_2m_up_to_3m_old" - ) - self._2y_to_3y: _10yTo12yPattern = _10yTo12yPattern( - client, "utxos_at_least_2y_up_to_3y_old" - ) - self._3m_to_4m: _10yTo12yPattern = _10yTo12yPattern( - client, "utxos_at_least_3m_up_to_4m_old" - ) - self._3y_to_4y: _10yTo12yPattern = _10yTo12yPattern( - client, "utxos_at_least_3y_up_to_4y_old" - ) - self._4m_to_5m: _10yTo12yPattern = _10yTo12yPattern( - client, "utxos_at_least_4m_up_to_5m_old" - ) - self._4y_to_5y: _10yTo12yPattern = _10yTo12yPattern( - client, "utxos_at_least_4y_up_to_5y_old" - ) - self._5m_to_6m: _10yTo12yPattern = _10yTo12yPattern( - client, "utxos_at_least_5m_up_to_6m_old" - ) - self._5y_to_6y: _10yTo12yPattern = _10yTo12yPattern( - client, "utxos_at_least_5y_up_to_6y_old" - ) - self._6m_to_1y: _10yTo12yPattern = _10yTo12yPattern( - client, "utxos_at_least_6m_up_to_1y_old" - ) - self._6y_to_7y: _10yTo12yPattern = _10yTo12yPattern( - client, "utxos_at_least_6y_up_to_7y_old" - ) - self._7y_to_8y: _10yTo12yPattern = _10yTo12yPattern( - client, "utxos_at_least_7y_up_to_8y_old" - ) - self._8y_to_10y: _10yTo12yPattern = _10yTo12yPattern( - client, "utxos_at_least_8y_up_to_10y_old" - ) - self.from_15y: _10yTo12yPattern = _10yTo12yPattern( - client, "utxos_at_least_15y_old" - ) - self.up_to_1h: _10yTo12yPattern = _10yTo12yPattern(client, "utxos_up_to_1h_old") - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self._10y_to_12y: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_at_least_10y_up_to_12y_old') + self._12y_to_15y: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_at_least_12y_up_to_15y_old') + self._1d_to_1w: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_at_least_1d_up_to_1w_old') + self._1h_to_1d: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_at_least_1h_up_to_1d_old') + self._1m_to_2m: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_at_least_1m_up_to_2m_old') + self._1w_to_1m: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_at_least_1w_up_to_1m_old') + self._1y_to_2y: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_at_least_1y_up_to_2y_old') + self._2m_to_3m: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_at_least_2m_up_to_3m_old') + self._2y_to_3y: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_at_least_2y_up_to_3y_old') + self._3m_to_4m: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_at_least_3m_up_to_4m_old') + self._3y_to_4y: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_at_least_3y_up_to_4y_old') + self._4m_to_5m: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_at_least_4m_up_to_5m_old') + self._4y_to_5y: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_at_least_4y_up_to_5y_old') + self._5m_to_6m: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_at_least_5m_up_to_6m_old') + self._5y_to_6y: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_at_least_5y_up_to_6y_old') + self._6m_to_1y: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_at_least_6m_up_to_1y_old') + self._6y_to_7y: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_at_least_6y_up_to_7y_old') + self._7y_to_8y: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_at_least_7y_up_to_8y_old') + self._8y_to_10y: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_at_least_8y_up_to_10y_old') + self.from_15y: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_at_least_15y_old') + self.up_to_1h: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_up_to_1h_old') class MetricsTree_Distribution_UtxoCohorts_All_CostBasis: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.max: MetricPattern1[Dollars] = MetricPattern1(client, "max_cost_basis") - self.min: MetricPattern1[Dollars] = MetricPattern1(client, "min_cost_basis") - self.percentiles: PercentilesPattern = PercentilesPattern(client, "cost_basis") - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.max: MetricPattern1[Dollars] = MetricPattern1(client, 'max_cost_basis') + self.min: MetricPattern1[Dollars] = MetricPattern1(client, 'min_cost_basis') + self.percentiles: PercentilesPattern = PercentilesPattern(client, 'cost_basis') class MetricsTree_Distribution_UtxoCohorts_All_Relative: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.neg_unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1[ - StoredF32 - ] = MetricPattern1( - client, "neg_unrealized_loss_rel_to_own_total_unrealized_pnl" - ) - self.net_unrealized_pnl_rel_to_own_total_unrealized_pnl: MetricPattern1[ - StoredF32 - ] = MetricPattern1(client, "net_unrealized_pnl_rel_to_own_total_unrealized_pnl") - self.supply_in_loss_rel_to_own_supply: MetricPattern1[StoredF64] = ( - MetricPattern1(client, "supply_in_loss_rel_to_own_supply") - ) - self.supply_in_profit_rel_to_own_supply: MetricPattern1[StoredF64] = ( - MetricPattern1(client, "supply_in_profit_rel_to_own_supply") - ) - self.unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1[ - StoredF32 - ] = MetricPattern1(client, "unrealized_loss_rel_to_own_total_unrealized_pnl") - self.unrealized_profit_rel_to_own_total_unrealized_pnl: MetricPattern1[ - StoredF32 - ] = MetricPattern1(client, "unrealized_profit_rel_to_own_total_unrealized_pnl") - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.neg_unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1[StoredF32] = MetricPattern1(client, 'neg_unrealized_loss_rel_to_own_total_unrealized_pnl') + self.net_unrealized_pnl_rel_to_own_total_unrealized_pnl: MetricPattern1[StoredF32] = MetricPattern1(client, 'net_unrealized_pnl_rel_to_own_total_unrealized_pnl') + self.supply_in_loss_rel_to_own_supply: MetricPattern1[StoredF64] = MetricPattern1(client, 'supply_in_loss_rel_to_own_supply') + self.supply_in_profit_rel_to_own_supply: MetricPattern1[StoredF64] = MetricPattern1(client, 'supply_in_profit_rel_to_own_supply') + self.unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1[StoredF32] = MetricPattern1(client, 'unrealized_loss_rel_to_own_total_unrealized_pnl') + self.unrealized_profit_rel_to_own_total_unrealized_pnl: MetricPattern1[StoredF32] = MetricPattern1(client, 'unrealized_profit_rel_to_own_total_unrealized_pnl') class MetricsTree_Distribution_UtxoCohorts_All: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.activity: ActivityPattern2 = ActivityPattern2( - client, "coinblocks_destroyed" - ) - self.cost_basis: MetricsTree_Distribution_UtxoCohorts_All_CostBasis = ( - MetricsTree_Distribution_UtxoCohorts_All_CostBasis(client) - ) - self.outputs: OutputsPattern = OutputsPattern(client, "utxo_count") - self.realized: RealizedPattern3 = RealizedPattern3(client, "adjusted_sopr") - self.relative: MetricsTree_Distribution_UtxoCohorts_All_Relative = ( - MetricsTree_Distribution_UtxoCohorts_All_Relative(client) - ) - self.supply: SupplyPattern2 = SupplyPattern2(client, "supply") - self.unrealized: UnrealizedPattern = UnrealizedPattern( - client, "neg_unrealized_loss" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.activity: ActivityPattern2 = ActivityPattern2(client, 'coinblocks_destroyed') + self.cost_basis: MetricsTree_Distribution_UtxoCohorts_All_CostBasis = MetricsTree_Distribution_UtxoCohorts_All_CostBasis(client) + self.outputs: OutputsPattern = OutputsPattern(client, 'utxo_count') + self.realized: RealizedPattern3 = RealizedPattern3(client, 'adjusted_sopr') + self.relative: MetricsTree_Distribution_UtxoCohorts_All_Relative = MetricsTree_Distribution_UtxoCohorts_All_Relative(client) + self.supply: SupplyPattern2 = SupplyPattern2(client, 'supply') + self.unrealized: UnrealizedPattern = UnrealizedPattern(client, 'neg_unrealized_loss') class MetricsTree_Distribution_UtxoCohorts_AmountRange: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self._0sats: _0satsPattern2 = _0satsPattern2(client, "utxos_with_0sats") - self._100btc_to_1k_btc: _0satsPattern2 = _0satsPattern2( - client, "utxos_above_100btc_under_1k_btc" - ) - self._100k_btc_or_more: _0satsPattern2 = _0satsPattern2( - client, "utxos_above_100k_btc" - ) - self._100k_sats_to_1m_sats: _0satsPattern2 = _0satsPattern2( - client, "utxos_above_100k_sats_under_1m_sats" - ) - self._100sats_to_1k_sats: _0satsPattern2 = _0satsPattern2( - client, "utxos_above_100sats_under_1k_sats" - ) - self._10btc_to_100btc: _0satsPattern2 = _0satsPattern2( - client, "utxos_above_10btc_under_100btc" - ) - self._10k_btc_to_100k_btc: _0satsPattern2 = _0satsPattern2( - client, "utxos_above_10k_btc_under_100k_btc" - ) - self._10k_sats_to_100k_sats: _0satsPattern2 = _0satsPattern2( - client, "utxos_above_10k_sats_under_100k_sats" - ) - self._10m_sats_to_1btc: _0satsPattern2 = _0satsPattern2( - client, "utxos_above_10m_sats_under_1btc" - ) - self._10sats_to_100sats: _0satsPattern2 = _0satsPattern2( - client, "utxos_above_10sats_under_100sats" - ) - self._1btc_to_10btc: _0satsPattern2 = _0satsPattern2( - client, "utxos_above_1btc_under_10btc" - ) - self._1k_btc_to_10k_btc: _0satsPattern2 = _0satsPattern2( - client, "utxos_above_1k_btc_under_10k_btc" - ) - self._1k_sats_to_10k_sats: _0satsPattern2 = _0satsPattern2( - client, "utxos_above_1k_sats_under_10k_sats" - ) - self._1m_sats_to_10m_sats: _0satsPattern2 = _0satsPattern2( - client, "utxos_above_1m_sats_under_10m_sats" - ) - self._1sat_to_10sats: _0satsPattern2 = _0satsPattern2( - client, "utxos_above_1sat_under_10sats" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self._0sats: _0satsPattern2 = _0satsPattern2(client, 'utxos_with_0sats') + self._100btc_to_1k_btc: _0satsPattern2 = _0satsPattern2(client, 'utxos_above_100btc_under_1k_btc') + self._100k_btc_or_more: _0satsPattern2 = _0satsPattern2(client, 'utxos_above_100k_btc') + self._100k_sats_to_1m_sats: _0satsPattern2 = _0satsPattern2(client, 'utxos_above_100k_sats_under_1m_sats') + self._100sats_to_1k_sats: _0satsPattern2 = _0satsPattern2(client, 'utxos_above_100sats_under_1k_sats') + self._10btc_to_100btc: _0satsPattern2 = _0satsPattern2(client, 'utxos_above_10btc_under_100btc') + self._10k_btc_to_100k_btc: _0satsPattern2 = _0satsPattern2(client, 'utxos_above_10k_btc_under_100k_btc') + self._10k_sats_to_100k_sats: _0satsPattern2 = _0satsPattern2(client, 'utxos_above_10k_sats_under_100k_sats') + self._10m_sats_to_1btc: _0satsPattern2 = _0satsPattern2(client, 'utxos_above_10m_sats_under_1btc') + self._10sats_to_100sats: _0satsPattern2 = _0satsPattern2(client, 'utxos_above_10sats_under_100sats') + self._1btc_to_10btc: _0satsPattern2 = _0satsPattern2(client, 'utxos_above_1btc_under_10btc') + self._1k_btc_to_10k_btc: _0satsPattern2 = _0satsPattern2(client, 'utxos_above_1k_btc_under_10k_btc') + self._1k_sats_to_10k_sats: _0satsPattern2 = _0satsPattern2(client, 'utxos_above_1k_sats_under_10k_sats') + self._1m_sats_to_10m_sats: _0satsPattern2 = _0satsPattern2(client, 'utxos_above_1m_sats_under_10m_sats') + self._1sat_to_10sats: _0satsPattern2 = _0satsPattern2(client, 'utxos_above_1sat_under_10sats') class MetricsTree_Distribution_UtxoCohorts_Epoch: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self._0: _0satsPattern2 = _0satsPattern2(client, "epoch_0") - self._1: _0satsPattern2 = _0satsPattern2(client, "epoch_1") - self._2: _0satsPattern2 = _0satsPattern2(client, "epoch_2") - self._3: _0satsPattern2 = _0satsPattern2(client, "epoch_3") - self._4: _0satsPattern2 = _0satsPattern2(client, "epoch_4") - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self._0: _0satsPattern2 = _0satsPattern2(client, 'epoch_0') + self._1: _0satsPattern2 = _0satsPattern2(client, 'epoch_1') + self._2: _0satsPattern2 = _0satsPattern2(client, 'epoch_2') + self._3: _0satsPattern2 = _0satsPattern2(client, 'epoch_3') + self._4: _0satsPattern2 = _0satsPattern2(client, 'epoch_4') class MetricsTree_Distribution_UtxoCohorts_GeAmount: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self._100btc: _100btcPattern = _100btcPattern(client, "utxos_above_100btc") - self._100k_sats: _100btcPattern = _100btcPattern( - client, "utxos_above_100k_sats" - ) - self._100sats: _100btcPattern = _100btcPattern(client, "utxos_above_100sats") - self._10btc: _100btcPattern = _100btcPattern(client, "utxos_above_10btc") - self._10k_btc: _100btcPattern = _100btcPattern(client, "utxos_above_10k_btc") - self._10k_sats: _100btcPattern = _100btcPattern(client, "utxos_above_10k_sats") - self._10m_sats: _100btcPattern = _100btcPattern(client, "utxos_above_10m_sats") - self._10sats: _100btcPattern = _100btcPattern(client, "utxos_above_10sats") - self._1btc: _100btcPattern = _100btcPattern(client, "utxos_above_1btc") - self._1k_btc: _100btcPattern = _100btcPattern(client, "utxos_above_1k_btc") - self._1k_sats: _100btcPattern = _100btcPattern(client, "utxos_above_1k_sats") - self._1m_sats: _100btcPattern = _100btcPattern(client, "utxos_above_1m_sats") - self._1sat: _100btcPattern = _100btcPattern(client, "utxos_above_1sat") - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self._100btc: _100btcPattern = _100btcPattern(client, 'utxos_above_100btc') + self._100k_sats: _100btcPattern = _100btcPattern(client, 'utxos_above_100k_sats') + self._100sats: _100btcPattern = _100btcPattern(client, 'utxos_above_100sats') + self._10btc: _100btcPattern = _100btcPattern(client, 'utxos_above_10btc') + self._10k_btc: _100btcPattern = _100btcPattern(client, 'utxos_above_10k_btc') + self._10k_sats: _100btcPattern = _100btcPattern(client, 'utxos_above_10k_sats') + self._10m_sats: _100btcPattern = _100btcPattern(client, 'utxos_above_10m_sats') + self._10sats: _100btcPattern = _100btcPattern(client, 'utxos_above_10sats') + self._1btc: _100btcPattern = _100btcPattern(client, 'utxos_above_1btc') + self._1k_btc: _100btcPattern = _100btcPattern(client, 'utxos_above_1k_btc') + self._1k_sats: _100btcPattern = _100btcPattern(client, 'utxos_above_1k_sats') + self._1m_sats: _100btcPattern = _100btcPattern(client, 'utxos_above_1m_sats') + self._1sat: _100btcPattern = _100btcPattern(client, 'utxos_above_1sat') class MetricsTree_Distribution_UtxoCohorts_LtAmount: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self._100btc: _100btcPattern = _100btcPattern(client, "utxos_under_100btc") - self._100k_btc: _100btcPattern = _100btcPattern(client, "utxos_under_100k_btc") - self._100k_sats: _100btcPattern = _100btcPattern( - client, "utxos_under_100k_sats" - ) - self._100sats: _100btcPattern = _100btcPattern(client, "utxos_under_100sats") - self._10btc: _100btcPattern = _100btcPattern(client, "utxos_under_10btc") - self._10k_btc: _100btcPattern = _100btcPattern(client, "utxos_under_10k_btc") - self._10k_sats: _100btcPattern = _100btcPattern(client, "utxos_under_10k_sats") - self._10m_sats: _100btcPattern = _100btcPattern(client, "utxos_under_10m_sats") - self._10sats: _100btcPattern = _100btcPattern(client, "utxos_under_10sats") - self._1btc: _100btcPattern = _100btcPattern(client, "utxos_under_1btc") - self._1k_btc: _100btcPattern = _100btcPattern(client, "utxos_under_1k_btc") - self._1k_sats: _100btcPattern = _100btcPattern(client, "utxos_under_1k_sats") - self._1m_sats: _100btcPattern = _100btcPattern(client, "utxos_under_1m_sats") - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self._100btc: _100btcPattern = _100btcPattern(client, 'utxos_under_100btc') + self._100k_btc: _100btcPattern = _100btcPattern(client, 'utxos_under_100k_btc') + self._100k_sats: _100btcPattern = _100btcPattern(client, 'utxos_under_100k_sats') + self._100sats: _100btcPattern = _100btcPattern(client, 'utxos_under_100sats') + self._10btc: _100btcPattern = _100btcPattern(client, 'utxos_under_10btc') + self._10k_btc: _100btcPattern = _100btcPattern(client, 'utxos_under_10k_btc') + self._10k_sats: _100btcPattern = _100btcPattern(client, 'utxos_under_10k_sats') + self._10m_sats: _100btcPattern = _100btcPattern(client, 'utxos_under_10m_sats') + self._10sats: _100btcPattern = _100btcPattern(client, 'utxos_under_10sats') + self._1btc: _100btcPattern = _100btcPattern(client, 'utxos_under_1btc') + self._1k_btc: _100btcPattern = _100btcPattern(client, 'utxos_under_1k_btc') + self._1k_sats: _100btcPattern = _100btcPattern(client, 'utxos_under_1k_sats') + self._1m_sats: _100btcPattern = _100btcPattern(client, 'utxos_under_1m_sats') class MetricsTree_Distribution_UtxoCohorts_MaxAge: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self._10y: _10yPattern = _10yPattern(client, "utxos_up_to_10y_old") - self._12y: _10yPattern = _10yPattern(client, "utxos_up_to_12y_old") - self._15y: _10yPattern = _10yPattern(client, "utxos_up_to_15y_old") - self._1m: _10yPattern = _10yPattern(client, "utxos_up_to_1m_old") - self._1w: _10yPattern = _10yPattern(client, "utxos_up_to_1w_old") - self._1y: _10yPattern = _10yPattern(client, "utxos_up_to_1y_old") - self._2m: _10yPattern = _10yPattern(client, "utxos_up_to_2m_old") - self._2y: _10yPattern = _10yPattern(client, "utxos_up_to_2y_old") - self._3m: _10yPattern = _10yPattern(client, "utxos_up_to_3m_old") - self._3y: _10yPattern = _10yPattern(client, "utxos_up_to_3y_old") - self._4m: _10yPattern = _10yPattern(client, "utxos_up_to_4m_old") - self._4y: _10yPattern = _10yPattern(client, "utxos_up_to_4y_old") - self._5m: _10yPattern = _10yPattern(client, "utxos_up_to_5m_old") - self._5y: _10yPattern = _10yPattern(client, "utxos_up_to_5y_old") - self._6m: _10yPattern = _10yPattern(client, "utxos_up_to_6m_old") - self._6y: _10yPattern = _10yPattern(client, "utxos_up_to_6y_old") - self._7y: _10yPattern = _10yPattern(client, "utxos_up_to_7y_old") - self._8y: _10yPattern = _10yPattern(client, "utxos_up_to_8y_old") - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self._10y: _10yPattern = _10yPattern(client, 'utxos_up_to_10y_old') + self._12y: _10yPattern = _10yPattern(client, 'utxos_up_to_12y_old') + self._15y: _10yPattern = _10yPattern(client, 'utxos_up_to_15y_old') + self._1m: _10yPattern = _10yPattern(client, 'utxos_up_to_1m_old') + self._1w: _10yPattern = _10yPattern(client, 'utxos_up_to_1w_old') + self._1y: _10yPattern = _10yPattern(client, 'utxos_up_to_1y_old') + self._2m: _10yPattern = _10yPattern(client, 'utxos_up_to_2m_old') + self._2y: _10yPattern = _10yPattern(client, 'utxos_up_to_2y_old') + self._3m: _10yPattern = _10yPattern(client, 'utxos_up_to_3m_old') + self._3y: _10yPattern = _10yPattern(client, 'utxos_up_to_3y_old') + self._4m: _10yPattern = _10yPattern(client, 'utxos_up_to_4m_old') + self._4y: _10yPattern = _10yPattern(client, 'utxos_up_to_4y_old') + self._5m: _10yPattern = _10yPattern(client, 'utxos_up_to_5m_old') + self._5y: _10yPattern = _10yPattern(client, 'utxos_up_to_5y_old') + self._6m: _10yPattern = _10yPattern(client, 'utxos_up_to_6m_old') + self._6y: _10yPattern = _10yPattern(client, 'utxos_up_to_6y_old') + self._7y: _10yPattern = _10yPattern(client, 'utxos_up_to_7y_old') + self._8y: _10yPattern = _10yPattern(client, 'utxos_up_to_8y_old') class MetricsTree_Distribution_UtxoCohorts_MinAge: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self._10y: _100btcPattern = _100btcPattern(client, "utxos_at_least_10y_old") - self._12y: _100btcPattern = _100btcPattern(client, "utxos_at_least_12y_old") - self._1d: _100btcPattern = _100btcPattern(client, "utxos_at_least_1d_old") - self._1m: _100btcPattern = _100btcPattern(client, "utxos_at_least_1m_old") - self._1w: _100btcPattern = _100btcPattern(client, "utxos_at_least_1w_old") - self._1y: _100btcPattern = _100btcPattern(client, "utxos_at_least_1y_old") - self._2m: _100btcPattern = _100btcPattern(client, "utxos_at_least_2m_old") - self._2y: _100btcPattern = _100btcPattern(client, "utxos_at_least_2y_old") - self._3m: _100btcPattern = _100btcPattern(client, "utxos_at_least_3m_old") - self._3y: _100btcPattern = _100btcPattern(client, "utxos_at_least_3y_old") - self._4m: _100btcPattern = _100btcPattern(client, "utxos_at_least_4m_old") - self._4y: _100btcPattern = _100btcPattern(client, "utxos_at_least_4y_old") - self._5m: _100btcPattern = _100btcPattern(client, "utxos_at_least_5m_old") - self._5y: _100btcPattern = _100btcPattern(client, "utxos_at_least_5y_old") - self._6m: _100btcPattern = _100btcPattern(client, "utxos_at_least_6m_old") - self._6y: _100btcPattern = _100btcPattern(client, "utxos_at_least_6y_old") - self._7y: _100btcPattern = _100btcPattern(client, "utxos_at_least_7y_old") - self._8y: _100btcPattern = _100btcPattern(client, "utxos_at_least_8y_old") - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self._10y: _100btcPattern = _100btcPattern(client, 'utxos_at_least_10y_old') + self._12y: _100btcPattern = _100btcPattern(client, 'utxos_at_least_12y_old') + self._1d: _100btcPattern = _100btcPattern(client, 'utxos_at_least_1d_old') + self._1m: _100btcPattern = _100btcPattern(client, 'utxos_at_least_1m_old') + self._1w: _100btcPattern = _100btcPattern(client, 'utxos_at_least_1w_old') + self._1y: _100btcPattern = _100btcPattern(client, 'utxos_at_least_1y_old') + self._2m: _100btcPattern = _100btcPattern(client, 'utxos_at_least_2m_old') + self._2y: _100btcPattern = _100btcPattern(client, 'utxos_at_least_2y_old') + self._3m: _100btcPattern = _100btcPattern(client, 'utxos_at_least_3m_old') + self._3y: _100btcPattern = _100btcPattern(client, 'utxos_at_least_3y_old') + self._4m: _100btcPattern = _100btcPattern(client, 'utxos_at_least_4m_old') + self._4y: _100btcPattern = _100btcPattern(client, 'utxos_at_least_4y_old') + self._5m: _100btcPattern = _100btcPattern(client, 'utxos_at_least_5m_old') + self._5y: _100btcPattern = _100btcPattern(client, 'utxos_at_least_5y_old') + self._6m: _100btcPattern = _100btcPattern(client, 'utxos_at_least_6m_old') + self._6y: _100btcPattern = _100btcPattern(client, 'utxos_at_least_6y_old') + self._7y: _100btcPattern = _100btcPattern(client, 'utxos_at_least_7y_old') + self._8y: _100btcPattern = _100btcPattern(client, 'utxos_at_least_8y_old') class MetricsTree_Distribution_UtxoCohorts_Term_Long_CostBasis: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.max: MetricPattern1[Dollars] = MetricPattern1(client, "lth_max_cost_basis") - self.min: MetricPattern1[Dollars] = MetricPattern1(client, "lth_min_cost_basis") - self.percentiles: PercentilesPattern = PercentilesPattern( - client, "lth_cost_basis" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.max: MetricPattern1[Dollars] = MetricPattern1(client, 'lth_max_cost_basis') + self.min: MetricPattern1[Dollars] = MetricPattern1(client, 'lth_min_cost_basis') + self.percentiles: PercentilesPattern = PercentilesPattern(client, 'lth_cost_basis') class MetricsTree_Distribution_UtxoCohorts_Term_Long: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.activity: ActivityPattern2 = ActivityPattern2(client, "lth") - self.cost_basis: MetricsTree_Distribution_UtxoCohorts_Term_Long_CostBasis = ( - MetricsTree_Distribution_UtxoCohorts_Term_Long_CostBasis(client) - ) - self.outputs: OutputsPattern = OutputsPattern(client, "lth") - self.realized: RealizedPattern2 = RealizedPattern2(client, "lth") - self.relative: RelativePattern5 = RelativePattern5(client, "lth") - self.supply: SupplyPattern2 = SupplyPattern2(client, "lth_supply") - self.unrealized: UnrealizedPattern = UnrealizedPattern(client, "lth") - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.activity: ActivityPattern2 = ActivityPattern2(client, 'lth') + self.cost_basis: MetricsTree_Distribution_UtxoCohorts_Term_Long_CostBasis = MetricsTree_Distribution_UtxoCohorts_Term_Long_CostBasis(client) + self.outputs: OutputsPattern = OutputsPattern(client, 'lth') + self.realized: RealizedPattern2 = RealizedPattern2(client, 'lth') + self.relative: RelativePattern5 = RelativePattern5(client, 'lth') + self.supply: SupplyPattern2 = SupplyPattern2(client, 'lth_supply') + self.unrealized: UnrealizedPattern = UnrealizedPattern(client, 'lth') class MetricsTree_Distribution_UtxoCohorts_Term_Short_CostBasis: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.max: MetricPattern1[Dollars] = MetricPattern1(client, "sth_max_cost_basis") - self.min: MetricPattern1[Dollars] = MetricPattern1(client, "sth_min_cost_basis") - self.percentiles: PercentilesPattern = PercentilesPattern( - client, "sth_cost_basis" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.max: MetricPattern1[Dollars] = MetricPattern1(client, 'sth_max_cost_basis') + self.min: MetricPattern1[Dollars] = MetricPattern1(client, 'sth_min_cost_basis') + self.percentiles: PercentilesPattern = PercentilesPattern(client, 'sth_cost_basis') class MetricsTree_Distribution_UtxoCohorts_Term_Short: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.activity: ActivityPattern2 = ActivityPattern2(client, "sth") - self.cost_basis: MetricsTree_Distribution_UtxoCohorts_Term_Short_CostBasis = ( - MetricsTree_Distribution_UtxoCohorts_Term_Short_CostBasis(client) - ) - self.outputs: OutputsPattern = OutputsPattern(client, "sth") - self.realized: RealizedPattern3 = RealizedPattern3(client, "sth") - self.relative: RelativePattern5 = RelativePattern5(client, "sth") - self.supply: SupplyPattern2 = SupplyPattern2(client, "sth_supply") - self.unrealized: UnrealizedPattern = UnrealizedPattern(client, "sth") - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.activity: ActivityPattern2 = ActivityPattern2(client, 'sth') + self.cost_basis: MetricsTree_Distribution_UtxoCohorts_Term_Short_CostBasis = MetricsTree_Distribution_UtxoCohorts_Term_Short_CostBasis(client) + self.outputs: OutputsPattern = OutputsPattern(client, 'sth') + self.realized: RealizedPattern3 = RealizedPattern3(client, 'sth') + self.relative: RelativePattern5 = RelativePattern5(client, 'sth') + self.supply: SupplyPattern2 = SupplyPattern2(client, 'sth_supply') + self.unrealized: UnrealizedPattern = UnrealizedPattern(client, 'sth') class MetricsTree_Distribution_UtxoCohorts_Term: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.long: MetricsTree_Distribution_UtxoCohorts_Term_Long = ( - MetricsTree_Distribution_UtxoCohorts_Term_Long(client) - ) - self.short: MetricsTree_Distribution_UtxoCohorts_Term_Short = ( - MetricsTree_Distribution_UtxoCohorts_Term_Short(client) - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.long: MetricsTree_Distribution_UtxoCohorts_Term_Long = MetricsTree_Distribution_UtxoCohorts_Term_Long(client) + self.short: MetricsTree_Distribution_UtxoCohorts_Term_Short = MetricsTree_Distribution_UtxoCohorts_Term_Short(client) class MetricsTree_Distribution_UtxoCohorts_Type: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.empty: _0satsPattern2 = _0satsPattern2(client, "empty_outputs") - self.p2a: _0satsPattern2 = _0satsPattern2(client, "p2a") - self.p2ms: _0satsPattern2 = _0satsPattern2(client, "p2ms") - self.p2pk33: _0satsPattern2 = _0satsPattern2(client, "p2pk33") - self.p2pk65: _0satsPattern2 = _0satsPattern2(client, "p2pk65") - self.p2pkh: _0satsPattern2 = _0satsPattern2(client, "p2pkh") - self.p2sh: _0satsPattern2 = _0satsPattern2(client, "p2sh") - self.p2tr: _0satsPattern2 = _0satsPattern2(client, "p2tr") - self.p2wpkh: _0satsPattern2 = _0satsPattern2(client, "p2wpkh") - self.p2wsh: _0satsPattern2 = _0satsPattern2(client, "p2wsh") - self.unknown: _0satsPattern2 = _0satsPattern2(client, "unknown_outputs") - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.empty: _0satsPattern2 = _0satsPattern2(client, 'empty_outputs') + self.p2a: _0satsPattern2 = _0satsPattern2(client, 'p2a') + self.p2ms: _0satsPattern2 = _0satsPattern2(client, 'p2ms') + self.p2pk33: _0satsPattern2 = _0satsPattern2(client, 'p2pk33') + self.p2pk65: _0satsPattern2 = _0satsPattern2(client, 'p2pk65') + self.p2pkh: _0satsPattern2 = _0satsPattern2(client, 'p2pkh') + self.p2sh: _0satsPattern2 = _0satsPattern2(client, 'p2sh') + self.p2tr: _0satsPattern2 = _0satsPattern2(client, 'p2tr') + self.p2wpkh: _0satsPattern2 = _0satsPattern2(client, 'p2wpkh') + self.p2wsh: _0satsPattern2 = _0satsPattern2(client, 'p2wsh') + self.unknown: _0satsPattern2 = _0satsPattern2(client, 'unknown_outputs') class MetricsTree_Distribution_UtxoCohorts_Year: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self._2009: _0satsPattern2 = _0satsPattern2(client, "year_2009") - self._2010: _0satsPattern2 = _0satsPattern2(client, "year_2010") - self._2011: _0satsPattern2 = _0satsPattern2(client, "year_2011") - self._2012: _0satsPattern2 = _0satsPattern2(client, "year_2012") - self._2013: _0satsPattern2 = _0satsPattern2(client, "year_2013") - self._2014: _0satsPattern2 = _0satsPattern2(client, "year_2014") - self._2015: _0satsPattern2 = _0satsPattern2(client, "year_2015") - self._2016: _0satsPattern2 = _0satsPattern2(client, "year_2016") - self._2017: _0satsPattern2 = _0satsPattern2(client, "year_2017") - self._2018: _0satsPattern2 = _0satsPattern2(client, "year_2018") - self._2019: _0satsPattern2 = _0satsPattern2(client, "year_2019") - self._2020: _0satsPattern2 = _0satsPattern2(client, "year_2020") - self._2021: _0satsPattern2 = _0satsPattern2(client, "year_2021") - self._2022: _0satsPattern2 = _0satsPattern2(client, "year_2022") - self._2023: _0satsPattern2 = _0satsPattern2(client, "year_2023") - self._2024: _0satsPattern2 = _0satsPattern2(client, "year_2024") - self._2025: _0satsPattern2 = _0satsPattern2(client, "year_2025") - self._2026: _0satsPattern2 = _0satsPattern2(client, "year_2026") - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self._2009: _0satsPattern2 = _0satsPattern2(client, 'year_2009') + self._2010: _0satsPattern2 = _0satsPattern2(client, 'year_2010') + self._2011: _0satsPattern2 = _0satsPattern2(client, 'year_2011') + self._2012: _0satsPattern2 = _0satsPattern2(client, 'year_2012') + self._2013: _0satsPattern2 = _0satsPattern2(client, 'year_2013') + self._2014: _0satsPattern2 = _0satsPattern2(client, 'year_2014') + self._2015: _0satsPattern2 = _0satsPattern2(client, 'year_2015') + self._2016: _0satsPattern2 = _0satsPattern2(client, 'year_2016') + self._2017: _0satsPattern2 = _0satsPattern2(client, 'year_2017') + self._2018: _0satsPattern2 = _0satsPattern2(client, 'year_2018') + self._2019: _0satsPattern2 = _0satsPattern2(client, 'year_2019') + self._2020: _0satsPattern2 = _0satsPattern2(client, 'year_2020') + self._2021: _0satsPattern2 = _0satsPattern2(client, 'year_2021') + self._2022: _0satsPattern2 = _0satsPattern2(client, 'year_2022') + self._2023: _0satsPattern2 = _0satsPattern2(client, 'year_2023') + self._2024: _0satsPattern2 = _0satsPattern2(client, 'year_2024') + self._2025: _0satsPattern2 = _0satsPattern2(client, 'year_2025') + self._2026: _0satsPattern2 = _0satsPattern2(client, 'year_2026') class MetricsTree_Distribution_UtxoCohorts: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.age_range: MetricsTree_Distribution_UtxoCohorts_AgeRange = ( - MetricsTree_Distribution_UtxoCohorts_AgeRange(client) - ) - self.all: MetricsTree_Distribution_UtxoCohorts_All = ( - MetricsTree_Distribution_UtxoCohorts_All(client) - ) - self.amount_range: MetricsTree_Distribution_UtxoCohorts_AmountRange = ( - MetricsTree_Distribution_UtxoCohorts_AmountRange(client) - ) - self.epoch: MetricsTree_Distribution_UtxoCohorts_Epoch = ( - MetricsTree_Distribution_UtxoCohorts_Epoch(client) - ) - self.ge_amount: MetricsTree_Distribution_UtxoCohorts_GeAmount = ( - MetricsTree_Distribution_UtxoCohorts_GeAmount(client) - ) - self.lt_amount: MetricsTree_Distribution_UtxoCohorts_LtAmount = ( - MetricsTree_Distribution_UtxoCohorts_LtAmount(client) - ) - self.max_age: MetricsTree_Distribution_UtxoCohorts_MaxAge = ( - MetricsTree_Distribution_UtxoCohorts_MaxAge(client) - ) - self.min_age: MetricsTree_Distribution_UtxoCohorts_MinAge = ( - MetricsTree_Distribution_UtxoCohorts_MinAge(client) - ) - self.term: MetricsTree_Distribution_UtxoCohorts_Term = ( - MetricsTree_Distribution_UtxoCohorts_Term(client) - ) - self.type_: MetricsTree_Distribution_UtxoCohorts_Type = ( - MetricsTree_Distribution_UtxoCohorts_Type(client) - ) - self.year: MetricsTree_Distribution_UtxoCohorts_Year = ( - MetricsTree_Distribution_UtxoCohorts_Year(client) - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.age_range: MetricsTree_Distribution_UtxoCohorts_AgeRange = MetricsTree_Distribution_UtxoCohorts_AgeRange(client) + self.all: MetricsTree_Distribution_UtxoCohorts_All = MetricsTree_Distribution_UtxoCohorts_All(client) + self.amount_range: MetricsTree_Distribution_UtxoCohorts_AmountRange = MetricsTree_Distribution_UtxoCohorts_AmountRange(client) + self.epoch: MetricsTree_Distribution_UtxoCohorts_Epoch = MetricsTree_Distribution_UtxoCohorts_Epoch(client) + self.ge_amount: MetricsTree_Distribution_UtxoCohorts_GeAmount = MetricsTree_Distribution_UtxoCohorts_GeAmount(client) + self.lt_amount: MetricsTree_Distribution_UtxoCohorts_LtAmount = MetricsTree_Distribution_UtxoCohorts_LtAmount(client) + self.max_age: MetricsTree_Distribution_UtxoCohorts_MaxAge = MetricsTree_Distribution_UtxoCohorts_MaxAge(client) + self.min_age: MetricsTree_Distribution_UtxoCohorts_MinAge = MetricsTree_Distribution_UtxoCohorts_MinAge(client) + self.term: MetricsTree_Distribution_UtxoCohorts_Term = MetricsTree_Distribution_UtxoCohorts_Term(client) + self.type_: MetricsTree_Distribution_UtxoCohorts_Type = MetricsTree_Distribution_UtxoCohorts_Type(client) + self.year: MetricsTree_Distribution_UtxoCohorts_Year = MetricsTree_Distribution_UtxoCohorts_Year(client) class MetricsTree_Distribution: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.addr_count: MetricsTree_Distribution_AddrCount = ( - MetricsTree_Distribution_AddrCount(client) - ) - self.address_cohorts: MetricsTree_Distribution_AddressCohorts = ( - MetricsTree_Distribution_AddressCohorts(client) - ) - self.addresses_data: MetricsTree_Distribution_AddressesData = ( - MetricsTree_Distribution_AddressesData(client) - ) - self.any_address_indexes: MetricsTree_Distribution_AnyAddressIndexes = ( - MetricsTree_Distribution_AnyAddressIndexes(client) - ) - self.chain_state: MetricPattern11[SupplyState] = MetricPattern11( - client, "chain" - ) - self.empty_addr_count: MetricsTree_Distribution_EmptyAddrCount = ( - MetricsTree_Distribution_EmptyAddrCount(client) - ) - self.emptyaddressindex: MetricPattern32[EmptyAddressIndex] = MetricPattern32( - client, "emptyaddressindex" - ) - self.loadedaddressindex: MetricPattern31[LoadedAddressIndex] = MetricPattern31( - client, "loadedaddressindex" - ) - self.utxo_cohorts: MetricsTree_Distribution_UtxoCohorts = ( - MetricsTree_Distribution_UtxoCohorts(client) - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.addr_count: MetricsTree_Distribution_AddrCount = MetricsTree_Distribution_AddrCount(client) + self.address_cohorts: MetricsTree_Distribution_AddressCohorts = MetricsTree_Distribution_AddressCohorts(client) + self.addresses_data: MetricsTree_Distribution_AddressesData = MetricsTree_Distribution_AddressesData(client) + self.any_address_indexes: MetricsTree_Distribution_AnyAddressIndexes = MetricsTree_Distribution_AnyAddressIndexes(client) + self.chain_state: MetricPattern11[SupplyState] = MetricPattern11(client, 'chain') + self.empty_addr_count: MetricsTree_Distribution_EmptyAddrCount = MetricsTree_Distribution_EmptyAddrCount(client) + self.emptyaddressindex: MetricPattern32[EmptyAddressIndex] = MetricPattern32(client, 'emptyaddressindex') + self.loadedaddressindex: MetricPattern31[LoadedAddressIndex] = MetricPattern31(client, 'loadedaddressindex') + self.utxo_cohorts: MetricsTree_Distribution_UtxoCohorts = MetricsTree_Distribution_UtxoCohorts(client) class MetricsTree_Indexes_Address_Empty: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.identity: MetricPattern9[EmptyOutputIndex] = MetricPattern9( - client, "emptyoutputindex" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.identity: MetricPattern9[EmptyOutputIndex] = MetricPattern9(client, 'emptyoutputindex') class MetricsTree_Indexes_Address_Opreturn: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.identity: MetricPattern14[OpReturnIndex] = MetricPattern14( - client, "opreturnindex" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.identity: MetricPattern14[OpReturnIndex] = MetricPattern14(client, 'opreturnindex') class MetricsTree_Indexes_Address_P2a: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.identity: MetricPattern16[P2AAddressIndex] = MetricPattern16( - client, "p2aaddressindex" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.identity: MetricPattern16[P2AAddressIndex] = MetricPattern16(client, 'p2aaddressindex') class MetricsTree_Indexes_Address_P2ms: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.identity: MetricPattern17[P2MSOutputIndex] = MetricPattern17( - client, "p2msoutputindex" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.identity: MetricPattern17[P2MSOutputIndex] = MetricPattern17(client, 'p2msoutputindex') class MetricsTree_Indexes_Address_P2pk33: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.identity: MetricPattern18[P2PK33AddressIndex] = MetricPattern18( - client, "p2pk33addressindex" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.identity: MetricPattern18[P2PK33AddressIndex] = MetricPattern18(client, 'p2pk33addressindex') class MetricsTree_Indexes_Address_P2pk65: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.identity: MetricPattern19[P2PK65AddressIndex] = MetricPattern19( - client, "p2pk65addressindex" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.identity: MetricPattern19[P2PK65AddressIndex] = MetricPattern19(client, 'p2pk65addressindex') class MetricsTree_Indexes_Address_P2pkh: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.identity: MetricPattern20[P2PKHAddressIndex] = MetricPattern20( - client, "p2pkhaddressindex" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.identity: MetricPattern20[P2PKHAddressIndex] = MetricPattern20(client, 'p2pkhaddressindex') class MetricsTree_Indexes_Address_P2sh: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.identity: MetricPattern21[P2SHAddressIndex] = MetricPattern21( - client, "p2shaddressindex" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.identity: MetricPattern21[P2SHAddressIndex] = MetricPattern21(client, 'p2shaddressindex') class MetricsTree_Indexes_Address_P2tr: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.identity: MetricPattern22[P2TRAddressIndex] = MetricPattern22( - client, "p2traddressindex" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.identity: MetricPattern22[P2TRAddressIndex] = MetricPattern22(client, 'p2traddressindex') class MetricsTree_Indexes_Address_P2wpkh: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.identity: MetricPattern23[P2WPKHAddressIndex] = MetricPattern23( - client, "p2wpkhaddressindex" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.identity: MetricPattern23[P2WPKHAddressIndex] = MetricPattern23(client, 'p2wpkhaddressindex') class MetricsTree_Indexes_Address_P2wsh: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.identity: MetricPattern24[P2WSHAddressIndex] = MetricPattern24( - client, "p2wshaddressindex" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.identity: MetricPattern24[P2WSHAddressIndex] = MetricPattern24(client, 'p2wshaddressindex') class MetricsTree_Indexes_Address_Unknown: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.identity: MetricPattern28[UnknownOutputIndex] = MetricPattern28( - client, "unknownoutputindex" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.identity: MetricPattern28[UnknownOutputIndex] = MetricPattern28(client, 'unknownoutputindex') class MetricsTree_Indexes_Address: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.empty: MetricsTree_Indexes_Address_Empty = ( - MetricsTree_Indexes_Address_Empty(client) - ) - self.opreturn: MetricsTree_Indexes_Address_Opreturn = ( - MetricsTree_Indexes_Address_Opreturn(client) - ) - self.p2a: MetricsTree_Indexes_Address_P2a = MetricsTree_Indexes_Address_P2a( - client - ) - self.p2ms: MetricsTree_Indexes_Address_P2ms = MetricsTree_Indexes_Address_P2ms( - client - ) - self.p2pk33: MetricsTree_Indexes_Address_P2pk33 = ( - MetricsTree_Indexes_Address_P2pk33(client) - ) - self.p2pk65: MetricsTree_Indexes_Address_P2pk65 = ( - MetricsTree_Indexes_Address_P2pk65(client) - ) - self.p2pkh: MetricsTree_Indexes_Address_P2pkh = ( - MetricsTree_Indexes_Address_P2pkh(client) - ) - self.p2sh: MetricsTree_Indexes_Address_P2sh = MetricsTree_Indexes_Address_P2sh( - client - ) - self.p2tr: MetricsTree_Indexes_Address_P2tr = MetricsTree_Indexes_Address_P2tr( - client - ) - self.p2wpkh: MetricsTree_Indexes_Address_P2wpkh = ( - MetricsTree_Indexes_Address_P2wpkh(client) - ) - self.p2wsh: MetricsTree_Indexes_Address_P2wsh = ( - MetricsTree_Indexes_Address_P2wsh(client) - ) - self.unknown: MetricsTree_Indexes_Address_Unknown = ( - MetricsTree_Indexes_Address_Unknown(client) - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.empty: MetricsTree_Indexes_Address_Empty = MetricsTree_Indexes_Address_Empty(client) + self.opreturn: MetricsTree_Indexes_Address_Opreturn = MetricsTree_Indexes_Address_Opreturn(client) + self.p2a: MetricsTree_Indexes_Address_P2a = MetricsTree_Indexes_Address_P2a(client) + self.p2ms: MetricsTree_Indexes_Address_P2ms = MetricsTree_Indexes_Address_P2ms(client) + self.p2pk33: MetricsTree_Indexes_Address_P2pk33 = MetricsTree_Indexes_Address_P2pk33(client) + self.p2pk65: MetricsTree_Indexes_Address_P2pk65 = MetricsTree_Indexes_Address_P2pk65(client) + self.p2pkh: MetricsTree_Indexes_Address_P2pkh = MetricsTree_Indexes_Address_P2pkh(client) + self.p2sh: MetricsTree_Indexes_Address_P2sh = MetricsTree_Indexes_Address_P2sh(client) + self.p2tr: MetricsTree_Indexes_Address_P2tr = MetricsTree_Indexes_Address_P2tr(client) + self.p2wpkh: MetricsTree_Indexes_Address_P2wpkh = MetricsTree_Indexes_Address_P2wpkh(client) + self.p2wsh: MetricsTree_Indexes_Address_P2wsh = MetricsTree_Indexes_Address_P2wsh(client) + self.unknown: MetricsTree_Indexes_Address_Unknown = MetricsTree_Indexes_Address_Unknown(client) class MetricsTree_Indexes_Dateindex: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.date: MetricPattern6[Date] = MetricPattern6(client, "dateindex_date") - self.first_height: MetricPattern6[Height] = MetricPattern6( - client, "dateindex_first_height" - ) - self.height_count: MetricPattern6[StoredU64] = MetricPattern6( - client, "dateindex_height_count" - ) - self.identity: MetricPattern6[DateIndex] = MetricPattern6(client, "dateindex") - self.monthindex: MetricPattern6[MonthIndex] = MetricPattern6( - client, "dateindex_monthindex" - ) - self.weekindex: MetricPattern6[WeekIndex] = MetricPattern6( - client, "dateindex_weekindex" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.date: MetricPattern6[Date] = MetricPattern6(client, 'dateindex_date') + self.first_height: MetricPattern6[Height] = MetricPattern6(client, 'dateindex_first_height') + self.height_count: MetricPattern6[StoredU64] = MetricPattern6(client, 'dateindex_height_count') + self.identity: MetricPattern6[DateIndex] = MetricPattern6(client, 'dateindex') + self.monthindex: MetricPattern6[MonthIndex] = MetricPattern6(client, 'dateindex_monthindex') + self.weekindex: MetricPattern6[WeekIndex] = MetricPattern6(client, 'dateindex_weekindex') class MetricsTree_Indexes_Decadeindex: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.first_yearindex: MetricPattern7[YearIndex] = MetricPattern7( - client, "decadeindex_first_yearindex" - ) - self.identity: MetricPattern7[DecadeIndex] = MetricPattern7( - client, "decadeindex" - ) - self.yearindex_count: MetricPattern7[StoredU64] = MetricPattern7( - client, "decadeindex_yearindex_count" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.first_yearindex: MetricPattern7[YearIndex] = MetricPattern7(client, 'decadeindex_first_yearindex') + self.identity: MetricPattern7[DecadeIndex] = MetricPattern7(client, 'decadeindex') + self.yearindex_count: MetricPattern7[StoredU64] = MetricPattern7(client, 'decadeindex_yearindex_count') class MetricsTree_Indexes_Difficultyepoch: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.first_height: MetricPattern8[Height] = MetricPattern8( - client, "difficultyepoch_first_height" - ) - self.height_count: MetricPattern8[StoredU64] = MetricPattern8( - client, "difficultyepoch_height_count" - ) - self.identity: MetricPattern8[DifficultyEpoch] = MetricPattern8( - client, "difficultyepoch" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.first_height: MetricPattern8[Height] = MetricPattern8(client, 'difficultyepoch_first_height') + self.height_count: MetricPattern8[StoredU64] = MetricPattern8(client, 'difficultyepoch_height_count') + self.identity: MetricPattern8[DifficultyEpoch] = MetricPattern8(client, 'difficultyepoch') class MetricsTree_Indexes_Halvingepoch: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.first_height: MetricPattern10[Height] = MetricPattern10( - client, "halvingepoch_first_height" - ) - self.identity: MetricPattern10[HalvingEpoch] = MetricPattern10( - client, "halvingepoch" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.first_height: MetricPattern10[Height] = MetricPattern10(client, 'halvingepoch_first_height') + self.identity: MetricPattern10[HalvingEpoch] = MetricPattern10(client, 'halvingepoch') class MetricsTree_Indexes_Height: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.dateindex: MetricPattern11[DateIndex] = MetricPattern11( - client, "height_dateindex" - ) - self.difficultyepoch: MetricPattern11[DifficultyEpoch] = MetricPattern11( - client, "height_difficultyepoch" - ) - self.halvingepoch: MetricPattern11[HalvingEpoch] = MetricPattern11( - client, "height_halvingepoch" - ) - self.identity: MetricPattern11[Height] = MetricPattern11(client, "height") - self.txindex_count: MetricPattern11[StoredU64] = MetricPattern11( - client, "height_txindex_count" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.dateindex: MetricPattern11[DateIndex] = MetricPattern11(client, 'height_dateindex') + self.difficultyepoch: MetricPattern11[DifficultyEpoch] = MetricPattern11(client, 'height_difficultyepoch') + self.halvingepoch: MetricPattern11[HalvingEpoch] = MetricPattern11(client, 'height_halvingepoch') + self.identity: MetricPattern11[Height] = MetricPattern11(client, 'height') + self.txindex_count: MetricPattern11[StoredU64] = MetricPattern11(client, 'height_txindex_count') class MetricsTree_Indexes_Monthindex: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.dateindex_count: MetricPattern13[StoredU64] = MetricPattern13( - client, "monthindex_dateindex_count" - ) - self.first_dateindex: MetricPattern13[DateIndex] = MetricPattern13( - client, "monthindex_first_dateindex" - ) - self.identity: MetricPattern13[MonthIndex] = MetricPattern13( - client, "monthindex" - ) - self.quarterindex: MetricPattern13[QuarterIndex] = MetricPattern13( - client, "monthindex_quarterindex" - ) - self.semesterindex: MetricPattern13[SemesterIndex] = MetricPattern13( - client, "monthindex_semesterindex" - ) - self.yearindex: MetricPattern13[YearIndex] = MetricPattern13( - client, "monthindex_yearindex" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.dateindex_count: MetricPattern13[StoredU64] = MetricPattern13(client, 'monthindex_dateindex_count') + self.first_dateindex: MetricPattern13[DateIndex] = MetricPattern13(client, 'monthindex_first_dateindex') + self.identity: MetricPattern13[MonthIndex] = MetricPattern13(client, 'monthindex') + self.quarterindex: MetricPattern13[QuarterIndex] = MetricPattern13(client, 'monthindex_quarterindex') + self.semesterindex: MetricPattern13[SemesterIndex] = MetricPattern13(client, 'monthindex_semesterindex') + self.yearindex: MetricPattern13[YearIndex] = MetricPattern13(client, 'monthindex_yearindex') class MetricsTree_Indexes_Quarterindex: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.first_monthindex: MetricPattern25[MonthIndex] = MetricPattern25( - client, "quarterindex_first_monthindex" - ) - self.identity: MetricPattern25[QuarterIndex] = MetricPattern25( - client, "quarterindex" - ) - self.monthindex_count: MetricPattern25[StoredU64] = MetricPattern25( - client, "quarterindex_monthindex_count" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.first_monthindex: MetricPattern25[MonthIndex] = MetricPattern25(client, 'quarterindex_first_monthindex') + self.identity: MetricPattern25[QuarterIndex] = MetricPattern25(client, 'quarterindex') + self.monthindex_count: MetricPattern25[StoredU64] = MetricPattern25(client, 'quarterindex_monthindex_count') class MetricsTree_Indexes_Semesterindex: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.first_monthindex: MetricPattern26[MonthIndex] = MetricPattern26( - client, "semesterindex_first_monthindex" - ) - self.identity: MetricPattern26[SemesterIndex] = MetricPattern26( - client, "semesterindex" - ) - self.monthindex_count: MetricPattern26[StoredU64] = MetricPattern26( - client, "semesterindex_monthindex_count" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.first_monthindex: MetricPattern26[MonthIndex] = MetricPattern26(client, 'semesterindex_first_monthindex') + self.identity: MetricPattern26[SemesterIndex] = MetricPattern26(client, 'semesterindex') + self.monthindex_count: MetricPattern26[StoredU64] = MetricPattern26(client, 'semesterindex_monthindex_count') class MetricsTree_Indexes_Txindex: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.identity: MetricPattern27[TxIndex] = MetricPattern27(client, "txindex") - self.input_count: MetricPattern27[StoredU64] = MetricPattern27( - client, "txindex_input_count" - ) - self.output_count: MetricPattern27[StoredU64] = MetricPattern27( - client, "txindex_output_count" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.identity: MetricPattern27[TxIndex] = MetricPattern27(client, 'txindex') + self.input_count: MetricPattern27[StoredU64] = MetricPattern27(client, 'txindex_input_count') + self.output_count: MetricPattern27[StoredU64] = MetricPattern27(client, 'txindex_output_count') class MetricsTree_Indexes_Txinindex: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.identity: MetricPattern12[TxInIndex] = MetricPattern12(client, "txinindex") - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.identity: MetricPattern12[TxInIndex] = MetricPattern12(client, 'txinindex') class MetricsTree_Indexes_Txoutindex: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.identity: MetricPattern15[TxOutIndex] = MetricPattern15( - client, "txoutindex" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.identity: MetricPattern15[TxOutIndex] = MetricPattern15(client, 'txoutindex') class MetricsTree_Indexes_Weekindex: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.dateindex_count: MetricPattern29[StoredU64] = MetricPattern29( - client, "weekindex_dateindex_count" - ) - self.first_dateindex: MetricPattern29[DateIndex] = MetricPattern29( - client, "weekindex_first_dateindex" - ) - self.identity: MetricPattern29[WeekIndex] = MetricPattern29(client, "weekindex") - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.dateindex_count: MetricPattern29[StoredU64] = MetricPattern29(client, 'weekindex_dateindex_count') + self.first_dateindex: MetricPattern29[DateIndex] = MetricPattern29(client, 'weekindex_first_dateindex') + self.identity: MetricPattern29[WeekIndex] = MetricPattern29(client, 'weekindex') class MetricsTree_Indexes_Yearindex: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.decadeindex: MetricPattern30[DecadeIndex] = MetricPattern30( - client, "yearindex_decadeindex" - ) - self.first_monthindex: MetricPattern30[MonthIndex] = MetricPattern30( - client, "yearindex_first_monthindex" - ) - self.identity: MetricPattern30[YearIndex] = MetricPattern30(client, "yearindex") - self.monthindex_count: MetricPattern30[StoredU64] = MetricPattern30( - client, "yearindex_monthindex_count" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.decadeindex: MetricPattern30[DecadeIndex] = MetricPattern30(client, 'yearindex_decadeindex') + self.first_monthindex: MetricPattern30[MonthIndex] = MetricPattern30(client, 'yearindex_first_monthindex') + self.identity: MetricPattern30[YearIndex] = MetricPattern30(client, 'yearindex') + self.monthindex_count: MetricPattern30[StoredU64] = MetricPattern30(client, 'yearindex_monthindex_count') class MetricsTree_Indexes: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): + + def __init__(self, client: BrkClientBase, base_path: str = ''): self.address: MetricsTree_Indexes_Address = MetricsTree_Indexes_Address(client) - self.dateindex: MetricsTree_Indexes_Dateindex = MetricsTree_Indexes_Dateindex( - client - ) - self.decadeindex: MetricsTree_Indexes_Decadeindex = ( - MetricsTree_Indexes_Decadeindex(client) - ) - self.difficultyepoch: MetricsTree_Indexes_Difficultyepoch = ( - MetricsTree_Indexes_Difficultyepoch(client) - ) - self.halvingepoch: MetricsTree_Indexes_Halvingepoch = ( - MetricsTree_Indexes_Halvingepoch(client) - ) + self.dateindex: MetricsTree_Indexes_Dateindex = MetricsTree_Indexes_Dateindex(client) + self.decadeindex: MetricsTree_Indexes_Decadeindex = MetricsTree_Indexes_Decadeindex(client) + self.difficultyepoch: MetricsTree_Indexes_Difficultyepoch = MetricsTree_Indexes_Difficultyepoch(client) + self.halvingepoch: MetricsTree_Indexes_Halvingepoch = MetricsTree_Indexes_Halvingepoch(client) self.height: MetricsTree_Indexes_Height = MetricsTree_Indexes_Height(client) - self.monthindex: MetricsTree_Indexes_Monthindex = ( - MetricsTree_Indexes_Monthindex(client) - ) - self.quarterindex: MetricsTree_Indexes_Quarterindex = ( - MetricsTree_Indexes_Quarterindex(client) - ) - self.semesterindex: MetricsTree_Indexes_Semesterindex = ( - MetricsTree_Indexes_Semesterindex(client) - ) + self.monthindex: MetricsTree_Indexes_Monthindex = MetricsTree_Indexes_Monthindex(client) + self.quarterindex: MetricsTree_Indexes_Quarterindex = MetricsTree_Indexes_Quarterindex(client) + self.semesterindex: MetricsTree_Indexes_Semesterindex = MetricsTree_Indexes_Semesterindex(client) self.txindex: MetricsTree_Indexes_Txindex = MetricsTree_Indexes_Txindex(client) - self.txinindex: MetricsTree_Indexes_Txinindex = MetricsTree_Indexes_Txinindex( - client - ) - self.txoutindex: MetricsTree_Indexes_Txoutindex = ( - MetricsTree_Indexes_Txoutindex(client) - ) - self.weekindex: MetricsTree_Indexes_Weekindex = MetricsTree_Indexes_Weekindex( - client - ) - self.yearindex: MetricsTree_Indexes_Yearindex = MetricsTree_Indexes_Yearindex( - client - ) - + self.txinindex: MetricsTree_Indexes_Txinindex = MetricsTree_Indexes_Txinindex(client) + self.txoutindex: MetricsTree_Indexes_Txoutindex = MetricsTree_Indexes_Txoutindex(client) + self.weekindex: MetricsTree_Indexes_Weekindex = MetricsTree_Indexes_Weekindex(client) + self.yearindex: MetricsTree_Indexes_Yearindex = MetricsTree_Indexes_Yearindex(client) class MetricsTree_Inputs_Spent: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.txoutindex: MetricPattern12[TxOutIndex] = MetricPattern12( - client, "txoutindex" - ) - self.value: MetricPattern12[Sats] = MetricPattern12(client, "value") - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.txoutindex: MetricPattern12[TxOutIndex] = MetricPattern12(client, 'txoutindex') + self.value: MetricPattern12[Sats] = MetricPattern12(client, 'value') class MetricsTree_Inputs: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.count: CountPattern2[StoredU64] = CountPattern2(client, "input_count") - self.first_txinindex: MetricPattern11[TxInIndex] = MetricPattern11( - client, "first_txinindex" - ) - self.outpoint: MetricPattern12[OutPoint] = MetricPattern12(client, "outpoint") - self.outputtype: MetricPattern12[OutputType] = MetricPattern12( - client, "outputtype" - ) + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.count: CountPattern2[StoredU64] = CountPattern2(client, 'input_count') + self.first_txinindex: MetricPattern11[TxInIndex] = MetricPattern11(client, 'first_txinindex') + self.outpoint: MetricPattern12[OutPoint] = MetricPattern12(client, 'outpoint') + self.outputtype: MetricPattern12[OutputType] = MetricPattern12(client, 'outputtype') self.spent: MetricsTree_Inputs_Spent = MetricsTree_Inputs_Spent(client) - self.txindex: MetricPattern12[TxIndex] = MetricPattern12(client, "txindex") - self.typeindex: MetricPattern12[TypeIndex] = MetricPattern12( - client, "typeindex" - ) - self.witness_size: MetricPattern12[StoredU32] = MetricPattern12( - client, "witness_size" - ) - + self.txindex: MetricPattern12[TxIndex] = MetricPattern12(client, 'txindex') + self.typeindex: MetricPattern12[TypeIndex] = MetricPattern12(client, 'typeindex') + self.witness_size: MetricPattern12[StoredU32] = MetricPattern12(client, 'witness_size') class MetricsTree_Market_Ath: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.days_since_price_ath: MetricPattern4[StoredU16] = MetricPattern4( - client, "days_since_price_ath" - ) - self.max_days_between_price_aths: MetricPattern4[StoredU16] = MetricPattern4( - client, "max_days_between_price_aths" - ) - self.max_years_between_price_aths: MetricPattern4[StoredF32] = MetricPattern4( - client, "max_years_between_price_aths" - ) - self.price_ath: MetricPattern1[Dollars] = MetricPattern1(client, "price_ath") - self.price_drawdown: MetricPattern3[StoredF32] = MetricPattern3( - client, "price_drawdown" - ) - self.years_since_price_ath: MetricPattern4[StoredF32] = MetricPattern4( - client, "years_since_price_ath" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.days_since_price_ath: MetricPattern4[StoredU16] = MetricPattern4(client, 'days_since_price_ath') + self.max_days_between_price_aths: MetricPattern4[StoredU16] = MetricPattern4(client, 'max_days_between_price_aths') + self.max_years_between_price_aths: MetricPattern4[StoredF32] = MetricPattern4(client, 'max_years_between_price_aths') + self.price_ath: MetricPattern1[Dollars] = MetricPattern1(client, 'price_ath') + self.price_drawdown: MetricPattern3[StoredF32] = MetricPattern3(client, 'price_drawdown') + self.years_since_price_ath: MetricPattern4[StoredF32] = MetricPattern4(client, 'years_since_price_ath') class MetricsTree_Market_Dca_ClassAveragePrice: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self._2015: MetricPattern4[Dollars] = MetricPattern4( - client, "dca_class_2015_average_price" - ) - self._2016: MetricPattern4[Dollars] = MetricPattern4( - client, "dca_class_2016_average_price" - ) - self._2017: MetricPattern4[Dollars] = MetricPattern4( - client, "dca_class_2017_average_price" - ) - self._2018: MetricPattern4[Dollars] = MetricPattern4( - client, "dca_class_2018_average_price" - ) - self._2019: MetricPattern4[Dollars] = MetricPattern4( - client, "dca_class_2019_average_price" - ) - self._2020: MetricPattern4[Dollars] = MetricPattern4( - client, "dca_class_2020_average_price" - ) - self._2021: MetricPattern4[Dollars] = MetricPattern4( - client, "dca_class_2021_average_price" - ) - self._2022: MetricPattern4[Dollars] = MetricPattern4( - client, "dca_class_2022_average_price" - ) - self._2023: MetricPattern4[Dollars] = MetricPattern4( - client, "dca_class_2023_average_price" - ) - self._2024: MetricPattern4[Dollars] = MetricPattern4( - client, "dca_class_2024_average_price" - ) - self._2025: MetricPattern4[Dollars] = MetricPattern4( - client, "dca_class_2025_average_price" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self._2015: MetricPattern4[Dollars] = MetricPattern4(client, 'dca_class_2015_average_price') + self._2016: MetricPattern4[Dollars] = MetricPattern4(client, 'dca_class_2016_average_price') + self._2017: MetricPattern4[Dollars] = MetricPattern4(client, 'dca_class_2017_average_price') + self._2018: MetricPattern4[Dollars] = MetricPattern4(client, 'dca_class_2018_average_price') + self._2019: MetricPattern4[Dollars] = MetricPattern4(client, 'dca_class_2019_average_price') + self._2020: MetricPattern4[Dollars] = MetricPattern4(client, 'dca_class_2020_average_price') + self._2021: MetricPattern4[Dollars] = MetricPattern4(client, 'dca_class_2021_average_price') + self._2022: MetricPattern4[Dollars] = MetricPattern4(client, 'dca_class_2022_average_price') + self._2023: MetricPattern4[Dollars] = MetricPattern4(client, 'dca_class_2023_average_price') + self._2024: MetricPattern4[Dollars] = MetricPattern4(client, 'dca_class_2024_average_price') + self._2025: MetricPattern4[Dollars] = MetricPattern4(client, 'dca_class_2025_average_price') class MetricsTree_Market_Dca_ClassReturns: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self._2015: MetricPattern4[StoredF32] = MetricPattern4( - client, "dca_class_2015_returns" - ) - self._2016: MetricPattern4[StoredF32] = MetricPattern4( - client, "dca_class_2016_returns" - ) - self._2017: MetricPattern4[StoredF32] = MetricPattern4( - client, "dca_class_2017_returns" - ) - self._2018: MetricPattern4[StoredF32] = MetricPattern4( - client, "dca_class_2018_returns" - ) - self._2019: MetricPattern4[StoredF32] = MetricPattern4( - client, "dca_class_2019_returns" - ) - self._2020: MetricPattern4[StoredF32] = MetricPattern4( - client, "dca_class_2020_returns" - ) - self._2021: MetricPattern4[StoredF32] = MetricPattern4( - client, "dca_class_2021_returns" - ) - self._2022: MetricPattern4[StoredF32] = MetricPattern4( - client, "dca_class_2022_returns" - ) - self._2023: MetricPattern4[StoredF32] = MetricPattern4( - client, "dca_class_2023_returns" - ) - self._2024: MetricPattern4[StoredF32] = MetricPattern4( - client, "dca_class_2024_returns" - ) - self._2025: MetricPattern4[StoredF32] = MetricPattern4( - client, "dca_class_2025_returns" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self._2015: MetricPattern4[StoredF32] = MetricPattern4(client, 'dca_class_2015_returns') + self._2016: MetricPattern4[StoredF32] = MetricPattern4(client, 'dca_class_2016_returns') + self._2017: MetricPattern4[StoredF32] = MetricPattern4(client, 'dca_class_2017_returns') + self._2018: MetricPattern4[StoredF32] = MetricPattern4(client, 'dca_class_2018_returns') + self._2019: MetricPattern4[StoredF32] = MetricPattern4(client, 'dca_class_2019_returns') + self._2020: MetricPattern4[StoredF32] = MetricPattern4(client, 'dca_class_2020_returns') + self._2021: MetricPattern4[StoredF32] = MetricPattern4(client, 'dca_class_2021_returns') + self._2022: MetricPattern4[StoredF32] = MetricPattern4(client, 'dca_class_2022_returns') + self._2023: MetricPattern4[StoredF32] = MetricPattern4(client, 'dca_class_2023_returns') + self._2024: MetricPattern4[StoredF32] = MetricPattern4(client, 'dca_class_2024_returns') + self._2025: MetricPattern4[StoredF32] = MetricPattern4(client, 'dca_class_2025_returns') class MetricsTree_Market_Dca_ClassStack: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self._2015: _2015Pattern = _2015Pattern(client, "dca_class_2015_stack") - self._2016: _2015Pattern = _2015Pattern(client, "dca_class_2016_stack") - self._2017: _2015Pattern = _2015Pattern(client, "dca_class_2017_stack") - self._2018: _2015Pattern = _2015Pattern(client, "dca_class_2018_stack") - self._2019: _2015Pattern = _2015Pattern(client, "dca_class_2019_stack") - self._2020: _2015Pattern = _2015Pattern(client, "dca_class_2020_stack") - self._2021: _2015Pattern = _2015Pattern(client, "dca_class_2021_stack") - self._2022: _2015Pattern = _2015Pattern(client, "dca_class_2022_stack") - self._2023: _2015Pattern = _2015Pattern(client, "dca_class_2023_stack") - self._2024: _2015Pattern = _2015Pattern(client, "dca_class_2024_stack") - self._2025: _2015Pattern = _2015Pattern(client, "dca_class_2025_stack") - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self._2015: _2015Pattern = _2015Pattern(client, 'dca_class_2015_stack') + self._2016: _2015Pattern = _2015Pattern(client, 'dca_class_2016_stack') + self._2017: _2015Pattern = _2015Pattern(client, 'dca_class_2017_stack') + self._2018: _2015Pattern = _2015Pattern(client, 'dca_class_2018_stack') + self._2019: _2015Pattern = _2015Pattern(client, 'dca_class_2019_stack') + self._2020: _2015Pattern = _2015Pattern(client, 'dca_class_2020_stack') + self._2021: _2015Pattern = _2015Pattern(client, 'dca_class_2021_stack') + self._2022: _2015Pattern = _2015Pattern(client, 'dca_class_2022_stack') + self._2023: _2015Pattern = _2015Pattern(client, 'dca_class_2023_stack') + self._2024: _2015Pattern = _2015Pattern(client, 'dca_class_2024_stack') + self._2025: _2015Pattern = _2015Pattern(client, 'dca_class_2025_stack') class MetricsTree_Market_Dca: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.class_average_price: MetricsTree_Market_Dca_ClassAveragePrice = ( - MetricsTree_Market_Dca_ClassAveragePrice(client) - ) - self.class_returns: MetricsTree_Market_Dca_ClassReturns = ( - MetricsTree_Market_Dca_ClassReturns(client) - ) - self.class_stack: MetricsTree_Market_Dca_ClassStack = ( - MetricsTree_Market_Dca_ClassStack(client) - ) - self.period_average_price: PeriodAveragePricePattern[Dollars] = ( - PeriodAveragePricePattern(client, "dca_average_price") - ) - self.period_cagr: PeriodCagrPattern = PeriodCagrPattern(client, "dca_cagr") - self.period_lump_sum_stack: PeriodLumpSumStackPattern = ( - PeriodLumpSumStackPattern(client, "lump_sum_stack") - ) - self.period_returns: PeriodAveragePricePattern[StoredF32] = ( - PeriodAveragePricePattern(client, "dca_returns") - ) - self.period_stack: PeriodLumpSumStackPattern = PeriodLumpSumStackPattern( - client, "dca_stack" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.class_average_price: MetricsTree_Market_Dca_ClassAveragePrice = MetricsTree_Market_Dca_ClassAveragePrice(client) + self.class_returns: MetricsTree_Market_Dca_ClassReturns = MetricsTree_Market_Dca_ClassReturns(client) + self.class_stack: MetricsTree_Market_Dca_ClassStack = MetricsTree_Market_Dca_ClassStack(client) + self.period_average_price: PeriodAveragePricePattern[Dollars] = PeriodAveragePricePattern(client, 'dca_average_price') + self.period_cagr: PeriodCagrPattern = PeriodCagrPattern(client, 'dca_cagr') + self.period_lump_sum_stack: PeriodLumpSumStackPattern = PeriodLumpSumStackPattern(client, 'lump_sum_stack') + self.period_returns: PeriodAveragePricePattern[StoredF32] = PeriodAveragePricePattern(client, 'dca_returns') + self.period_stack: PeriodLumpSumStackPattern = PeriodLumpSumStackPattern(client, 'dca_stack') class MetricsTree_Market_Indicators: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.gini: MetricPattern6[StoredF32] = MetricPattern6(client, "gini") - self.macd_histogram: MetricPattern6[StoredF32] = MetricPattern6( - client, "macd_histogram" - ) - self.macd_line: MetricPattern6[StoredF32] = MetricPattern6(client, "macd_line") - self.macd_signal: MetricPattern6[StoredF32] = MetricPattern6( - client, "macd_signal" - ) - self.nvt: MetricPattern4[StoredF32] = MetricPattern4(client, "nvt") - self.pi_cycle: MetricPattern6[StoredF32] = MetricPattern6(client, "pi_cycle") - self.puell_multiple: MetricPattern4[StoredF32] = MetricPattern4( - client, "puell_multiple" - ) - self.rsi_14d: MetricPattern6[StoredF32] = MetricPattern6(client, "rsi_14d") - self.rsi_14d_max: MetricPattern6[StoredF32] = MetricPattern6( - client, "rsi_14d_max" - ) - self.rsi_14d_min: MetricPattern6[StoredF32] = MetricPattern6( - client, "rsi_14d_min" - ) - self.rsi_average_gain_14d: MetricPattern6[StoredF32] = MetricPattern6( - client, "rsi_average_gain_14d" - ) - self.rsi_average_loss_14d: MetricPattern6[StoredF32] = MetricPattern6( - client, "rsi_average_loss_14d" - ) - self.rsi_gains: MetricPattern6[StoredF32] = MetricPattern6(client, "rsi_gains") - self.rsi_losses: MetricPattern6[StoredF32] = MetricPattern6( - client, "rsi_losses" - ) - self.stoch_d: MetricPattern6[StoredF32] = MetricPattern6(client, "stoch_d") - self.stoch_k: MetricPattern6[StoredF32] = MetricPattern6(client, "stoch_k") - self.stoch_rsi: MetricPattern6[StoredF32] = MetricPattern6(client, "stoch_rsi") - self.stoch_rsi_d: MetricPattern6[StoredF32] = MetricPattern6( - client, "stoch_rsi_d" - ) - self.stoch_rsi_k: MetricPattern6[StoredF32] = MetricPattern6( - client, "stoch_rsi_k" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.gini: MetricPattern6[StoredF32] = MetricPattern6(client, 'gini') + self.macd_histogram: MetricPattern6[StoredF32] = MetricPattern6(client, 'macd_histogram') + self.macd_line: MetricPattern6[StoredF32] = MetricPattern6(client, 'macd_line') + self.macd_signal: MetricPattern6[StoredF32] = MetricPattern6(client, 'macd_signal') + self.nvt: MetricPattern4[StoredF32] = MetricPattern4(client, 'nvt') + self.pi_cycle: MetricPattern6[StoredF32] = MetricPattern6(client, 'pi_cycle') + self.puell_multiple: MetricPattern4[StoredF32] = MetricPattern4(client, 'puell_multiple') + self.rsi_14d: MetricPattern6[StoredF32] = MetricPattern6(client, 'rsi_14d') + self.rsi_14d_max: MetricPattern6[StoredF32] = MetricPattern6(client, 'rsi_14d_max') + self.rsi_14d_min: MetricPattern6[StoredF32] = MetricPattern6(client, 'rsi_14d_min') + self.rsi_average_gain_14d: MetricPattern6[StoredF32] = MetricPattern6(client, 'rsi_average_gain_14d') + self.rsi_average_loss_14d: MetricPattern6[StoredF32] = MetricPattern6(client, 'rsi_average_loss_14d') + self.rsi_gains: MetricPattern6[StoredF32] = MetricPattern6(client, 'rsi_gains') + self.rsi_losses: MetricPattern6[StoredF32] = MetricPattern6(client, 'rsi_losses') + self.stoch_d: MetricPattern6[StoredF32] = MetricPattern6(client, 'stoch_d') + self.stoch_k: MetricPattern6[StoredF32] = MetricPattern6(client, 'stoch_k') + self.stoch_rsi: MetricPattern6[StoredF32] = MetricPattern6(client, 'stoch_rsi') + self.stoch_rsi_d: MetricPattern6[StoredF32] = MetricPattern6(client, 'stoch_rsi_d') + self.stoch_rsi_k: MetricPattern6[StoredF32] = MetricPattern6(client, 'stoch_rsi_k') class MetricsTree_Market_Lookback_PriceAgo: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self._10y: MetricPattern4[Dollars] = MetricPattern4(client, "price_10y_ago") - self._1d: MetricPattern4[Dollars] = MetricPattern4(client, "price_1d_ago") - self._1m: MetricPattern4[Dollars] = MetricPattern4(client, "price_1m_ago") - self._1w: MetricPattern4[Dollars] = MetricPattern4(client, "price_1w_ago") - self._1y: MetricPattern4[Dollars] = MetricPattern4(client, "price_1y_ago") - self._2y: MetricPattern4[Dollars] = MetricPattern4(client, "price_2y_ago") - self._3m: MetricPattern4[Dollars] = MetricPattern4(client, "price_3m_ago") - self._3y: MetricPattern4[Dollars] = MetricPattern4(client, "price_3y_ago") - self._4y: MetricPattern4[Dollars] = MetricPattern4(client, "price_4y_ago") - self._5y: MetricPattern4[Dollars] = MetricPattern4(client, "price_5y_ago") - self._6m: MetricPattern4[Dollars] = MetricPattern4(client, "price_6m_ago") - self._6y: MetricPattern4[Dollars] = MetricPattern4(client, "price_6y_ago") - self._8y: MetricPattern4[Dollars] = MetricPattern4(client, "price_8y_ago") - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self._10y: MetricPattern4[Dollars] = MetricPattern4(client, 'price_10y_ago') + self._1d: MetricPattern4[Dollars] = MetricPattern4(client, 'price_1d_ago') + self._1m: MetricPattern4[Dollars] = MetricPattern4(client, 'price_1m_ago') + self._1w: MetricPattern4[Dollars] = MetricPattern4(client, 'price_1w_ago') + self._1y: MetricPattern4[Dollars] = MetricPattern4(client, 'price_1y_ago') + self._2y: MetricPattern4[Dollars] = MetricPattern4(client, 'price_2y_ago') + self._3m: MetricPattern4[Dollars] = MetricPattern4(client, 'price_3m_ago') + self._3y: MetricPattern4[Dollars] = MetricPattern4(client, 'price_3y_ago') + self._4y: MetricPattern4[Dollars] = MetricPattern4(client, 'price_4y_ago') + self._5y: MetricPattern4[Dollars] = MetricPattern4(client, 'price_5y_ago') + self._6m: MetricPattern4[Dollars] = MetricPattern4(client, 'price_6m_ago') + self._6y: MetricPattern4[Dollars] = MetricPattern4(client, 'price_6y_ago') + self._8y: MetricPattern4[Dollars] = MetricPattern4(client, 'price_8y_ago') class MetricsTree_Market_Lookback: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.price_ago: MetricsTree_Market_Lookback_PriceAgo = ( - MetricsTree_Market_Lookback_PriceAgo(client) - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.price_ago: MetricsTree_Market_Lookback_PriceAgo = MetricsTree_Market_Lookback_PriceAgo(client) class MetricsTree_Market_MovingAverage: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.price_111d_sma: Price111dSmaPattern = Price111dSmaPattern( - client, "price_111d_sma" - ) - self.price_12d_ema: Price111dSmaPattern = Price111dSmaPattern( - client, "price_12d_ema" - ) - self.price_13d_ema: Price111dSmaPattern = Price111dSmaPattern( - client, "price_13d_ema" - ) - self.price_13d_sma: Price111dSmaPattern = Price111dSmaPattern( - client, "price_13d_sma" - ) - self.price_144d_ema: Price111dSmaPattern = Price111dSmaPattern( - client, "price_144d_ema" - ) - self.price_144d_sma: Price111dSmaPattern = Price111dSmaPattern( - client, "price_144d_sma" - ) - self.price_1m_ema: Price111dSmaPattern = Price111dSmaPattern( - client, "price_1m_ema" - ) - self.price_1m_sma: Price111dSmaPattern = Price111dSmaPattern( - client, "price_1m_sma" - ) - self.price_1w_ema: Price111dSmaPattern = Price111dSmaPattern( - client, "price_1w_ema" - ) - self.price_1w_sma: Price111dSmaPattern = Price111dSmaPattern( - client, "price_1w_sma" - ) - self.price_1y_ema: Price111dSmaPattern = Price111dSmaPattern( - client, "price_1y_ema" - ) - self.price_1y_sma: Price111dSmaPattern = Price111dSmaPattern( - client, "price_1y_sma" - ) - self.price_200d_ema: Price111dSmaPattern = Price111dSmaPattern( - client, "price_200d_ema" - ) - self.price_200d_sma: Price111dSmaPattern = Price111dSmaPattern( - client, "price_200d_sma" - ) - self.price_200d_sma_x0_8: MetricPattern4[Dollars] = MetricPattern4( - client, "price_200d_sma_x0_8" - ) - self.price_200d_sma_x2_4: MetricPattern4[Dollars] = MetricPattern4( - client, "price_200d_sma_x2_4" - ) - self.price_200w_ema: Price111dSmaPattern = Price111dSmaPattern( - client, "price_200w_ema" - ) - self.price_200w_sma: Price111dSmaPattern = Price111dSmaPattern( - client, "price_200w_sma" - ) - self.price_21d_ema: Price111dSmaPattern = Price111dSmaPattern( - client, "price_21d_ema" - ) - self.price_21d_sma: Price111dSmaPattern = Price111dSmaPattern( - client, "price_21d_sma" - ) - self.price_26d_ema: Price111dSmaPattern = Price111dSmaPattern( - client, "price_26d_ema" - ) - self.price_2y_ema: Price111dSmaPattern = Price111dSmaPattern( - client, "price_2y_ema" - ) - self.price_2y_sma: Price111dSmaPattern = Price111dSmaPattern( - client, "price_2y_sma" - ) - self.price_34d_ema: Price111dSmaPattern = Price111dSmaPattern( - client, "price_34d_ema" - ) - self.price_34d_sma: Price111dSmaPattern = Price111dSmaPattern( - client, "price_34d_sma" - ) - self.price_350d_sma: Price111dSmaPattern = Price111dSmaPattern( - client, "price_350d_sma" - ) - self.price_350d_sma_x2: MetricPattern4[Dollars] = MetricPattern4( - client, "price_350d_sma_x2" - ) - self.price_4y_ema: Price111dSmaPattern = Price111dSmaPattern( - client, "price_4y_ema" - ) - self.price_4y_sma: Price111dSmaPattern = Price111dSmaPattern( - client, "price_4y_sma" - ) - self.price_55d_ema: Price111dSmaPattern = Price111dSmaPattern( - client, "price_55d_ema" - ) - self.price_55d_sma: Price111dSmaPattern = Price111dSmaPattern( - client, "price_55d_sma" - ) - self.price_89d_ema: Price111dSmaPattern = Price111dSmaPattern( - client, "price_89d_ema" - ) - self.price_89d_sma: Price111dSmaPattern = Price111dSmaPattern( - client, "price_89d_sma" - ) - self.price_8d_ema: Price111dSmaPattern = Price111dSmaPattern( - client, "price_8d_ema" - ) - self.price_8d_sma: Price111dSmaPattern = Price111dSmaPattern( - client, "price_8d_sma" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.price_111d_sma: Price111dSmaPattern = Price111dSmaPattern(client, 'price_111d_sma') + self.price_12d_ema: Price111dSmaPattern = Price111dSmaPattern(client, 'price_12d_ema') + self.price_13d_ema: Price111dSmaPattern = Price111dSmaPattern(client, 'price_13d_ema') + self.price_13d_sma: Price111dSmaPattern = Price111dSmaPattern(client, 'price_13d_sma') + self.price_144d_ema: Price111dSmaPattern = Price111dSmaPattern(client, 'price_144d_ema') + self.price_144d_sma: Price111dSmaPattern = Price111dSmaPattern(client, 'price_144d_sma') + self.price_1m_ema: Price111dSmaPattern = Price111dSmaPattern(client, 'price_1m_ema') + self.price_1m_sma: Price111dSmaPattern = Price111dSmaPattern(client, 'price_1m_sma') + self.price_1w_ema: Price111dSmaPattern = Price111dSmaPattern(client, 'price_1w_ema') + self.price_1w_sma: Price111dSmaPattern = Price111dSmaPattern(client, 'price_1w_sma') + self.price_1y_ema: Price111dSmaPattern = Price111dSmaPattern(client, 'price_1y_ema') + self.price_1y_sma: Price111dSmaPattern = Price111dSmaPattern(client, 'price_1y_sma') + self.price_200d_ema: Price111dSmaPattern = Price111dSmaPattern(client, 'price_200d_ema') + self.price_200d_sma: Price111dSmaPattern = Price111dSmaPattern(client, 'price_200d_sma') + self.price_200d_sma_x0_8: MetricPattern4[Dollars] = MetricPattern4(client, 'price_200d_sma_x0_8') + self.price_200d_sma_x2_4: MetricPattern4[Dollars] = MetricPattern4(client, 'price_200d_sma_x2_4') + self.price_200w_ema: Price111dSmaPattern = Price111dSmaPattern(client, 'price_200w_ema') + self.price_200w_sma: Price111dSmaPattern = Price111dSmaPattern(client, 'price_200w_sma') + self.price_21d_ema: Price111dSmaPattern = Price111dSmaPattern(client, 'price_21d_ema') + self.price_21d_sma: Price111dSmaPattern = Price111dSmaPattern(client, 'price_21d_sma') + self.price_26d_ema: Price111dSmaPattern = Price111dSmaPattern(client, 'price_26d_ema') + self.price_2y_ema: Price111dSmaPattern = Price111dSmaPattern(client, 'price_2y_ema') + self.price_2y_sma: Price111dSmaPattern = Price111dSmaPattern(client, 'price_2y_sma') + self.price_34d_ema: Price111dSmaPattern = Price111dSmaPattern(client, 'price_34d_ema') + self.price_34d_sma: Price111dSmaPattern = Price111dSmaPattern(client, 'price_34d_sma') + self.price_350d_sma: Price111dSmaPattern = Price111dSmaPattern(client, 'price_350d_sma') + self.price_350d_sma_x2: MetricPattern4[Dollars] = MetricPattern4(client, 'price_350d_sma_x2') + self.price_4y_ema: Price111dSmaPattern = Price111dSmaPattern(client, 'price_4y_ema') + self.price_4y_sma: Price111dSmaPattern = Price111dSmaPattern(client, 'price_4y_sma') + self.price_55d_ema: Price111dSmaPattern = Price111dSmaPattern(client, 'price_55d_ema') + self.price_55d_sma: Price111dSmaPattern = Price111dSmaPattern(client, 'price_55d_sma') + self.price_89d_ema: Price111dSmaPattern = Price111dSmaPattern(client, 'price_89d_ema') + self.price_89d_sma: Price111dSmaPattern = Price111dSmaPattern(client, 'price_89d_sma') + self.price_8d_ema: Price111dSmaPattern = Price111dSmaPattern(client, 'price_8d_ema') + self.price_8d_sma: Price111dSmaPattern = Price111dSmaPattern(client, 'price_8d_sma') class MetricsTree_Market_Range: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.price_1m_max: MetricPattern4[Dollars] = MetricPattern4( - client, "price_1m_max" - ) - self.price_1m_min: MetricPattern4[Dollars] = MetricPattern4( - client, "price_1m_min" - ) - self.price_1w_max: MetricPattern4[Dollars] = MetricPattern4( - client, "price_1w_max" - ) - self.price_1w_min: MetricPattern4[Dollars] = MetricPattern4( - client, "price_1w_min" - ) - self.price_1y_max: MetricPattern4[Dollars] = MetricPattern4( - client, "price_1y_max" - ) - self.price_1y_min: MetricPattern4[Dollars] = MetricPattern4( - client, "price_1y_min" - ) - self.price_2w_choppiness_index: MetricPattern4[StoredF32] = MetricPattern4( - client, "price_2w_choppiness_index" - ) - self.price_2w_max: MetricPattern4[Dollars] = MetricPattern4( - client, "price_2w_max" - ) - self.price_2w_min: MetricPattern4[Dollars] = MetricPattern4( - client, "price_2w_min" - ) - self.price_true_range: MetricPattern6[StoredF32] = MetricPattern6( - client, "price_true_range" - ) - self.price_true_range_2w_sum: MetricPattern6[StoredF32] = MetricPattern6( - client, "price_true_range_2w_sum" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.price_1m_max: MetricPattern4[Dollars] = MetricPattern4(client, 'price_1m_max') + self.price_1m_min: MetricPattern4[Dollars] = MetricPattern4(client, 'price_1m_min') + self.price_1w_max: MetricPattern4[Dollars] = MetricPattern4(client, 'price_1w_max') + self.price_1w_min: MetricPattern4[Dollars] = MetricPattern4(client, 'price_1w_min') + self.price_1y_max: MetricPattern4[Dollars] = MetricPattern4(client, 'price_1y_max') + self.price_1y_min: MetricPattern4[Dollars] = MetricPattern4(client, 'price_1y_min') + self.price_2w_choppiness_index: MetricPattern4[StoredF32] = MetricPattern4(client, 'price_2w_choppiness_index') + self.price_2w_max: MetricPattern4[Dollars] = MetricPattern4(client, 'price_2w_max') + self.price_2w_min: MetricPattern4[Dollars] = MetricPattern4(client, 'price_2w_min') + self.price_true_range: MetricPattern6[StoredF32] = MetricPattern6(client, 'price_true_range') + self.price_true_range_2w_sum: MetricPattern6[StoredF32] = MetricPattern6(client, 'price_true_range_2w_sum') class MetricsTree_Market_Returns_PriceReturns: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self._10y: MetricPattern4[StoredF32] = MetricPattern4( - client, "10y_price_returns" - ) - self._1d: MetricPattern4[StoredF32] = MetricPattern4(client, "1d_price_returns") - self._1m: MetricPattern4[StoredF32] = MetricPattern4(client, "1m_price_returns") - self._1w: MetricPattern4[StoredF32] = MetricPattern4(client, "1w_price_returns") - self._1y: MetricPattern4[StoredF32] = MetricPattern4(client, "1y_price_returns") - self._2y: MetricPattern4[StoredF32] = MetricPattern4(client, "2y_price_returns") - self._3m: MetricPattern4[StoredF32] = MetricPattern4(client, "3m_price_returns") - self._3y: MetricPattern4[StoredF32] = MetricPattern4(client, "3y_price_returns") - self._4y: MetricPattern4[StoredF32] = MetricPattern4(client, "4y_price_returns") - self._5y: MetricPattern4[StoredF32] = MetricPattern4(client, "5y_price_returns") - self._6m: MetricPattern4[StoredF32] = MetricPattern4(client, "6m_price_returns") - self._6y: MetricPattern4[StoredF32] = MetricPattern4(client, "6y_price_returns") - self._8y: MetricPattern4[StoredF32] = MetricPattern4(client, "8y_price_returns") - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self._10y: MetricPattern4[StoredF32] = MetricPattern4(client, '10y_price_returns') + self._1d: MetricPattern4[StoredF32] = MetricPattern4(client, '1d_price_returns') + self._1m: MetricPattern4[StoredF32] = MetricPattern4(client, '1m_price_returns') + self._1w: MetricPattern4[StoredF32] = MetricPattern4(client, '1w_price_returns') + self._1y: MetricPattern4[StoredF32] = MetricPattern4(client, '1y_price_returns') + self._2y: MetricPattern4[StoredF32] = MetricPattern4(client, '2y_price_returns') + self._3m: MetricPattern4[StoredF32] = MetricPattern4(client, '3m_price_returns') + self._3y: MetricPattern4[StoredF32] = MetricPattern4(client, '3y_price_returns') + self._4y: MetricPattern4[StoredF32] = MetricPattern4(client, '4y_price_returns') + self._5y: MetricPattern4[StoredF32] = MetricPattern4(client, '5y_price_returns') + self._6m: MetricPattern4[StoredF32] = MetricPattern4(client, '6m_price_returns') + self._6y: MetricPattern4[StoredF32] = MetricPattern4(client, '6y_price_returns') + self._8y: MetricPattern4[StoredF32] = MetricPattern4(client, '8y_price_returns') class MetricsTree_Market_Returns: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self._1d_returns_1m_sd: _1dReturns1mSdPattern = _1dReturns1mSdPattern( - client, "1d_returns_1m_sd" - ) - self._1d_returns_1w_sd: _1dReturns1mSdPattern = _1dReturns1mSdPattern( - client, "1d_returns_1w_sd" - ) - self._1d_returns_1y_sd: _1dReturns1mSdPattern = _1dReturns1mSdPattern( - client, "1d_returns_1y_sd" - ) - self.cagr: PeriodCagrPattern = PeriodCagrPattern(client, "cagr") - self.downside_1m_sd: _1dReturns1mSdPattern = _1dReturns1mSdPattern( - client, "downside_1m_sd" - ) - self.downside_1w_sd: _1dReturns1mSdPattern = _1dReturns1mSdPattern( - client, "downside_1w_sd" - ) - self.downside_1y_sd: _1dReturns1mSdPattern = _1dReturns1mSdPattern( - client, "downside_1y_sd" - ) - self.downside_returns: MetricPattern6[StoredF32] = MetricPattern6( - client, "downside_returns" - ) - self.price_returns: MetricsTree_Market_Returns_PriceReturns = ( - MetricsTree_Market_Returns_PriceReturns(client) - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self._1d_returns_1m_sd: _1dReturns1mSdPattern = _1dReturns1mSdPattern(client, '1d_returns_1m_sd') + self._1d_returns_1w_sd: _1dReturns1mSdPattern = _1dReturns1mSdPattern(client, '1d_returns_1w_sd') + self._1d_returns_1y_sd: _1dReturns1mSdPattern = _1dReturns1mSdPattern(client, '1d_returns_1y_sd') + self.cagr: PeriodCagrPattern = PeriodCagrPattern(client, 'cagr') + self.downside_1m_sd: _1dReturns1mSdPattern = _1dReturns1mSdPattern(client, 'downside_1m_sd') + self.downside_1w_sd: _1dReturns1mSdPattern = _1dReturns1mSdPattern(client, 'downside_1w_sd') + self.downside_1y_sd: _1dReturns1mSdPattern = _1dReturns1mSdPattern(client, 'downside_1y_sd') + self.downside_returns: MetricPattern6[StoredF32] = MetricPattern6(client, 'downside_returns') + self.price_returns: MetricsTree_Market_Returns_PriceReturns = MetricsTree_Market_Returns_PriceReturns(client) class MetricsTree_Market_Volatility: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.price_1m_volatility: MetricPattern4[StoredF32] = MetricPattern4( - client, "price_1m_volatility" - ) - self.price_1w_volatility: MetricPattern4[StoredF32] = MetricPattern4( - client, "price_1w_volatility" - ) - self.price_1y_volatility: MetricPattern4[StoredF32] = MetricPattern4( - client, "price_1y_volatility" - ) - self.sharpe_1m: MetricPattern6[StoredF32] = MetricPattern6(client, "sharpe_1m") - self.sharpe_1w: MetricPattern6[StoredF32] = MetricPattern6(client, "sharpe_1w") - self.sharpe_1y: MetricPattern6[StoredF32] = MetricPattern6(client, "sharpe_1y") - self.sortino_1m: MetricPattern6[StoredF32] = MetricPattern6( - client, "sortino_1m" - ) - self.sortino_1w: MetricPattern6[StoredF32] = MetricPattern6( - client, "sortino_1w" - ) - self.sortino_1y: MetricPattern6[StoredF32] = MetricPattern6( - client, "sortino_1y" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.price_1m_volatility: MetricPattern4[StoredF32] = MetricPattern4(client, 'price_1m_volatility') + self.price_1w_volatility: MetricPattern4[StoredF32] = MetricPattern4(client, 'price_1w_volatility') + self.price_1y_volatility: MetricPattern4[StoredF32] = MetricPattern4(client, 'price_1y_volatility') + self.sharpe_1m: MetricPattern6[StoredF32] = MetricPattern6(client, 'sharpe_1m') + self.sharpe_1w: MetricPattern6[StoredF32] = MetricPattern6(client, 'sharpe_1w') + self.sharpe_1y: MetricPattern6[StoredF32] = MetricPattern6(client, 'sharpe_1y') + self.sortino_1m: MetricPattern6[StoredF32] = MetricPattern6(client, 'sortino_1m') + self.sortino_1w: MetricPattern6[StoredF32] = MetricPattern6(client, 'sortino_1w') + self.sortino_1y: MetricPattern6[StoredF32] = MetricPattern6(client, 'sortino_1y') class MetricsTree_Market: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): + + def __init__(self, client: BrkClientBase, base_path: str = ''): self.ath: MetricsTree_Market_Ath = MetricsTree_Market_Ath(client) self.dca: MetricsTree_Market_Dca = MetricsTree_Market_Dca(client) - self.indicators: MetricsTree_Market_Indicators = MetricsTree_Market_Indicators( - client - ) + self.indicators: MetricsTree_Market_Indicators = MetricsTree_Market_Indicators(client) self.lookback: MetricsTree_Market_Lookback = MetricsTree_Market_Lookback(client) - self.moving_average: MetricsTree_Market_MovingAverage = ( - MetricsTree_Market_MovingAverage(client) - ) + self.moving_average: MetricsTree_Market_MovingAverage = MetricsTree_Market_MovingAverage(client) self.range: MetricsTree_Market_Range = MetricsTree_Market_Range(client) self.returns: MetricsTree_Market_Returns = MetricsTree_Market_Returns(client) - self.volatility: MetricsTree_Market_Volatility = MetricsTree_Market_Volatility( - client - ) - + self.volatility: MetricsTree_Market_Volatility = MetricsTree_Market_Volatility(client) class MetricsTree_Outputs_Count: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.total_count: CountPattern2[StoredU64] = CountPattern2( - client, "output_count" - ) - self.utxo_count: MetricPattern1[StoredU64] = MetricPattern1( - client, "exact_utxo_count" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.total_count: CountPattern2[StoredU64] = CountPattern2(client, 'output_count') + self.utxo_count: MetricPattern1[StoredU64] = MetricPattern1(client, 'exact_utxo_count') class MetricsTree_Outputs_Spent: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.txinindex: MetricPattern15[TxInIndex] = MetricPattern15( - client, "txinindex" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.txinindex: MetricPattern15[TxInIndex] = MetricPattern15(client, 'txinindex') class MetricsTree_Outputs: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): + + def __init__(self, client: BrkClientBase, base_path: str = ''): self.count: MetricsTree_Outputs_Count = MetricsTree_Outputs_Count(client) - self.first_txoutindex: MetricPattern11[TxOutIndex] = MetricPattern11( - client, "first_txoutindex" - ) - self.outputtype: MetricPattern15[OutputType] = MetricPattern15( - client, "outputtype" - ) + self.first_txoutindex: MetricPattern11[TxOutIndex] = MetricPattern11(client, 'first_txoutindex') + self.outputtype: MetricPattern15[OutputType] = MetricPattern15(client, 'outputtype') self.spent: MetricsTree_Outputs_Spent = MetricsTree_Outputs_Spent(client) - self.txindex: MetricPattern15[TxIndex] = MetricPattern15(client, "txindex") - self.typeindex: MetricPattern15[TypeIndex] = MetricPattern15( - client, "typeindex" - ) - self.value: MetricPattern15[Sats] = MetricPattern15(client, "value") - + self.txindex: MetricPattern15[TxIndex] = MetricPattern15(client, 'txindex') + self.typeindex: MetricPattern15[TypeIndex] = MetricPattern15(client, 'typeindex') + self.value: MetricPattern15[Sats] = MetricPattern15(client, 'value') class MetricsTree_Pools_Vecs: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.aaopool: AaopoolPattern = AaopoolPattern(client, "aaopool") - self.antpool: AaopoolPattern = AaopoolPattern(client, "antpool") - self.arkpool: AaopoolPattern = AaopoolPattern(client, "arkpool") - self.asicminer: AaopoolPattern = AaopoolPattern(client, "asicminer") - self.axbt: AaopoolPattern = AaopoolPattern(client, "axbt") - self.batpool: AaopoolPattern = AaopoolPattern(client, "batpool") - self.bcmonster: AaopoolPattern = AaopoolPattern(client, "bcmonster") - self.bcpoolio: AaopoolPattern = AaopoolPattern(client, "bcpoolio") - self.binancepool: AaopoolPattern = AaopoolPattern(client, "binancepool") - self.bitalo: AaopoolPattern = AaopoolPattern(client, "bitalo") - self.bitclub: AaopoolPattern = AaopoolPattern(client, "bitclub") - self.bitcoinaffiliatenetwork: AaopoolPattern = AaopoolPattern( - client, "bitcoinaffiliatenetwork" - ) - self.bitcoincom: AaopoolPattern = AaopoolPattern(client, "bitcoincom") - self.bitcoinindia: AaopoolPattern = AaopoolPattern(client, "bitcoinindia") - self.bitcoinrussia: AaopoolPattern = AaopoolPattern(client, "bitcoinrussia") - self.bitcoinukraine: AaopoolPattern = AaopoolPattern(client, "bitcoinukraine") - self.bitfarms: AaopoolPattern = AaopoolPattern(client, "bitfarms") - self.bitfufupool: AaopoolPattern = AaopoolPattern(client, "bitfufupool") - self.bitfury: AaopoolPattern = AaopoolPattern(client, "bitfury") - self.bitminter: AaopoolPattern = AaopoolPattern(client, "bitminter") - self.bitparking: AaopoolPattern = AaopoolPattern(client, "bitparking") - self.bitsolo: AaopoolPattern = AaopoolPattern(client, "bitsolo") - self.bixin: AaopoolPattern = AaopoolPattern(client, "bixin") - self.blockfills: AaopoolPattern = AaopoolPattern(client, "blockfills") - self.braiinspool: AaopoolPattern = AaopoolPattern(client, "braiinspool") - self.bravomining: AaopoolPattern = AaopoolPattern(client, "bravomining") - self.btcc: AaopoolPattern = AaopoolPattern(client, "btcc") - self.btccom: AaopoolPattern = AaopoolPattern(client, "btccom") - self.btcdig: AaopoolPattern = AaopoolPattern(client, "btcdig") - self.btcguild: AaopoolPattern = AaopoolPattern(client, "btcguild") - self.btclab: AaopoolPattern = AaopoolPattern(client, "btclab") - self.btcmp: AaopoolPattern = AaopoolPattern(client, "btcmp") - self.btcnuggets: AaopoolPattern = AaopoolPattern(client, "btcnuggets") - self.btcpoolparty: AaopoolPattern = AaopoolPattern(client, "btcpoolparty") - self.btcserv: AaopoolPattern = AaopoolPattern(client, "btcserv") - self.btctop: AaopoolPattern = AaopoolPattern(client, "btctop") - self.btpool: AaopoolPattern = AaopoolPattern(client, "btpool") - self.bwpool: AaopoolPattern = AaopoolPattern(client, "bwpool") - self.bytepool: AaopoolPattern = AaopoolPattern(client, "bytepool") - self.canoe: AaopoolPattern = AaopoolPattern(client, "canoe") - self.canoepool: AaopoolPattern = AaopoolPattern(client, "canoepool") - self.carbonnegative: AaopoolPattern = AaopoolPattern(client, "carbonnegative") - self.ckpool: AaopoolPattern = AaopoolPattern(client, "ckpool") - self.cloudhashing: AaopoolPattern = AaopoolPattern(client, "cloudhashing") - self.coinlab: AaopoolPattern = AaopoolPattern(client, "coinlab") - self.cointerra: AaopoolPattern = AaopoolPattern(client, "cointerra") - self.connectbtc: AaopoolPattern = AaopoolPattern(client, "connectbtc") - self.dcex: AaopoolPattern = AaopoolPattern(client, "dcex") - self.dcexploration: AaopoolPattern = AaopoolPattern(client, "dcexploration") - self.digitalbtc: AaopoolPattern = AaopoolPattern(client, "digitalbtc") - self.digitalxmintsy: AaopoolPattern = AaopoolPattern(client, "digitalxmintsy") - self.dpool: AaopoolPattern = AaopoolPattern(client, "dpool") - self.eclipsemc: AaopoolPattern = AaopoolPattern(client, "eclipsemc") - self.eightbaochi: AaopoolPattern = AaopoolPattern(client, "eightbaochi") - self.ekanembtc: AaopoolPattern = AaopoolPattern(client, "ekanembtc") - self.eligius: AaopoolPattern = AaopoolPattern(client, "eligius") - self.emcdpool: AaopoolPattern = AaopoolPattern(client, "emcdpool") - self.entrustcharitypool: AaopoolPattern = AaopoolPattern( - client, "entrustcharitypool" - ) - self.eobot: AaopoolPattern = AaopoolPattern(client, "eobot") - self.exxbw: AaopoolPattern = AaopoolPattern(client, "exxbw") - self.f2pool: AaopoolPattern = AaopoolPattern(client, "f2pool") - self.fiftyeightcoin: AaopoolPattern = AaopoolPattern(client, "fiftyeightcoin") - self.foundryusa: AaopoolPattern = AaopoolPattern(client, "foundryusa") - self.futurebitapollosolo: AaopoolPattern = AaopoolPattern( - client, "futurebitapollosolo" - ) - self.gbminers: AaopoolPattern = AaopoolPattern(client, "gbminers") - self.ghashio: AaopoolPattern = AaopoolPattern(client, "ghashio") - self.givemecoins: AaopoolPattern = AaopoolPattern(client, "givemecoins") - self.gogreenlight: AaopoolPattern = AaopoolPattern(client, "gogreenlight") - self.haominer: AaopoolPattern = AaopoolPattern(client, "haominer") - self.haozhuzhu: AaopoolPattern = AaopoolPattern(client, "haozhuzhu") - self.hashbx: AaopoolPattern = AaopoolPattern(client, "hashbx") - self.hashpool: AaopoolPattern = AaopoolPattern(client, "hashpool") - self.helix: AaopoolPattern = AaopoolPattern(client, "helix") - self.hhtt: AaopoolPattern = AaopoolPattern(client, "hhtt") - self.hotpool: AaopoolPattern = AaopoolPattern(client, "hotpool") - self.hummerpool: AaopoolPattern = AaopoolPattern(client, "hummerpool") - self.huobipool: AaopoolPattern = AaopoolPattern(client, "huobipool") - self.innopolistech: AaopoolPattern = AaopoolPattern(client, "innopolistech") - self.kanopool: AaopoolPattern = AaopoolPattern(client, "kanopool") - self.kncminer: AaopoolPattern = AaopoolPattern(client, "kncminer") - self.kucoinpool: AaopoolPattern = AaopoolPattern(client, "kucoinpool") - self.lubiancom: AaopoolPattern = AaopoolPattern(client, "lubiancom") - self.luckypool: AaopoolPattern = AaopoolPattern(client, "luckypool") - self.luxor: AaopoolPattern = AaopoolPattern(client, "luxor") - self.marapool: AaopoolPattern = AaopoolPattern(client, "marapool") - self.maxbtc: AaopoolPattern = AaopoolPattern(client, "maxbtc") - self.maxipool: AaopoolPattern = AaopoolPattern(client, "maxipool") - self.megabigpower: AaopoolPattern = AaopoolPattern(client, "megabigpower") - self.minerium: AaopoolPattern = AaopoolPattern(client, "minerium") - self.miningcity: AaopoolPattern = AaopoolPattern(client, "miningcity") - self.miningdutch: AaopoolPattern = AaopoolPattern(client, "miningdutch") - self.miningkings: AaopoolPattern = AaopoolPattern(client, "miningkings") - self.miningsquared: AaopoolPattern = AaopoolPattern(client, "miningsquared") - self.mmpool: AaopoolPattern = AaopoolPattern(client, "mmpool") - self.mtred: AaopoolPattern = AaopoolPattern(client, "mtred") - self.multicoinco: AaopoolPattern = AaopoolPattern(client, "multicoinco") - self.multipool: AaopoolPattern = AaopoolPattern(client, "multipool") - self.mybtccoinpool: AaopoolPattern = AaopoolPattern(client, "mybtccoinpool") - self.neopool: AaopoolPattern = AaopoolPattern(client, "neopool") - self.nexious: AaopoolPattern = AaopoolPattern(client, "nexious") - self.nicehash: AaopoolPattern = AaopoolPattern(client, "nicehash") - self.nmcbit: AaopoolPattern = AaopoolPattern(client, "nmcbit") - self.novablock: AaopoolPattern = AaopoolPattern(client, "novablock") - self.ocean: AaopoolPattern = AaopoolPattern(client, "ocean") - self.okexpool: AaopoolPattern = AaopoolPattern(client, "okexpool") - self.okkong: AaopoolPattern = AaopoolPattern(client, "okkong") - self.okminer: AaopoolPattern = AaopoolPattern(client, "okminer") - self.okpooltop: AaopoolPattern = AaopoolPattern(client, "okpooltop") - self.onehash: AaopoolPattern = AaopoolPattern(client, "onehash") - self.onem1x: AaopoolPattern = AaopoolPattern(client, "onem1x") - self.onethash: AaopoolPattern = AaopoolPattern(client, "onethash") - self.ozcoin: AaopoolPattern = AaopoolPattern(client, "ozcoin") - self.parasite: AaopoolPattern = AaopoolPattern(client, "parasite") - self.patels: AaopoolPattern = AaopoolPattern(client, "patels") - self.pegapool: AaopoolPattern = AaopoolPattern(client, "pegapool") - self.phashio: AaopoolPattern = AaopoolPattern(client, "phashio") - self.phoenix: AaopoolPattern = AaopoolPattern(client, "phoenix") - self.polmine: AaopoolPattern = AaopoolPattern(client, "polmine") - self.pool175btc: AaopoolPattern = AaopoolPattern(client, "pool175btc") - self.pool50btc: AaopoolPattern = AaopoolPattern(client, "pool50btc") - self.poolin: AaopoolPattern = AaopoolPattern(client, "poolin") - self.portlandhodl: AaopoolPattern = AaopoolPattern(client, "portlandhodl") - self.publicpool: AaopoolPattern = AaopoolPattern(client, "publicpool") - self.purebtccom: AaopoolPattern = AaopoolPattern(client, "purebtccom") - self.rawpool: AaopoolPattern = AaopoolPattern(client, "rawpool") - self.rigpool: AaopoolPattern = AaopoolPattern(client, "rigpool") - self.sbicrypto: AaopoolPattern = AaopoolPattern(client, "sbicrypto") - self.secpool: AaopoolPattern = AaopoolPattern(client, "secpool") - self.secretsuperstar: AaopoolPattern = AaopoolPattern(client, "secretsuperstar") - self.sevenpool: AaopoolPattern = AaopoolPattern(client, "sevenpool") - self.shawnp0wers: AaopoolPattern = AaopoolPattern(client, "shawnp0wers") - self.sigmapoolcom: AaopoolPattern = AaopoolPattern(client, "sigmapoolcom") - self.simplecoinus: AaopoolPattern = AaopoolPattern(client, "simplecoinus") - self.solock: AaopoolPattern = AaopoolPattern(client, "solock") - self.spiderpool: AaopoolPattern = AaopoolPattern(client, "spiderpool") - self.stminingcorp: AaopoolPattern = AaopoolPattern(client, "stminingcorp") - self.tangpool: AaopoolPattern = AaopoolPattern(client, "tangpool") - self.tatmaspool: AaopoolPattern = AaopoolPattern(client, "tatmaspool") - self.tbdice: AaopoolPattern = AaopoolPattern(client, "tbdice") - self.telco214: AaopoolPattern = AaopoolPattern(client, "telco214") - self.terrapool: AaopoolPattern = AaopoolPattern(client, "terrapool") - self.tiger: AaopoolPattern = AaopoolPattern(client, "tiger") - self.tigerpoolnet: AaopoolPattern = AaopoolPattern(client, "tigerpoolnet") - self.titan: AaopoolPattern = AaopoolPattern(client, "titan") - self.transactioncoinmining: AaopoolPattern = AaopoolPattern( - client, "transactioncoinmining" - ) - self.trickysbtcpool: AaopoolPattern = AaopoolPattern(client, "trickysbtcpool") - self.triplemining: AaopoolPattern = AaopoolPattern(client, "triplemining") - self.twentyoneinc: AaopoolPattern = AaopoolPattern(client, "twentyoneinc") - self.ultimuspool: AaopoolPattern = AaopoolPattern(client, "ultimuspool") - self.unknown: AaopoolPattern = AaopoolPattern(client, "unknown") - self.unomp: AaopoolPattern = AaopoolPattern(client, "unomp") - self.viabtc: AaopoolPattern = AaopoolPattern(client, "viabtc") - self.waterhole: AaopoolPattern = AaopoolPattern(client, "waterhole") - self.wayicn: AaopoolPattern = AaopoolPattern(client, "wayicn") - self.whitepool: AaopoolPattern = AaopoolPattern(client, "whitepool") - self.wk057: AaopoolPattern = AaopoolPattern(client, "wk057") - self.yourbtcnet: AaopoolPattern = AaopoolPattern(client, "yourbtcnet") - self.zulupool: AaopoolPattern = AaopoolPattern(client, "zulupool") - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.aaopool: AaopoolPattern = AaopoolPattern(client, 'aaopool') + self.antpool: AaopoolPattern = AaopoolPattern(client, 'antpool') + self.arkpool: AaopoolPattern = AaopoolPattern(client, 'arkpool') + self.asicminer: AaopoolPattern = AaopoolPattern(client, 'asicminer') + self.axbt: AaopoolPattern = AaopoolPattern(client, 'axbt') + self.batpool: AaopoolPattern = AaopoolPattern(client, 'batpool') + self.bcmonster: AaopoolPattern = AaopoolPattern(client, 'bcmonster') + self.bcpoolio: AaopoolPattern = AaopoolPattern(client, 'bcpoolio') + self.binancepool: AaopoolPattern = AaopoolPattern(client, 'binancepool') + self.bitalo: AaopoolPattern = AaopoolPattern(client, 'bitalo') + self.bitclub: AaopoolPattern = AaopoolPattern(client, 'bitclub') + self.bitcoinaffiliatenetwork: AaopoolPattern = AaopoolPattern(client, 'bitcoinaffiliatenetwork') + self.bitcoincom: AaopoolPattern = AaopoolPattern(client, 'bitcoincom') + self.bitcoinindia: AaopoolPattern = AaopoolPattern(client, 'bitcoinindia') + self.bitcoinrussia: AaopoolPattern = AaopoolPattern(client, 'bitcoinrussia') + self.bitcoinukraine: AaopoolPattern = AaopoolPattern(client, 'bitcoinukraine') + self.bitfarms: AaopoolPattern = AaopoolPattern(client, 'bitfarms') + self.bitfufupool: AaopoolPattern = AaopoolPattern(client, 'bitfufupool') + self.bitfury: AaopoolPattern = AaopoolPattern(client, 'bitfury') + self.bitminter: AaopoolPattern = AaopoolPattern(client, 'bitminter') + self.bitparking: AaopoolPattern = AaopoolPattern(client, 'bitparking') + self.bitsolo: AaopoolPattern = AaopoolPattern(client, 'bitsolo') + self.bixin: AaopoolPattern = AaopoolPattern(client, 'bixin') + self.blockfills: AaopoolPattern = AaopoolPattern(client, 'blockfills') + self.braiinspool: AaopoolPattern = AaopoolPattern(client, 'braiinspool') + self.bravomining: AaopoolPattern = AaopoolPattern(client, 'bravomining') + self.btcc: AaopoolPattern = AaopoolPattern(client, 'btcc') + self.btccom: AaopoolPattern = AaopoolPattern(client, 'btccom') + self.btcdig: AaopoolPattern = AaopoolPattern(client, 'btcdig') + self.btcguild: AaopoolPattern = AaopoolPattern(client, 'btcguild') + self.btclab: AaopoolPattern = AaopoolPattern(client, 'btclab') + self.btcmp: AaopoolPattern = AaopoolPattern(client, 'btcmp') + self.btcnuggets: AaopoolPattern = AaopoolPattern(client, 'btcnuggets') + self.btcpoolparty: AaopoolPattern = AaopoolPattern(client, 'btcpoolparty') + self.btcserv: AaopoolPattern = AaopoolPattern(client, 'btcserv') + self.btctop: AaopoolPattern = AaopoolPattern(client, 'btctop') + self.btpool: AaopoolPattern = AaopoolPattern(client, 'btpool') + self.bwpool: AaopoolPattern = AaopoolPattern(client, 'bwpool') + self.bytepool: AaopoolPattern = AaopoolPattern(client, 'bytepool') + self.canoe: AaopoolPattern = AaopoolPattern(client, 'canoe') + self.canoepool: AaopoolPattern = AaopoolPattern(client, 'canoepool') + self.carbonnegative: AaopoolPattern = AaopoolPattern(client, 'carbonnegative') + self.ckpool: AaopoolPattern = AaopoolPattern(client, 'ckpool') + self.cloudhashing: AaopoolPattern = AaopoolPattern(client, 'cloudhashing') + self.coinlab: AaopoolPattern = AaopoolPattern(client, 'coinlab') + self.cointerra: AaopoolPattern = AaopoolPattern(client, 'cointerra') + self.connectbtc: AaopoolPattern = AaopoolPattern(client, 'connectbtc') + self.dcex: AaopoolPattern = AaopoolPattern(client, 'dcex') + self.dcexploration: AaopoolPattern = AaopoolPattern(client, 'dcexploration') + self.digitalbtc: AaopoolPattern = AaopoolPattern(client, 'digitalbtc') + self.digitalxmintsy: AaopoolPattern = AaopoolPattern(client, 'digitalxmintsy') + self.dpool: AaopoolPattern = AaopoolPattern(client, 'dpool') + self.eclipsemc: AaopoolPattern = AaopoolPattern(client, 'eclipsemc') + self.eightbaochi: AaopoolPattern = AaopoolPattern(client, 'eightbaochi') + self.ekanembtc: AaopoolPattern = AaopoolPattern(client, 'ekanembtc') + self.eligius: AaopoolPattern = AaopoolPattern(client, 'eligius') + self.emcdpool: AaopoolPattern = AaopoolPattern(client, 'emcdpool') + self.entrustcharitypool: AaopoolPattern = AaopoolPattern(client, 'entrustcharitypool') + self.eobot: AaopoolPattern = AaopoolPattern(client, 'eobot') + self.exxbw: AaopoolPattern = AaopoolPattern(client, 'exxbw') + self.f2pool: AaopoolPattern = AaopoolPattern(client, 'f2pool') + self.fiftyeightcoin: AaopoolPattern = AaopoolPattern(client, 'fiftyeightcoin') + self.foundryusa: AaopoolPattern = AaopoolPattern(client, 'foundryusa') + self.futurebitapollosolo: AaopoolPattern = AaopoolPattern(client, 'futurebitapollosolo') + self.gbminers: AaopoolPattern = AaopoolPattern(client, 'gbminers') + self.ghashio: AaopoolPattern = AaopoolPattern(client, 'ghashio') + self.givemecoins: AaopoolPattern = AaopoolPattern(client, 'givemecoins') + self.gogreenlight: AaopoolPattern = AaopoolPattern(client, 'gogreenlight') + self.haominer: AaopoolPattern = AaopoolPattern(client, 'haominer') + self.haozhuzhu: AaopoolPattern = AaopoolPattern(client, 'haozhuzhu') + self.hashbx: AaopoolPattern = AaopoolPattern(client, 'hashbx') + self.hashpool: AaopoolPattern = AaopoolPattern(client, 'hashpool') + self.helix: AaopoolPattern = AaopoolPattern(client, 'helix') + self.hhtt: AaopoolPattern = AaopoolPattern(client, 'hhtt') + self.hotpool: AaopoolPattern = AaopoolPattern(client, 'hotpool') + self.hummerpool: AaopoolPattern = AaopoolPattern(client, 'hummerpool') + self.huobipool: AaopoolPattern = AaopoolPattern(client, 'huobipool') + self.innopolistech: AaopoolPattern = AaopoolPattern(client, 'innopolistech') + self.kanopool: AaopoolPattern = AaopoolPattern(client, 'kanopool') + self.kncminer: AaopoolPattern = AaopoolPattern(client, 'kncminer') + self.kucoinpool: AaopoolPattern = AaopoolPattern(client, 'kucoinpool') + self.lubiancom: AaopoolPattern = AaopoolPattern(client, 'lubiancom') + self.luckypool: AaopoolPattern = AaopoolPattern(client, 'luckypool') + self.luxor: AaopoolPattern = AaopoolPattern(client, 'luxor') + self.marapool: AaopoolPattern = AaopoolPattern(client, 'marapool') + self.maxbtc: AaopoolPattern = AaopoolPattern(client, 'maxbtc') + self.maxipool: AaopoolPattern = AaopoolPattern(client, 'maxipool') + self.megabigpower: AaopoolPattern = AaopoolPattern(client, 'megabigpower') + self.minerium: AaopoolPattern = AaopoolPattern(client, 'minerium') + self.miningcity: AaopoolPattern = AaopoolPattern(client, 'miningcity') + self.miningdutch: AaopoolPattern = AaopoolPattern(client, 'miningdutch') + self.miningkings: AaopoolPattern = AaopoolPattern(client, 'miningkings') + self.miningsquared: AaopoolPattern = AaopoolPattern(client, 'miningsquared') + self.mmpool: AaopoolPattern = AaopoolPattern(client, 'mmpool') + self.mtred: AaopoolPattern = AaopoolPattern(client, 'mtred') + self.multicoinco: AaopoolPattern = AaopoolPattern(client, 'multicoinco') + self.multipool: AaopoolPattern = AaopoolPattern(client, 'multipool') + self.mybtccoinpool: AaopoolPattern = AaopoolPattern(client, 'mybtccoinpool') + self.neopool: AaopoolPattern = AaopoolPattern(client, 'neopool') + self.nexious: AaopoolPattern = AaopoolPattern(client, 'nexious') + self.nicehash: AaopoolPattern = AaopoolPattern(client, 'nicehash') + self.nmcbit: AaopoolPattern = AaopoolPattern(client, 'nmcbit') + self.novablock: AaopoolPattern = AaopoolPattern(client, 'novablock') + self.ocean: AaopoolPattern = AaopoolPattern(client, 'ocean') + self.okexpool: AaopoolPattern = AaopoolPattern(client, 'okexpool') + self.okkong: AaopoolPattern = AaopoolPattern(client, 'okkong') + self.okminer: AaopoolPattern = AaopoolPattern(client, 'okminer') + self.okpooltop: AaopoolPattern = AaopoolPattern(client, 'okpooltop') + self.onehash: AaopoolPattern = AaopoolPattern(client, 'onehash') + self.onem1x: AaopoolPattern = AaopoolPattern(client, 'onem1x') + self.onethash: AaopoolPattern = AaopoolPattern(client, 'onethash') + self.ozcoin: AaopoolPattern = AaopoolPattern(client, 'ozcoin') + self.parasite: AaopoolPattern = AaopoolPattern(client, 'parasite') + self.patels: AaopoolPattern = AaopoolPattern(client, 'patels') + self.pegapool: AaopoolPattern = AaopoolPattern(client, 'pegapool') + self.phashio: AaopoolPattern = AaopoolPattern(client, 'phashio') + self.phoenix: AaopoolPattern = AaopoolPattern(client, 'phoenix') + self.polmine: AaopoolPattern = AaopoolPattern(client, 'polmine') + self.pool175btc: AaopoolPattern = AaopoolPattern(client, 'pool175btc') + self.pool50btc: AaopoolPattern = AaopoolPattern(client, 'pool50btc') + self.poolin: AaopoolPattern = AaopoolPattern(client, 'poolin') + self.portlandhodl: AaopoolPattern = AaopoolPattern(client, 'portlandhodl') + self.publicpool: AaopoolPattern = AaopoolPattern(client, 'publicpool') + self.purebtccom: AaopoolPattern = AaopoolPattern(client, 'purebtccom') + self.rawpool: AaopoolPattern = AaopoolPattern(client, 'rawpool') + self.rigpool: AaopoolPattern = AaopoolPattern(client, 'rigpool') + self.sbicrypto: AaopoolPattern = AaopoolPattern(client, 'sbicrypto') + self.secpool: AaopoolPattern = AaopoolPattern(client, 'secpool') + self.secretsuperstar: AaopoolPattern = AaopoolPattern(client, 'secretsuperstar') + self.sevenpool: AaopoolPattern = AaopoolPattern(client, 'sevenpool') + self.shawnp0wers: AaopoolPattern = AaopoolPattern(client, 'shawnp0wers') + self.sigmapoolcom: AaopoolPattern = AaopoolPattern(client, 'sigmapoolcom') + self.simplecoinus: AaopoolPattern = AaopoolPattern(client, 'simplecoinus') + self.solock: AaopoolPattern = AaopoolPattern(client, 'solock') + self.spiderpool: AaopoolPattern = AaopoolPattern(client, 'spiderpool') + self.stminingcorp: AaopoolPattern = AaopoolPattern(client, 'stminingcorp') + self.tangpool: AaopoolPattern = AaopoolPattern(client, 'tangpool') + self.tatmaspool: AaopoolPattern = AaopoolPattern(client, 'tatmaspool') + self.tbdice: AaopoolPattern = AaopoolPattern(client, 'tbdice') + self.telco214: AaopoolPattern = AaopoolPattern(client, 'telco214') + self.terrapool: AaopoolPattern = AaopoolPattern(client, 'terrapool') + self.tiger: AaopoolPattern = AaopoolPattern(client, 'tiger') + self.tigerpoolnet: AaopoolPattern = AaopoolPattern(client, 'tigerpoolnet') + self.titan: AaopoolPattern = AaopoolPattern(client, 'titan') + self.transactioncoinmining: AaopoolPattern = AaopoolPattern(client, 'transactioncoinmining') + self.trickysbtcpool: AaopoolPattern = AaopoolPattern(client, 'trickysbtcpool') + self.triplemining: AaopoolPattern = AaopoolPattern(client, 'triplemining') + self.twentyoneinc: AaopoolPattern = AaopoolPattern(client, 'twentyoneinc') + self.ultimuspool: AaopoolPattern = AaopoolPattern(client, 'ultimuspool') + self.unknown: AaopoolPattern = AaopoolPattern(client, 'unknown') + self.unomp: AaopoolPattern = AaopoolPattern(client, 'unomp') + self.viabtc: AaopoolPattern = AaopoolPattern(client, 'viabtc') + self.waterhole: AaopoolPattern = AaopoolPattern(client, 'waterhole') + self.wayicn: AaopoolPattern = AaopoolPattern(client, 'wayicn') + self.whitepool: AaopoolPattern = AaopoolPattern(client, 'whitepool') + self.wk057: AaopoolPattern = AaopoolPattern(client, 'wk057') + self.yourbtcnet: AaopoolPattern = AaopoolPattern(client, 'yourbtcnet') + self.zulupool: AaopoolPattern = AaopoolPattern(client, 'zulupool') class MetricsTree_Pools: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.height_to_pool: MetricPattern11[PoolSlug] = MetricPattern11(client, "pool") + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.height_to_pool: MetricPattern11[PoolSlug] = MetricPattern11(client, 'pool') self.vecs: MetricsTree_Pools_Vecs = MetricsTree_Pools_Vecs(client) - class MetricsTree_Positions: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.block_position: MetricPattern11[BlkPosition] = MetricPattern11( - client, "position" - ) - self.tx_position: MetricPattern27[BlkPosition] = MetricPattern27( - client, "position" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.block_position: MetricPattern11[BlkPosition] = MetricPattern11(client, 'position') + self.tx_position: MetricPattern27[BlkPosition] = MetricPattern27(client, 'position') class MetricsTree_Price_Cents_Split: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.close: MetricPattern5[Cents] = MetricPattern5(client, "price_close_cents") - self.high: MetricPattern5[Cents] = MetricPattern5(client, "price_high_cents") - self.low: MetricPattern5[Cents] = MetricPattern5(client, "price_low_cents") - self.open: MetricPattern5[Cents] = MetricPattern5(client, "price_open_cents") - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.close: MetricPattern5[Cents] = MetricPattern5(client, 'price_close_cents') + self.high: MetricPattern5[Cents] = MetricPattern5(client, 'price_high_cents') + self.low: MetricPattern5[Cents] = MetricPattern5(client, 'price_low_cents') + self.open: MetricPattern5[Cents] = MetricPattern5(client, 'price_open_cents') class MetricsTree_Price_Cents: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.ohlc: MetricPattern5[OHLCCents] = MetricPattern5(client, "ohlc_cents") - self.split: MetricsTree_Price_Cents_Split = MetricsTree_Price_Cents_Split( - client - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.ohlc: MetricPattern5[OHLCCents] = MetricPattern5(client, 'ohlc_cents') + self.split: MetricsTree_Price_Cents_Split = MetricsTree_Price_Cents_Split(client) class MetricsTree_Price_Sats: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.ohlc: MetricPattern1[OHLCSats] = MetricPattern1(client, "price_ohlc_sats") - self.split: SplitPattern2[Sats] = SplitPattern2(client, "price_sats") - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.ohlc: MetricPattern1[OHLCSats] = MetricPattern1(client, 'price_ohlc_sats') + self.split: SplitPattern2[Sats] = SplitPattern2(client, 'price_sats') class MetricsTree_Price_Usd: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.ohlc: MetricPattern1[OHLCDollars] = MetricPattern1(client, "price_ohlc") - self.split: SplitPattern2[Dollars] = SplitPattern2(client, "price") - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.ohlc: MetricPattern1[OHLCDollars] = MetricPattern1(client, 'price_ohlc') + self.split: SplitPattern2[Dollars] = SplitPattern2(client, 'price') class MetricsTree_Price: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): + + def __init__(self, client: BrkClientBase, base_path: str = ''): self.cents: MetricsTree_Price_Cents = MetricsTree_Price_Cents(client) self.sats: MetricsTree_Price_Sats = MetricsTree_Price_Sats(client) self.usd: MetricsTree_Price_Usd = MetricsTree_Price_Usd(client) - class MetricsTree_Scripts_Count: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.emptyoutput: DollarsPattern[StoredU64] = DollarsPattern( - client, "emptyoutput_count" - ) - self.opreturn: DollarsPattern[StoredU64] = DollarsPattern( - client, "opreturn_count" - ) - self.p2a: DollarsPattern[StoredU64] = DollarsPattern(client, "p2a_count") - self.p2ms: DollarsPattern[StoredU64] = DollarsPattern(client, "p2ms_count") - self.p2pk33: DollarsPattern[StoredU64] = DollarsPattern(client, "p2pk33_count") - self.p2pk65: DollarsPattern[StoredU64] = DollarsPattern(client, "p2pk65_count") - self.p2pkh: DollarsPattern[StoredU64] = DollarsPattern(client, "p2pkh_count") - self.p2sh: DollarsPattern[StoredU64] = DollarsPattern(client, "p2sh_count") - self.p2tr: DollarsPattern[StoredU64] = DollarsPattern(client, "p2tr_count") - self.p2wpkh: DollarsPattern[StoredU64] = DollarsPattern(client, "p2wpkh_count") - self.p2wsh: DollarsPattern[StoredU64] = DollarsPattern(client, "p2wsh_count") - self.segwit: DollarsPattern[StoredU64] = DollarsPattern(client, "segwit_count") - self.segwit_adoption: SegwitAdoptionPattern = SegwitAdoptionPattern( - client, "segwit_adoption" - ) - self.taproot_adoption: SegwitAdoptionPattern = SegwitAdoptionPattern( - client, "taproot_adoption" - ) - self.unknownoutput: DollarsPattern[StoredU64] = DollarsPattern( - client, "unknownoutput_count" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.emptyoutput: DollarsPattern[StoredU64] = DollarsPattern(client, 'emptyoutput_count') + self.opreturn: DollarsPattern[StoredU64] = DollarsPattern(client, 'opreturn_count') + self.p2a: DollarsPattern[StoredU64] = DollarsPattern(client, 'p2a_count') + self.p2ms: DollarsPattern[StoredU64] = DollarsPattern(client, 'p2ms_count') + self.p2pk33: DollarsPattern[StoredU64] = DollarsPattern(client, 'p2pk33_count') + self.p2pk65: DollarsPattern[StoredU64] = DollarsPattern(client, 'p2pk65_count') + self.p2pkh: DollarsPattern[StoredU64] = DollarsPattern(client, 'p2pkh_count') + self.p2sh: DollarsPattern[StoredU64] = DollarsPattern(client, 'p2sh_count') + self.p2tr: DollarsPattern[StoredU64] = DollarsPattern(client, 'p2tr_count') + self.p2wpkh: DollarsPattern[StoredU64] = DollarsPattern(client, 'p2wpkh_count') + self.p2wsh: DollarsPattern[StoredU64] = DollarsPattern(client, 'p2wsh_count') + self.segwit: DollarsPattern[StoredU64] = DollarsPattern(client, 'segwit_count') + self.segwit_adoption: SegwitAdoptionPattern = SegwitAdoptionPattern(client, 'segwit_adoption') + self.taproot_adoption: SegwitAdoptionPattern = SegwitAdoptionPattern(client, 'taproot_adoption') + self.unknownoutput: DollarsPattern[StoredU64] = DollarsPattern(client, 'unknownoutput_count') class MetricsTree_Scripts_Value: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.opreturn: CoinbasePattern = CoinbasePattern(client, "opreturn_value") - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.opreturn: CoinbasePattern = CoinbasePattern(client, 'opreturn_value') class MetricsTree_Scripts: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): + + def __init__(self, client: BrkClientBase, base_path: str = ''): self.count: MetricsTree_Scripts_Count = MetricsTree_Scripts_Count(client) - self.empty_to_txindex: MetricPattern9[TxIndex] = MetricPattern9( - client, "txindex" - ) - self.first_emptyoutputindex: MetricPattern11[EmptyOutputIndex] = ( - MetricPattern11(client, "first_emptyoutputindex") - ) - self.first_opreturnindex: MetricPattern11[OpReturnIndex] = MetricPattern11( - client, "first_opreturnindex" - ) - self.first_p2msoutputindex: MetricPattern11[P2MSOutputIndex] = MetricPattern11( - client, "first_p2msoutputindex" - ) - self.first_unknownoutputindex: MetricPattern11[UnknownOutputIndex] = ( - MetricPattern11(client, "first_unknownoutputindex") - ) - self.opreturn_to_txindex: MetricPattern14[TxIndex] = MetricPattern14( - client, "txindex" - ) - self.p2ms_to_txindex: MetricPattern17[TxIndex] = MetricPattern17( - client, "txindex" - ) - self.unknown_to_txindex: MetricPattern28[TxIndex] = MetricPattern28( - client, "txindex" - ) + self.empty_to_txindex: MetricPattern9[TxIndex] = MetricPattern9(client, 'txindex') + self.first_emptyoutputindex: MetricPattern11[EmptyOutputIndex] = MetricPattern11(client, 'first_emptyoutputindex') + self.first_opreturnindex: MetricPattern11[OpReturnIndex] = MetricPattern11(client, 'first_opreturnindex') + self.first_p2msoutputindex: MetricPattern11[P2MSOutputIndex] = MetricPattern11(client, 'first_p2msoutputindex') + self.first_unknownoutputindex: MetricPattern11[UnknownOutputIndex] = MetricPattern11(client, 'first_unknownoutputindex') + self.opreturn_to_txindex: MetricPattern14[TxIndex] = MetricPattern14(client, 'txindex') + self.p2ms_to_txindex: MetricPattern17[TxIndex] = MetricPattern17(client, 'txindex') + self.unknown_to_txindex: MetricPattern28[TxIndex] = MetricPattern28(client, 'txindex') self.value: MetricsTree_Scripts_Value = MetricsTree_Scripts_Value(client) - class MetricsTree_Supply_Burned: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.opreturn: UnclaimedRewardsPattern = UnclaimedRewardsPattern( - client, "opreturn_supply" - ) - self.unspendable: UnclaimedRewardsPattern = UnclaimedRewardsPattern( - client, "unspendable_supply" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.opreturn: UnclaimedRewardsPattern = UnclaimedRewardsPattern(client, 'opreturn_supply') + self.unspendable: UnclaimedRewardsPattern = UnclaimedRewardsPattern(client, 'unspendable_supply') class MetricsTree_Supply_Circulating: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.bitcoin: MetricPattern3[Bitcoin] = MetricPattern3( - client, "circulating_supply_btc" - ) - self.dollars: MetricPattern3[Dollars] = MetricPattern3( - client, "circulating_supply_usd" - ) - self.sats: MetricPattern3[Sats] = MetricPattern3(client, "circulating_supply") - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.bitcoin: MetricPattern3[Bitcoin] = MetricPattern3(client, 'circulating_supply_btc') + self.dollars: MetricPattern3[Dollars] = MetricPattern3(client, 'circulating_supply_usd') + self.sats: MetricPattern3[Sats] = MetricPattern3(client, 'circulating_supply') class MetricsTree_Supply_Velocity: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.btc: MetricPattern4[StoredF64] = MetricPattern4(client, "btc_velocity") - self.usd: MetricPattern4[StoredF64] = MetricPattern4(client, "usd_velocity") - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.btc: MetricPattern4[StoredF64] = MetricPattern4(client, 'btc_velocity') + self.usd: MetricPattern4[StoredF64] = MetricPattern4(client, 'usd_velocity') class MetricsTree_Supply: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): + + def __init__(self, client: BrkClientBase, base_path: str = ''): self.burned: MetricsTree_Supply_Burned = MetricsTree_Supply_Burned(client) - self.circulating: MetricsTree_Supply_Circulating = ( - MetricsTree_Supply_Circulating(client) - ) - self.inflation: MetricPattern4[StoredF32] = MetricPattern4( - client, "inflation_rate" - ) - self.market_cap: MetricPattern1[Dollars] = MetricPattern1(client, "market_cap") + self.circulating: MetricsTree_Supply_Circulating = MetricsTree_Supply_Circulating(client) + self.inflation: MetricPattern4[StoredF32] = MetricPattern4(client, 'inflation_rate') + self.market_cap: MetricPattern1[Dollars] = MetricPattern1(client, 'market_cap') self.velocity: MetricsTree_Supply_Velocity = MetricsTree_Supply_Velocity(client) - class MetricsTree_Transactions_Count: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.is_coinbase: MetricPattern27[StoredBool] = MetricPattern27( - client, "is_coinbase" - ) - self.tx_count: DollarsPattern[StoredU64] = DollarsPattern(client, "tx_count") - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.is_coinbase: MetricPattern27[StoredBool] = MetricPattern27(client, 'is_coinbase') + self.tx_count: DollarsPattern[StoredU64] = DollarsPattern(client, 'tx_count') class MetricsTree_Transactions_Fees_Fee_Dollars: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.average: MetricPattern1[Dollars] = MetricPattern1( - client, "fee_usd_average" - ) - self.cumulative: MetricPattern2[Dollars] = MetricPattern2( - client, "fee_usd_cumulative" - ) - self.height_cumulative: MetricPattern11[Dollars] = MetricPattern11( - client, "fee_usd_cumulative" - ) - self.max: MetricPattern1[Dollars] = MetricPattern1(client, "fee_usd_max") - self.median: MetricPattern11[Dollars] = MetricPattern11( - client, "fee_usd_median" - ) - self.min: MetricPattern1[Dollars] = MetricPattern1(client, "fee_usd_min") - self.pct10: MetricPattern11[Dollars] = MetricPattern11(client, "fee_usd_pct10") - self.pct25: MetricPattern11[Dollars] = MetricPattern11(client, "fee_usd_pct25") - self.pct75: MetricPattern11[Dollars] = MetricPattern11(client, "fee_usd_pct75") - self.pct90: MetricPattern11[Dollars] = MetricPattern11(client, "fee_usd_pct90") - self.sum: MetricPattern1[Dollars] = MetricPattern1(client, "fee_usd_sum") - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.average: MetricPattern1[Dollars] = MetricPattern1(client, 'fee_usd_average') + self.cumulative: MetricPattern2[Dollars] = MetricPattern2(client, 'fee_usd_cumulative') + self.height_cumulative: MetricPattern11[Dollars] = MetricPattern11(client, 'fee_usd_cumulative') + self.max: MetricPattern1[Dollars] = MetricPattern1(client, 'fee_usd_max') + self.median: MetricPattern11[Dollars] = MetricPattern11(client, 'fee_usd_median') + self.min: MetricPattern1[Dollars] = MetricPattern1(client, 'fee_usd_min') + self.pct10: MetricPattern11[Dollars] = MetricPattern11(client, 'fee_usd_pct10') + self.pct25: MetricPattern11[Dollars] = MetricPattern11(client, 'fee_usd_pct25') + self.pct75: MetricPattern11[Dollars] = MetricPattern11(client, 'fee_usd_pct75') + self.pct90: MetricPattern11[Dollars] = MetricPattern11(client, 'fee_usd_pct90') + self.sum: MetricPattern1[Dollars] = MetricPattern1(client, 'fee_usd_sum') class MetricsTree_Transactions_Fees_Fee: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.bitcoin: CountPattern2[Bitcoin] = CountPattern2(client, "fee_btc") - self.dollars: MetricsTree_Transactions_Fees_Fee_Dollars = ( - MetricsTree_Transactions_Fees_Fee_Dollars(client) - ) - self.sats: CountPattern2[Sats] = CountPattern2(client, "fee") - self.txindex: MetricPattern27[Sats] = MetricPattern27(client, "fee") - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.bitcoin: CountPattern2[Bitcoin] = CountPattern2(client, 'fee_btc') + self.dollars: MetricsTree_Transactions_Fees_Fee_Dollars = MetricsTree_Transactions_Fees_Fee_Dollars(client) + self.sats: CountPattern2[Sats] = CountPattern2(client, 'fee') + self.txindex: MetricPattern27[Sats] = MetricPattern27(client, 'fee') class MetricsTree_Transactions_Fees: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.fee: MetricsTree_Transactions_Fees_Fee = MetricsTree_Transactions_Fees_Fee( - client - ) - self.fee_rate: FeeRatePattern[FeeRate] = FeeRatePattern(client, "fee_rate") - self.input_value: MetricPattern27[Sats] = MetricPattern27(client, "input_value") - self.output_value: MetricPattern27[Sats] = MetricPattern27( - client, "output_value" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.fee: MetricsTree_Transactions_Fees_Fee = MetricsTree_Transactions_Fees_Fee(client) + self.fee_rate: FeeRatePattern[FeeRate] = FeeRatePattern(client, 'fee_rate') + self.input_value: MetricPattern27[Sats] = MetricPattern27(client, 'input_value') + self.output_value: MetricPattern27[Sats] = MetricPattern27(client, 'output_value') class MetricsTree_Transactions_Size: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.vsize: FeeRatePattern[VSize] = FeeRatePattern(client, "tx_vsize_average") - self.weight: FeeRatePattern[Weight] = FeeRatePattern( - client, "tx_weight_average" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.vsize: FeeRatePattern[VSize] = FeeRatePattern(client, 'tx_vsize_average') + self.weight: FeeRatePattern[Weight] = FeeRatePattern(client, 'tx_weight_average') class MetricsTree_Transactions_Versions: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.v1: BlockCountPattern[StoredU64] = BlockCountPattern(client, "tx_v1") - self.v2: BlockCountPattern[StoredU64] = BlockCountPattern(client, "tx_v2") - self.v3: BlockCountPattern[StoredU64] = BlockCountPattern(client, "tx_v3") - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.v1: BlockCountPattern[StoredU64] = BlockCountPattern(client, 'tx_v1') + self.v2: BlockCountPattern[StoredU64] = BlockCountPattern(client, 'tx_v2') + self.v3: BlockCountPattern[StoredU64] = BlockCountPattern(client, 'tx_v3') class MetricsTree_Transactions_Volume: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.annualized_volume: _2015Pattern = _2015Pattern(client, "annualized_volume") - self.inputs_per_sec: MetricPattern4[StoredF32] = MetricPattern4( - client, "inputs_per_sec" - ) - self.outputs_per_sec: MetricPattern4[StoredF32] = MetricPattern4( - client, "outputs_per_sec" - ) - self.sent_sum: ActiveSupplyPattern = ActiveSupplyPattern(client, "sent_sum") - self.tx_per_sec: MetricPattern4[StoredF32] = MetricPattern4( - client, "tx_per_sec" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.annualized_volume: _2015Pattern = _2015Pattern(client, 'annualized_volume') + self.inputs_per_sec: MetricPattern4[StoredF32] = MetricPattern4(client, 'inputs_per_sec') + self.outputs_per_sec: MetricPattern4[StoredF32] = MetricPattern4(client, 'outputs_per_sec') + self.sent_sum: ActiveSupplyPattern = ActiveSupplyPattern(client, 'sent_sum') + self.tx_per_sec: MetricPattern4[StoredF32] = MetricPattern4(client, 'tx_per_sec') class MetricsTree_Transactions: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.base_size: MetricPattern27[StoredU32] = MetricPattern27( - client, "base_size" - ) - self.count: MetricsTree_Transactions_Count = MetricsTree_Transactions_Count( - client - ) + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.base_size: MetricPattern27[StoredU32] = MetricPattern27(client, 'base_size') + self.count: MetricsTree_Transactions_Count = MetricsTree_Transactions_Count(client) self.fees: MetricsTree_Transactions_Fees = MetricsTree_Transactions_Fees(client) - self.first_txindex: MetricPattern11[TxIndex] = MetricPattern11( - client, "first_txindex" - ) - self.first_txinindex: MetricPattern27[TxInIndex] = MetricPattern27( - client, "first_txinindex" - ) - self.first_txoutindex: MetricPattern27[TxOutIndex] = MetricPattern27( - client, "first_txoutindex" - ) - self.height: MetricPattern27[Height] = MetricPattern27(client, "height") - self.is_explicitly_rbf: MetricPattern27[StoredBool] = MetricPattern27( - client, "is_explicitly_rbf" - ) - self.rawlocktime: MetricPattern27[RawLockTime] = MetricPattern27( - client, "rawlocktime" - ) + self.first_txindex: MetricPattern11[TxIndex] = MetricPattern11(client, 'first_txindex') + self.first_txinindex: MetricPattern27[TxInIndex] = MetricPattern27(client, 'first_txinindex') + self.first_txoutindex: MetricPattern27[TxOutIndex] = MetricPattern27(client, 'first_txoutindex') + self.height: MetricPattern27[Height] = MetricPattern27(client, 'height') + self.is_explicitly_rbf: MetricPattern27[StoredBool] = MetricPattern27(client, 'is_explicitly_rbf') + self.rawlocktime: MetricPattern27[RawLockTime] = MetricPattern27(client, 'rawlocktime') self.size: MetricsTree_Transactions_Size = MetricsTree_Transactions_Size(client) - self.total_size: MetricPattern27[StoredU32] = MetricPattern27( - client, "total_size" - ) - self.txid: MetricPattern27[Txid] = MetricPattern27(client, "txid") - self.txversion: MetricPattern27[TxVersion] = MetricPattern27( - client, "txversion" - ) - self.versions: MetricsTree_Transactions_Versions = ( - MetricsTree_Transactions_Versions(client) - ) - self.volume: MetricsTree_Transactions_Volume = MetricsTree_Transactions_Volume( - client - ) - + self.total_size: MetricPattern27[StoredU32] = MetricPattern27(client, 'total_size') + self.txid: MetricPattern27[Txid] = MetricPattern27(client, 'txid') + self.txversion: MetricPattern27[TxVersion] = MetricPattern27(client, 'txversion') + self.versions: MetricsTree_Transactions_Versions = MetricsTree_Transactions_Versions(client) + self.volume: MetricsTree_Transactions_Volume = MetricsTree_Transactions_Volume(client) class MetricsTree: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): + + def __init__(self, client: BrkClientBase, base_path: str = ''): self.addresses: MetricsTree_Addresses = MetricsTree_Addresses(client) self.blocks: MetricsTree_Blocks = MetricsTree_Blocks(client) self.cointime: MetricsTree_Cointime = MetricsTree_Cointime(client) @@ -6632,1021 +4438,1401 @@ class MetricsTree: self.supply: MetricsTree_Supply = MetricsTree_Supply(client) self.transactions: MetricsTree_Transactions = MetricsTree_Transactions(client) - class BrkClient(BrkClientBase): """Main BRK client with metrics tree and API methods.""" VERSION = "v0.1.0-alpha.2" INDEXES = [ - "dateindex", - "decadeindex", - "difficultyepoch", - "emptyoutputindex", - "halvingepoch", - "height", - "txinindex", - "monthindex", - "opreturnindex", - "txoutindex", - "p2aaddressindex", - "p2msoutputindex", - "p2pk33addressindex", - "p2pk65addressindex", - "p2pkhaddressindex", - "p2shaddressindex", - "p2traddressindex", - "p2wpkhaddressindex", - "p2wshaddressindex", - "quarterindex", - "semesterindex", - "txindex", - "unknownoutputindex", - "weekindex", - "yearindex", - "loadedaddressindex", - "emptyaddressindex", + "dateindex", + "decadeindex", + "difficultyepoch", + "emptyoutputindex", + "halvingepoch", + "height", + "txinindex", + "monthindex", + "opreturnindex", + "txoutindex", + "p2aaddressindex", + "p2msoutputindex", + "p2pk33addressindex", + "p2pk65addressindex", + "p2pkhaddressindex", + "p2shaddressindex", + "p2traddressindex", + "p2wpkhaddressindex", + "p2wshaddressindex", + "quarterindex", + "semesterindex", + "txindex", + "unknownoutputindex", + "weekindex", + "yearindex", + "loadedaddressindex", + "emptyaddressindex" ] POOL_ID_TO_POOL_NAME = { - "aaopool": "AAO Pool", - "antpool": "AntPool", - "arkpool": "ArkPool", - "asicminer": "ASICMiner", - "axbt": "A-XBT", - "batpool": "BATPOOL", - "bcmonster": "BCMonster", - "bcpoolio": "bcpool.io", - "binancepool": "Binance Pool", - "bitalo": "Bitalo", - "bitclub": "BitClub", - "bitcoinaffiliatenetwork": "Bitcoin Affiliate Network", - "bitcoincom": "Bitcoin.com", - "bitcoinindia": "Bitcoin India", - "bitcoinrussia": "BitcoinRussia", - "bitcoinukraine": "Bitcoin-Ukraine", - "bitfarms": "Bitfarms", - "bitfufupool": "BitFuFuPool", - "bitfury": "BitFury", - "bitminter": "BitMinter", - "bitparking": "Bitparking", - "bitsolo": "Bitsolo", - "bixin": "Bixin", - "blockfills": "BlockFills", - "braiinspool": "Braiins Pool", - "bravomining": "Bravo Mining", - "btcc": "BTCC", - "btccom": "BTC.com", - "btcdig": "BTCDig", - "btcguild": "BTC Guild", - "btclab": "BTCLab", - "btcmp": "BTCMP", - "btcnuggets": "BTC Nuggets", - "btcpoolparty": "BTC Pool Party", - "btcserv": "BTCServ", - "btctop": "BTC.TOP", - "btpool": "BTPOOL", - "bwpool": "BWPool", - "bytepool": "BytePool", - "canoe": "CANOE", - "canoepool": "CanoePool", - "carbonnegative": "Carbon Negative", - "ckpool": "CKPool", - "cloudhashing": "CloudHashing", - "coinlab": "CoinLab", - "cointerra": "Cointerra", - "connectbtc": "ConnectBTC", - "dcex": "DCEX", - "dcexploration": "DCExploration", - "digitalbtc": "digitalBTC", - "digitalxmintsy": "digitalX Mintsy", - "dpool": "DPOOL", - "eclipsemc": "EclipseMC", - "eightbaochi": "8baochi", - "ekanembtc": "EkanemBTC", - "eligius": "Eligius", - "emcdpool": "EMCDPool", - "entrustcharitypool": "Entrust Charity Pool", - "eobot": "Eobot", - "exxbw": "EXX&BW", - "f2pool": "F2Pool", - "fiftyeightcoin": "58COIN", - "foundryusa": "Foundry USA", - "futurebitapollosolo": "FutureBit Apollo Solo", - "gbminers": "GBMiners", - "ghashio": "GHash.IO", - "givemecoins": "Give Me Coins", - "gogreenlight": "GoGreenLight", - "haominer": "haominer", - "haozhuzhu": "HAOZHUZHU", - "hashbx": "HashBX", - "hashpool": "HASHPOOL", - "helix": "Helix", - "hhtt": "HHTT", - "hotpool": "HotPool", - "hummerpool": "Hummerpool", - "huobipool": "Huobi.pool", - "innopolistech": "Innopolis Tech", - "kanopool": "KanoPool", - "kncminer": "KnCMiner", - "kucoinpool": "KuCoinPool", - "lubiancom": "Lubian.com", - "luckypool": "luckyPool", - "luxor": "Luxor", - "marapool": "MARA Pool", - "maxbtc": "MaxBTC", - "maxipool": "MaxiPool", - "megabigpower": "MegaBigPower", - "minerium": "Minerium", - "miningcity": "MiningCity", - "miningdutch": "Mining-Dutch", - "miningkings": "MiningKings", - "miningsquared": "Mining Squared", - "mmpool": "mmpool", - "mtred": "Mt Red", - "multicoinco": "MultiCoin.co", - "multipool": "Multipool", - "mybtccoinpool": "myBTCcoin Pool", - "neopool": "Neopool", - "nexious": "Nexious", - "nicehash": "NiceHash", - "nmcbit": "NMCbit", - "novablock": "NovaBlock", - "ocean": "OCEAN", - "okexpool": "OKExPool", - "okkong": "OKKONG", - "okminer": "OKMINER", - "okpooltop": "okpool.top", - "onehash": "1Hash", - "onem1x": "1M1X", - "onethash": "1THash", - "ozcoin": "OzCoin", - "parasite": "Parasite", - "patels": "Patels", - "pegapool": "PEGA Pool", - "phashio": "PHash.IO", - "phoenix": "Phoenix", - "polmine": "Polmine", - "pool175btc": "175btc", - "pool50btc": "50BTC", - "poolin": "Poolin", - "portlandhodl": "Portland.HODL", - "publicpool": "Public Pool", - "purebtccom": "PureBTC.COM", - "rawpool": "Rawpool", - "rigpool": "RigPool", - "sbicrypto": "SBI Crypto", - "secpool": "SECPOOL", - "secretsuperstar": "SecretSuperstar", - "sevenpool": "7pool", - "shawnp0wers": "shawnp0wers", - "sigmapoolcom": "Sigmapool.com", - "simplecoinus": "simplecoin.us", - "solock": "Solo CK", - "spiderpool": "SpiderPool", - "stminingcorp": "ST Mining Corp", - "tangpool": "Tangpool", - "tatmaspool": "TATMAS Pool", - "tbdice": "TBDice", - "telco214": "Telco 214", - "terrapool": "Terra Pool", - "tiger": "tiger", - "tigerpoolnet": "tigerpool.net", - "titan": "Titan", - "transactioncoinmining": "transactioncoinmining", - "trickysbtcpool": "Tricky's BTC Pool", - "triplemining": "TripleMining", - "twentyoneinc": "21 Inc.", - "ultimuspool": "ULTIMUSPOOL", - "unknown": "Unknown", - "unomp": "UNOMP", - "viabtc": "ViaBTC", - "waterhole": "Waterhole", - "wayicn": "WAYI.CN", - "whitepool": "WhitePool", - "wk057": "wk057", - "yourbtcnet": "Yourbtc.net", - "zulupool": "Zulupool", + "aaopool": "AAO Pool", + "antpool": "AntPool", + "arkpool": "ArkPool", + "asicminer": "ASICMiner", + "axbt": "A-XBT", + "batpool": "BATPOOL", + "bcmonster": "BCMonster", + "bcpoolio": "bcpool.io", + "binancepool": "Binance Pool", + "bitalo": "Bitalo", + "bitclub": "BitClub", + "bitcoinaffiliatenetwork": "Bitcoin Affiliate Network", + "bitcoincom": "Bitcoin.com", + "bitcoinindia": "Bitcoin India", + "bitcoinrussia": "BitcoinRussia", + "bitcoinukraine": "Bitcoin-Ukraine", + "bitfarms": "Bitfarms", + "bitfufupool": "BitFuFuPool", + "bitfury": "BitFury", + "bitminter": "BitMinter", + "bitparking": "Bitparking", + "bitsolo": "Bitsolo", + "bixin": "Bixin", + "blockfills": "BlockFills", + "braiinspool": "Braiins Pool", + "bravomining": "Bravo Mining", + "btcc": "BTCC", + "btccom": "BTC.com", + "btcdig": "BTCDig", + "btcguild": "BTC Guild", + "btclab": "BTCLab", + "btcmp": "BTCMP", + "btcnuggets": "BTC Nuggets", + "btcpoolparty": "BTC Pool Party", + "btcserv": "BTCServ", + "btctop": "BTC.TOP", + "btpool": "BTPOOL", + "bwpool": "BWPool", + "bytepool": "BytePool", + "canoe": "CANOE", + "canoepool": "CanoePool", + "carbonnegative": "Carbon Negative", + "ckpool": "CKPool", + "cloudhashing": "CloudHashing", + "coinlab": "CoinLab", + "cointerra": "Cointerra", + "connectbtc": "ConnectBTC", + "dcex": "DCEX", + "dcexploration": "DCExploration", + "digitalbtc": "digitalBTC", + "digitalxmintsy": "digitalX Mintsy", + "dpool": "DPOOL", + "eclipsemc": "EclipseMC", + "eightbaochi": "8baochi", + "ekanembtc": "EkanemBTC", + "eligius": "Eligius", + "emcdpool": "EMCDPool", + "entrustcharitypool": "Entrust Charity Pool", + "eobot": "Eobot", + "exxbw": "EXX&BW", + "f2pool": "F2Pool", + "fiftyeightcoin": "58COIN", + "foundryusa": "Foundry USA", + "futurebitapollosolo": "FutureBit Apollo Solo", + "gbminers": "GBMiners", + "ghashio": "GHash.IO", + "givemecoins": "Give Me Coins", + "gogreenlight": "GoGreenLight", + "haominer": "haominer", + "haozhuzhu": "HAOZHUZHU", + "hashbx": "HashBX", + "hashpool": "HASHPOOL", + "helix": "Helix", + "hhtt": "HHTT", + "hotpool": "HotPool", + "hummerpool": "Hummerpool", + "huobipool": "Huobi.pool", + "innopolistech": "Innopolis Tech", + "kanopool": "KanoPool", + "kncminer": "KnCMiner", + "kucoinpool": "KuCoinPool", + "lubiancom": "Lubian.com", + "luckypool": "luckyPool", + "luxor": "Luxor", + "marapool": "MARA Pool", + "maxbtc": "MaxBTC", + "maxipool": "MaxiPool", + "megabigpower": "MegaBigPower", + "minerium": "Minerium", + "miningcity": "MiningCity", + "miningdutch": "Mining-Dutch", + "miningkings": "MiningKings", + "miningsquared": "Mining Squared", + "mmpool": "mmpool", + "mtred": "Mt Red", + "multicoinco": "MultiCoin.co", + "multipool": "Multipool", + "mybtccoinpool": "myBTCcoin Pool", + "neopool": "Neopool", + "nexious": "Nexious", + "nicehash": "NiceHash", + "nmcbit": "NMCbit", + "novablock": "NovaBlock", + "ocean": "OCEAN", + "okexpool": "OKExPool", + "okkong": "OKKONG", + "okminer": "OKMINER", + "okpooltop": "okpool.top", + "onehash": "1Hash", + "onem1x": "1M1X", + "onethash": "1THash", + "ozcoin": "OzCoin", + "parasite": "Parasite", + "patels": "Patels", + "pegapool": "PEGA Pool", + "phashio": "PHash.IO", + "phoenix": "Phoenix", + "polmine": "Polmine", + "pool175btc": "175btc", + "pool50btc": "50BTC", + "poolin": "Poolin", + "portlandhodl": "Portland.HODL", + "publicpool": "Public Pool", + "purebtccom": "PureBTC.COM", + "rawpool": "Rawpool", + "rigpool": "RigPool", + "sbicrypto": "SBI Crypto", + "secpool": "SECPOOL", + "secretsuperstar": "SecretSuperstar", + "sevenpool": "7pool", + "shawnp0wers": "shawnp0wers", + "sigmapoolcom": "Sigmapool.com", + "simplecoinus": "simplecoin.us", + "solock": "Solo CK", + "spiderpool": "SpiderPool", + "stminingcorp": "ST Mining Corp", + "tangpool": "Tangpool", + "tatmaspool": "TATMAS Pool", + "tbdice": "TBDice", + "telco214": "Telco 214", + "terrapool": "Terra Pool", + "tiger": "tiger", + "tigerpoolnet": "tigerpool.net", + "titan": "Titan", + "transactioncoinmining": "transactioncoinmining", + "trickysbtcpool": "Tricky's BTC Pool", + "triplemining": "TripleMining", + "twentyoneinc": "21 Inc.", + "ultimuspool": "ULTIMUSPOOL", + "unknown": "Unknown", + "unomp": "UNOMP", + "viabtc": "ViaBTC", + "waterhole": "Waterhole", + "wayicn": "WAYI.CN", + "whitepool": "WhitePool", + "wk057": "wk057", + "yourbtcnet": "Yourbtc.net", + "zulupool": "Zulupool" } TERM_NAMES = { - "short": {"id": "sth", "short": "STH", "long": "Short Term Holders"}, - "long": {"id": "lth", "short": "LTH", "long": "Long Term Holders"}, + "short": { + "id": "sth", + "short": "STH", + "long": "Short Term Holders" + }, + "long": { + "id": "lth", + "short": "LTH", + "long": "Long Term Holders" + } } EPOCH_NAMES = { - "_0": {"id": "epoch_0", "short": "Epoch 0", "long": "Epoch 0"}, - "_1": {"id": "epoch_1", "short": "Epoch 1", "long": "Epoch 1"}, - "_2": {"id": "epoch_2", "short": "Epoch 2", "long": "Epoch 2"}, - "_3": {"id": "epoch_3", "short": "Epoch 3", "long": "Epoch 3"}, - "_4": {"id": "epoch_4", "short": "Epoch 4", "long": "Epoch 4"}, + "_0": { + "id": "epoch_0", + "short": "Epoch 0", + "long": "Epoch 0" + }, + "_1": { + "id": "epoch_1", + "short": "Epoch 1", + "long": "Epoch 1" + }, + "_2": { + "id": "epoch_2", + "short": "Epoch 2", + "long": "Epoch 2" + }, + "_3": { + "id": "epoch_3", + "short": "Epoch 3", + "long": "Epoch 3" + }, + "_4": { + "id": "epoch_4", + "short": "Epoch 4", + "long": "Epoch 4" + } } YEAR_NAMES = { - "_2009": {"id": "year_2009", "short": "2009", "long": "Year 2009"}, - "_2010": {"id": "year_2010", "short": "2010", "long": "Year 2010"}, - "_2011": {"id": "year_2011", "short": "2011", "long": "Year 2011"}, - "_2012": {"id": "year_2012", "short": "2012", "long": "Year 2012"}, - "_2013": {"id": "year_2013", "short": "2013", "long": "Year 2013"}, - "_2014": {"id": "year_2014", "short": "2014", "long": "Year 2014"}, - "_2015": {"id": "year_2015", "short": "2015", "long": "Year 2015"}, - "_2016": {"id": "year_2016", "short": "2016", "long": "Year 2016"}, - "_2017": {"id": "year_2017", "short": "2017", "long": "Year 2017"}, - "_2018": {"id": "year_2018", "short": "2018", "long": "Year 2018"}, - "_2019": {"id": "year_2019", "short": "2019", "long": "Year 2019"}, - "_2020": {"id": "year_2020", "short": "2020", "long": "Year 2020"}, - "_2021": {"id": "year_2021", "short": "2021", "long": "Year 2021"}, - "_2022": {"id": "year_2022", "short": "2022", "long": "Year 2022"}, - "_2023": {"id": "year_2023", "short": "2023", "long": "Year 2023"}, - "_2024": {"id": "year_2024", "short": "2024", "long": "Year 2024"}, - "_2025": {"id": "year_2025", "short": "2025", "long": "Year 2025"}, - "_2026": {"id": "year_2026", "short": "2026", "long": "Year 2026"}, + "_2009": { + "id": "year_2009", + "short": "2009", + "long": "Year 2009" + }, + "_2010": { + "id": "year_2010", + "short": "2010", + "long": "Year 2010" + }, + "_2011": { + "id": "year_2011", + "short": "2011", + "long": "Year 2011" + }, + "_2012": { + "id": "year_2012", + "short": "2012", + "long": "Year 2012" + }, + "_2013": { + "id": "year_2013", + "short": "2013", + "long": "Year 2013" + }, + "_2014": { + "id": "year_2014", + "short": "2014", + "long": "Year 2014" + }, + "_2015": { + "id": "year_2015", + "short": "2015", + "long": "Year 2015" + }, + "_2016": { + "id": "year_2016", + "short": "2016", + "long": "Year 2016" + }, + "_2017": { + "id": "year_2017", + "short": "2017", + "long": "Year 2017" + }, + "_2018": { + "id": "year_2018", + "short": "2018", + "long": "Year 2018" + }, + "_2019": { + "id": "year_2019", + "short": "2019", + "long": "Year 2019" + }, + "_2020": { + "id": "year_2020", + "short": "2020", + "long": "Year 2020" + }, + "_2021": { + "id": "year_2021", + "short": "2021", + "long": "Year 2021" + }, + "_2022": { + "id": "year_2022", + "short": "2022", + "long": "Year 2022" + }, + "_2023": { + "id": "year_2023", + "short": "2023", + "long": "Year 2023" + }, + "_2024": { + "id": "year_2024", + "short": "2024", + "long": "Year 2024" + }, + "_2025": { + "id": "year_2025", + "short": "2025", + "long": "Year 2025" + }, + "_2026": { + "id": "year_2026", + "short": "2026", + "long": "Year 2026" + } } SPENDABLE_TYPE_NAMES = { - "p2pk65": { - "id": "p2pk65", - "short": "P2PK65", - "long": "Pay to Public Key (65 bytes)", - }, - "p2pk33": { - "id": "p2pk33", - "short": "P2PK33", - "long": "Pay to Public Key (33 bytes)", - }, - "p2pkh": {"id": "p2pkh", "short": "P2PKH", "long": "Pay to Public Key Hash"}, - "p2ms": {"id": "p2ms", "short": "P2MS", "long": "Pay to Multisig"}, - "p2sh": {"id": "p2sh", "short": "P2SH", "long": "Pay to Script Hash"}, - "p2wpkh": { - "id": "p2wpkh", - "short": "P2WPKH", - "long": "Pay to Witness Public Key Hash", - }, - "p2wsh": { - "id": "p2wsh", - "short": "P2WSH", - "long": "Pay to Witness Script Hash", - }, - "p2tr": {"id": "p2tr", "short": "P2TR", "long": "Pay to Taproot"}, - "p2a": {"id": "p2a", "short": "P2A", "long": "Pay to Anchor"}, - "unknown": { - "id": "unknown_outputs", - "short": "Unknown", - "long": "Unknown Output Type", - }, - "empty": {"id": "empty_outputs", "short": "Empty", "long": "Empty Output"}, + "p2pk65": { + "id": "p2pk65", + "short": "P2PK65", + "long": "Pay to Public Key (65 bytes)" + }, + "p2pk33": { + "id": "p2pk33", + "short": "P2PK33", + "long": "Pay to Public Key (33 bytes)" + }, + "p2pkh": { + "id": "p2pkh", + "short": "P2PKH", + "long": "Pay to Public Key Hash" + }, + "p2ms": { + "id": "p2ms", + "short": "P2MS", + "long": "Pay to Multisig" + }, + "p2sh": { + "id": "p2sh", + "short": "P2SH", + "long": "Pay to Script Hash" + }, + "p2wpkh": { + "id": "p2wpkh", + "short": "P2WPKH", + "long": "Pay to Witness Public Key Hash" + }, + "p2wsh": { + "id": "p2wsh", + "short": "P2WSH", + "long": "Pay to Witness Script Hash" + }, + "p2tr": { + "id": "p2tr", + "short": "P2TR", + "long": "Pay to Taproot" + }, + "p2a": { + "id": "p2a", + "short": "P2A", + "long": "Pay to Anchor" + }, + "unknown": { + "id": "unknown_outputs", + "short": "Unknown", + "long": "Unknown Output Type" + }, + "empty": { + "id": "empty_outputs", + "short": "Empty", + "long": "Empty Output" + } } AGE_RANGE_NAMES = { - "up_to_1h": {"id": "up_to_1h_old", "short": "<1h", "long": "Up to 1 Hour Old"}, - "_1h_to_1d": { - "id": "at_least_1h_up_to_1d_old", - "short": "1h-1d", - "long": "1 Hour to 1 Day Old", - }, - "_1d_to_1w": { - "id": "at_least_1d_up_to_1w_old", - "short": "1d-1w", - "long": "1 Day to 1 Week Old", - }, - "_1w_to_1m": { - "id": "at_least_1w_up_to_1m_old", - "short": "1w-1m", - "long": "1 Week to 1 Month Old", - }, - "_1m_to_2m": { - "id": "at_least_1m_up_to_2m_old", - "short": "1m-2m", - "long": "1 to 2 Months Old", - }, - "_2m_to_3m": { - "id": "at_least_2m_up_to_3m_old", - "short": "2m-3m", - "long": "2 to 3 Months Old", - }, - "_3m_to_4m": { - "id": "at_least_3m_up_to_4m_old", - "short": "3m-4m", - "long": "3 to 4 Months Old", - }, - "_4m_to_5m": { - "id": "at_least_4m_up_to_5m_old", - "short": "4m-5m", - "long": "4 to 5 Months Old", - }, - "_5m_to_6m": { - "id": "at_least_5m_up_to_6m_old", - "short": "5m-6m", - "long": "5 to 6 Months Old", - }, - "_6m_to_1y": { - "id": "at_least_6m_up_to_1y_old", - "short": "6m-1y", - "long": "6 Months to 1 Year Old", - }, - "_1y_to_2y": { - "id": "at_least_1y_up_to_2y_old", - "short": "1y-2y", - "long": "1 to 2 Years Old", - }, - "_2y_to_3y": { - "id": "at_least_2y_up_to_3y_old", - "short": "2y-3y", - "long": "2 to 3 Years Old", - }, - "_3y_to_4y": { - "id": "at_least_3y_up_to_4y_old", - "short": "3y-4y", - "long": "3 to 4 Years Old", - }, - "_4y_to_5y": { - "id": "at_least_4y_up_to_5y_old", - "short": "4y-5y", - "long": "4 to 5 Years Old", - }, - "_5y_to_6y": { - "id": "at_least_5y_up_to_6y_old", - "short": "5y-6y", - "long": "5 to 6 Years Old", - }, - "_6y_to_7y": { - "id": "at_least_6y_up_to_7y_old", - "short": "6y-7y", - "long": "6 to 7 Years Old", - }, - "_7y_to_8y": { - "id": "at_least_7y_up_to_8y_old", - "short": "7y-8y", - "long": "7 to 8 Years Old", - }, - "_8y_to_10y": { - "id": "at_least_8y_up_to_10y_old", - "short": "8y-10y", - "long": "8 to 10 Years Old", - }, - "_10y_to_12y": { - "id": "at_least_10y_up_to_12y_old", - "short": "10y-12y", - "long": "10 to 12 Years Old", - }, - "_12y_to_15y": { - "id": "at_least_12y_up_to_15y_old", - "short": "12y-15y", - "long": "12 to 15 Years Old", - }, - "from_15y": { - "id": "at_least_15y_old", - "short": "15y+", - "long": "15+ Years Old", - }, + "up_to_1h": { + "id": "up_to_1h_old", + "short": "<1h", + "long": "Up to 1 Hour Old" + }, + "_1h_to_1d": { + "id": "at_least_1h_up_to_1d_old", + "short": "1h-1d", + "long": "1 Hour to 1 Day Old" + }, + "_1d_to_1w": { + "id": "at_least_1d_up_to_1w_old", + "short": "1d-1w", + "long": "1 Day to 1 Week Old" + }, + "_1w_to_1m": { + "id": "at_least_1w_up_to_1m_old", + "short": "1w-1m", + "long": "1 Week to 1 Month Old" + }, + "_1m_to_2m": { + "id": "at_least_1m_up_to_2m_old", + "short": "1m-2m", + "long": "1 to 2 Months Old" + }, + "_2m_to_3m": { + "id": "at_least_2m_up_to_3m_old", + "short": "2m-3m", + "long": "2 to 3 Months Old" + }, + "_3m_to_4m": { + "id": "at_least_3m_up_to_4m_old", + "short": "3m-4m", + "long": "3 to 4 Months Old" + }, + "_4m_to_5m": { + "id": "at_least_4m_up_to_5m_old", + "short": "4m-5m", + "long": "4 to 5 Months Old" + }, + "_5m_to_6m": { + "id": "at_least_5m_up_to_6m_old", + "short": "5m-6m", + "long": "5 to 6 Months Old" + }, + "_6m_to_1y": { + "id": "at_least_6m_up_to_1y_old", + "short": "6m-1y", + "long": "6 Months to 1 Year Old" + }, + "_1y_to_2y": { + "id": "at_least_1y_up_to_2y_old", + "short": "1y-2y", + "long": "1 to 2 Years Old" + }, + "_2y_to_3y": { + "id": "at_least_2y_up_to_3y_old", + "short": "2y-3y", + "long": "2 to 3 Years Old" + }, + "_3y_to_4y": { + "id": "at_least_3y_up_to_4y_old", + "short": "3y-4y", + "long": "3 to 4 Years Old" + }, + "_4y_to_5y": { + "id": "at_least_4y_up_to_5y_old", + "short": "4y-5y", + "long": "4 to 5 Years Old" + }, + "_5y_to_6y": { + "id": "at_least_5y_up_to_6y_old", + "short": "5y-6y", + "long": "5 to 6 Years Old" + }, + "_6y_to_7y": { + "id": "at_least_6y_up_to_7y_old", + "short": "6y-7y", + "long": "6 to 7 Years Old" + }, + "_7y_to_8y": { + "id": "at_least_7y_up_to_8y_old", + "short": "7y-8y", + "long": "7 to 8 Years Old" + }, + "_8y_to_10y": { + "id": "at_least_8y_up_to_10y_old", + "short": "8y-10y", + "long": "8 to 10 Years Old" + }, + "_10y_to_12y": { + "id": "at_least_10y_up_to_12y_old", + "short": "10y-12y", + "long": "10 to 12 Years Old" + }, + "_12y_to_15y": { + "id": "at_least_12y_up_to_15y_old", + "short": "12y-15y", + "long": "12 to 15 Years Old" + }, + "from_15y": { + "id": "at_least_15y_old", + "short": "15y+", + "long": "15+ Years Old" + } } MAX_AGE_NAMES = { - "_1w": {"id": "up_to_1w_old", "short": "<1w", "long": "Up to 1 Week Old"}, - "_1m": {"id": "up_to_1m_old", "short": "<1m", "long": "Up to 1 Month Old"}, - "_2m": {"id": "up_to_2m_old", "short": "<2m", "long": "Up to 2 Months Old"}, - "_3m": {"id": "up_to_3m_old", "short": "<3m", "long": "Up to 3 Months Old"}, - "_4m": {"id": "up_to_4m_old", "short": "<4m", "long": "Up to 4 Months Old"}, - "_5m": {"id": "up_to_5m_old", "short": "<5m", "long": "Up to 5 Months Old"}, - "_6m": {"id": "up_to_6m_old", "short": "<6m", "long": "Up to 6 Months Old"}, - "_1y": {"id": "up_to_1y_old", "short": "<1y", "long": "Up to 1 Year Old"}, - "_2y": {"id": "up_to_2y_old", "short": "<2y", "long": "Up to 2 Years Old"}, - "_3y": {"id": "up_to_3y_old", "short": "<3y", "long": "Up to 3 Years Old"}, - "_4y": {"id": "up_to_4y_old", "short": "<4y", "long": "Up to 4 Years Old"}, - "_5y": {"id": "up_to_5y_old", "short": "<5y", "long": "Up to 5 Years Old"}, - "_6y": {"id": "up_to_6y_old", "short": "<6y", "long": "Up to 6 Years Old"}, - "_7y": {"id": "up_to_7y_old", "short": "<7y", "long": "Up to 7 Years Old"}, - "_8y": {"id": "up_to_8y_old", "short": "<8y", "long": "Up to 8 Years Old"}, - "_10y": {"id": "up_to_10y_old", "short": "<10y", "long": "Up to 10 Years Old"}, - "_12y": {"id": "up_to_12y_old", "short": "<12y", "long": "Up to 12 Years Old"}, - "_15y": {"id": "up_to_15y_old", "short": "<15y", "long": "Up to 15 Years Old"}, + "_1w": { + "id": "up_to_1w_old", + "short": "<1w", + "long": "Up to 1 Week Old" + }, + "_1m": { + "id": "up_to_1m_old", + "short": "<1m", + "long": "Up to 1 Month Old" + }, + "_2m": { + "id": "up_to_2m_old", + "short": "<2m", + "long": "Up to 2 Months Old" + }, + "_3m": { + "id": "up_to_3m_old", + "short": "<3m", + "long": "Up to 3 Months Old" + }, + "_4m": { + "id": "up_to_4m_old", + "short": "<4m", + "long": "Up to 4 Months Old" + }, + "_5m": { + "id": "up_to_5m_old", + "short": "<5m", + "long": "Up to 5 Months Old" + }, + "_6m": { + "id": "up_to_6m_old", + "short": "<6m", + "long": "Up to 6 Months Old" + }, + "_1y": { + "id": "up_to_1y_old", + "short": "<1y", + "long": "Up to 1 Year Old" + }, + "_2y": { + "id": "up_to_2y_old", + "short": "<2y", + "long": "Up to 2 Years Old" + }, + "_3y": { + "id": "up_to_3y_old", + "short": "<3y", + "long": "Up to 3 Years Old" + }, + "_4y": { + "id": "up_to_4y_old", + "short": "<4y", + "long": "Up to 4 Years Old" + }, + "_5y": { + "id": "up_to_5y_old", + "short": "<5y", + "long": "Up to 5 Years Old" + }, + "_6y": { + "id": "up_to_6y_old", + "short": "<6y", + "long": "Up to 6 Years Old" + }, + "_7y": { + "id": "up_to_7y_old", + "short": "<7y", + "long": "Up to 7 Years Old" + }, + "_8y": { + "id": "up_to_8y_old", + "short": "<8y", + "long": "Up to 8 Years Old" + }, + "_10y": { + "id": "up_to_10y_old", + "short": "<10y", + "long": "Up to 10 Years Old" + }, + "_12y": { + "id": "up_to_12y_old", + "short": "<12y", + "long": "Up to 12 Years Old" + }, + "_15y": { + "id": "up_to_15y_old", + "short": "<15y", + "long": "Up to 15 Years Old" + } } MIN_AGE_NAMES = { - "_1d": {"id": "at_least_1d_old", "short": "1d+", "long": "At Least 1 Day Old"}, - "_1w": {"id": "at_least_1w_old", "short": "1w+", "long": "At Least 1 Week Old"}, - "_1m": { - "id": "at_least_1m_old", - "short": "1m+", - "long": "At Least 1 Month Old", - }, - "_2m": { - "id": "at_least_2m_old", - "short": "2m+", - "long": "At Least 2 Months Old", - }, - "_3m": { - "id": "at_least_3m_old", - "short": "3m+", - "long": "At Least 3 Months Old", - }, - "_4m": { - "id": "at_least_4m_old", - "short": "4m+", - "long": "At Least 4 Months Old", - }, - "_5m": { - "id": "at_least_5m_old", - "short": "5m+", - "long": "At Least 5 Months Old", - }, - "_6m": { - "id": "at_least_6m_old", - "short": "6m+", - "long": "At Least 6 Months Old", - }, - "_1y": {"id": "at_least_1y_old", "short": "1y+", "long": "At Least 1 Year Old"}, - "_2y": { - "id": "at_least_2y_old", - "short": "2y+", - "long": "At Least 2 Years Old", - }, - "_3y": { - "id": "at_least_3y_old", - "short": "3y+", - "long": "At Least 3 Years Old", - }, - "_4y": { - "id": "at_least_4y_old", - "short": "4y+", - "long": "At Least 4 Years Old", - }, - "_5y": { - "id": "at_least_5y_old", - "short": "5y+", - "long": "At Least 5 Years Old", - }, - "_6y": { - "id": "at_least_6y_old", - "short": "6y+", - "long": "At Least 6 Years Old", - }, - "_7y": { - "id": "at_least_7y_old", - "short": "7y+", - "long": "At Least 7 Years Old", - }, - "_8y": { - "id": "at_least_8y_old", - "short": "8y+", - "long": "At Least 8 Years Old", - }, - "_10y": { - "id": "at_least_10y_old", - "short": "10y+", - "long": "At Least 10 Years Old", - }, - "_12y": { - "id": "at_least_12y_old", - "short": "12y+", - "long": "At Least 12 Years Old", - }, + "_1d": { + "id": "at_least_1d_old", + "short": "1d+", + "long": "At Least 1 Day Old" + }, + "_1w": { + "id": "at_least_1w_old", + "short": "1w+", + "long": "At Least 1 Week Old" + }, + "_1m": { + "id": "at_least_1m_old", + "short": "1m+", + "long": "At Least 1 Month Old" + }, + "_2m": { + "id": "at_least_2m_old", + "short": "2m+", + "long": "At Least 2 Months Old" + }, + "_3m": { + "id": "at_least_3m_old", + "short": "3m+", + "long": "At Least 3 Months Old" + }, + "_4m": { + "id": "at_least_4m_old", + "short": "4m+", + "long": "At Least 4 Months Old" + }, + "_5m": { + "id": "at_least_5m_old", + "short": "5m+", + "long": "At Least 5 Months Old" + }, + "_6m": { + "id": "at_least_6m_old", + "short": "6m+", + "long": "At Least 6 Months Old" + }, + "_1y": { + "id": "at_least_1y_old", + "short": "1y+", + "long": "At Least 1 Year Old" + }, + "_2y": { + "id": "at_least_2y_old", + "short": "2y+", + "long": "At Least 2 Years Old" + }, + "_3y": { + "id": "at_least_3y_old", + "short": "3y+", + "long": "At Least 3 Years Old" + }, + "_4y": { + "id": "at_least_4y_old", + "short": "4y+", + "long": "At Least 4 Years Old" + }, + "_5y": { + "id": "at_least_5y_old", + "short": "5y+", + "long": "At Least 5 Years Old" + }, + "_6y": { + "id": "at_least_6y_old", + "short": "6y+", + "long": "At Least 6 Years Old" + }, + "_7y": { + "id": "at_least_7y_old", + "short": "7y+", + "long": "At Least 7 Years Old" + }, + "_8y": { + "id": "at_least_8y_old", + "short": "8y+", + "long": "At Least 8 Years Old" + }, + "_10y": { + "id": "at_least_10y_old", + "short": "10y+", + "long": "At Least 10 Years Old" + }, + "_12y": { + "id": "at_least_12y_old", + "short": "12y+", + "long": "At Least 12 Years Old" + } } AMOUNT_RANGE_NAMES = { - "_0sats": {"id": "with_0sats", "short": "0 sats", "long": "0 Sats"}, - "_1sat_to_10sats": { - "id": "above_1sat_under_10sats", - "short": "1-10 sats", - "long": "1 to 10 Sats", - }, - "_10sats_to_100sats": { - "id": "above_10sats_under_100sats", - "short": "10-100 sats", - "long": "10 to 100 Sats", - }, - "_100sats_to_1k_sats": { - "id": "above_100sats_under_1k_sats", - "short": "100-1k sats", - "long": "100 to 1K Sats", - }, - "_1k_sats_to_10k_sats": { - "id": "above_1k_sats_under_10k_sats", - "short": "1k-10k sats", - "long": "1K to 10K Sats", - }, - "_10k_sats_to_100k_sats": { - "id": "above_10k_sats_under_100k_sats", - "short": "10k-100k sats", - "long": "10K to 100K Sats", - }, - "_100k_sats_to_1m_sats": { - "id": "above_100k_sats_under_1m_sats", - "short": "100k-1M sats", - "long": "100K to 1M Sats", - }, - "_1m_sats_to_10m_sats": { - "id": "above_1m_sats_under_10m_sats", - "short": "1M-10M sats", - "long": "1M to 10M Sats", - }, - "_10m_sats_to_1btc": { - "id": "above_10m_sats_under_1btc", - "short": "0.1-1 BTC", - "long": "0.1 to 1 BTC", - }, - "_1btc_to_10btc": { - "id": "above_1btc_under_10btc", - "short": "1-10 BTC", - "long": "1 to 10 BTC", - }, - "_10btc_to_100btc": { - "id": "above_10btc_under_100btc", - "short": "10-100 BTC", - "long": "10 to 100 BTC", - }, - "_100btc_to_1k_btc": { - "id": "above_100btc_under_1k_btc", - "short": "100-1k BTC", - "long": "100 to 1K BTC", - }, - "_1k_btc_to_10k_btc": { - "id": "above_1k_btc_under_10k_btc", - "short": "1k-10k BTC", - "long": "1K to 10K BTC", - }, - "_10k_btc_to_100k_btc": { - "id": "above_10k_btc_under_100k_btc", - "short": "10k-100k BTC", - "long": "10K to 100K BTC", - }, - "_100k_btc_or_more": { - "id": "above_100k_btc", - "short": "100k+ BTC", - "long": "100K+ BTC", - }, + "_0sats": { + "id": "with_0sats", + "short": "0 sats", + "long": "0 Sats" + }, + "_1sat_to_10sats": { + "id": "above_1sat_under_10sats", + "short": "1-10 sats", + "long": "1 to 10 Sats" + }, + "_10sats_to_100sats": { + "id": "above_10sats_under_100sats", + "short": "10-100 sats", + "long": "10 to 100 Sats" + }, + "_100sats_to_1k_sats": { + "id": "above_100sats_under_1k_sats", + "short": "100-1k sats", + "long": "100 to 1K Sats" + }, + "_1k_sats_to_10k_sats": { + "id": "above_1k_sats_under_10k_sats", + "short": "1k-10k sats", + "long": "1K to 10K Sats" + }, + "_10k_sats_to_100k_sats": { + "id": "above_10k_sats_under_100k_sats", + "short": "10k-100k sats", + "long": "10K to 100K Sats" + }, + "_100k_sats_to_1m_sats": { + "id": "above_100k_sats_under_1m_sats", + "short": "100k-1M sats", + "long": "100K to 1M Sats" + }, + "_1m_sats_to_10m_sats": { + "id": "above_1m_sats_under_10m_sats", + "short": "1M-10M sats", + "long": "1M to 10M Sats" + }, + "_10m_sats_to_1btc": { + "id": "above_10m_sats_under_1btc", + "short": "0.1-1 BTC", + "long": "0.1 to 1 BTC" + }, + "_1btc_to_10btc": { + "id": "above_1btc_under_10btc", + "short": "1-10 BTC", + "long": "1 to 10 BTC" + }, + "_10btc_to_100btc": { + "id": "above_10btc_under_100btc", + "short": "10-100 BTC", + "long": "10 to 100 BTC" + }, + "_100btc_to_1k_btc": { + "id": "above_100btc_under_1k_btc", + "short": "100-1k BTC", + "long": "100 to 1K BTC" + }, + "_1k_btc_to_10k_btc": { + "id": "above_1k_btc_under_10k_btc", + "short": "1k-10k BTC", + "long": "1K to 10K BTC" + }, + "_10k_btc_to_100k_btc": { + "id": "above_10k_btc_under_100k_btc", + "short": "10k-100k BTC", + "long": "10K to 100K BTC" + }, + "_100k_btc_or_more": { + "id": "above_100k_btc", + "short": "100k+ BTC", + "long": "100K+ BTC" + } } GE_AMOUNT_NAMES = { - "_1sat": {"id": "above_1sat", "short": "1+ sats", "long": "Above 1 Sat"}, - "_10sats": {"id": "above_10sats", "short": "10+ sats", "long": "Above 10 Sats"}, - "_100sats": { - "id": "above_100sats", - "short": "100+ sats", - "long": "Above 100 Sats", - }, - "_1k_sats": { - "id": "above_1k_sats", - "short": "1k+ sats", - "long": "Above 1K Sats", - }, - "_10k_sats": { - "id": "above_10k_sats", - "short": "10k+ sats", - "long": "Above 10K Sats", - }, - "_100k_sats": { - "id": "above_100k_sats", - "short": "100k+ sats", - "long": "Above 100K Sats", - }, - "_1m_sats": { - "id": "above_1m_sats", - "short": "1M+ sats", - "long": "Above 1M Sats", - }, - "_10m_sats": { - "id": "above_10m_sats", - "short": "0.1+ BTC", - "long": "Above 0.1 BTC", - }, - "_1btc": {"id": "above_1btc", "short": "1+ BTC", "long": "Above 1 BTC"}, - "_10btc": {"id": "above_10btc", "short": "10+ BTC", "long": "Above 10 BTC"}, - "_100btc": {"id": "above_100btc", "short": "100+ BTC", "long": "Above 100 BTC"}, - "_1k_btc": {"id": "above_1k_btc", "short": "1k+ BTC", "long": "Above 1K BTC"}, - "_10k_btc": { - "id": "above_10k_btc", - "short": "10k+ BTC", - "long": "Above 10K BTC", - }, + "_1sat": { + "id": "above_1sat", + "short": "1+ sats", + "long": "Above 1 Sat" + }, + "_10sats": { + "id": "above_10sats", + "short": "10+ sats", + "long": "Above 10 Sats" + }, + "_100sats": { + "id": "above_100sats", + "short": "100+ sats", + "long": "Above 100 Sats" + }, + "_1k_sats": { + "id": "above_1k_sats", + "short": "1k+ sats", + "long": "Above 1K Sats" + }, + "_10k_sats": { + "id": "above_10k_sats", + "short": "10k+ sats", + "long": "Above 10K Sats" + }, + "_100k_sats": { + "id": "above_100k_sats", + "short": "100k+ sats", + "long": "Above 100K Sats" + }, + "_1m_sats": { + "id": "above_1m_sats", + "short": "1M+ sats", + "long": "Above 1M Sats" + }, + "_10m_sats": { + "id": "above_10m_sats", + "short": "0.1+ BTC", + "long": "Above 0.1 BTC" + }, + "_1btc": { + "id": "above_1btc", + "short": "1+ BTC", + "long": "Above 1 BTC" + }, + "_10btc": { + "id": "above_10btc", + "short": "10+ BTC", + "long": "Above 10 BTC" + }, + "_100btc": { + "id": "above_100btc", + "short": "100+ BTC", + "long": "Above 100 BTC" + }, + "_1k_btc": { + "id": "above_1k_btc", + "short": "1k+ BTC", + "long": "Above 1K BTC" + }, + "_10k_btc": { + "id": "above_10k_btc", + "short": "10k+ BTC", + "long": "Above 10K BTC" + } } LT_AMOUNT_NAMES = { - "_10sats": {"id": "under_10sats", "short": "<10 sats", "long": "Under 10 Sats"}, - "_100sats": { - "id": "under_100sats", - "short": "<100 sats", - "long": "Under 100 Sats", - }, - "_1k_sats": { - "id": "under_1k_sats", - "short": "<1k sats", - "long": "Under 1K Sats", - }, - "_10k_sats": { - "id": "under_10k_sats", - "short": "<10k sats", - "long": "Under 10K Sats", - }, - "_100k_sats": { - "id": "under_100k_sats", - "short": "<100k sats", - "long": "Under 100K Sats", - }, - "_1m_sats": { - "id": "under_1m_sats", - "short": "<1M sats", - "long": "Under 1M Sats", - }, - "_10m_sats": { - "id": "under_10m_sats", - "short": "<0.1 BTC", - "long": "Under 0.1 BTC", - }, - "_1btc": {"id": "under_1btc", "short": "<1 BTC", "long": "Under 1 BTC"}, - "_10btc": {"id": "under_10btc", "short": "<10 BTC", "long": "Under 10 BTC"}, - "_100btc": {"id": "under_100btc", "short": "<100 BTC", "long": "Under 100 BTC"}, - "_1k_btc": {"id": "under_1k_btc", "short": "<1k BTC", "long": "Under 1K BTC"}, - "_10k_btc": { - "id": "under_10k_btc", - "short": "<10k BTC", - "long": "Under 10K BTC", - }, - "_100k_btc": { - "id": "under_100k_btc", - "short": "<100k BTC", - "long": "Under 100K BTC", - }, + "_10sats": { + "id": "under_10sats", + "short": "<10 sats", + "long": "Under 10 Sats" + }, + "_100sats": { + "id": "under_100sats", + "short": "<100 sats", + "long": "Under 100 Sats" + }, + "_1k_sats": { + "id": "under_1k_sats", + "short": "<1k sats", + "long": "Under 1K Sats" + }, + "_10k_sats": { + "id": "under_10k_sats", + "short": "<10k sats", + "long": "Under 10K Sats" + }, + "_100k_sats": { + "id": "under_100k_sats", + "short": "<100k sats", + "long": "Under 100K Sats" + }, + "_1m_sats": { + "id": "under_1m_sats", + "short": "<1M sats", + "long": "Under 1M Sats" + }, + "_10m_sats": { + "id": "under_10m_sats", + "short": "<0.1 BTC", + "long": "Under 0.1 BTC" + }, + "_1btc": { + "id": "under_1btc", + "short": "<1 BTC", + "long": "Under 1 BTC" + }, + "_10btc": { + "id": "under_10btc", + "short": "<10 BTC", + "long": "Under 10 BTC" + }, + "_100btc": { + "id": "under_100btc", + "short": "<100 BTC", + "long": "Under 100 BTC" + }, + "_1k_btc": { + "id": "under_1k_btc", + "short": "<1k BTC", + "long": "Under 1K BTC" + }, + "_10k_btc": { + "id": "under_10k_btc", + "short": "<10k BTC", + "long": "Under 10K BTC" + }, + "_100k_btc": { + "id": "under_100k_btc", + "short": "<100k BTC", + "long": "Under 100K BTC" + } } - def __init__(self, base_url: str = "http://localhost:3000", timeout: float = 30.0): + def __init__(self, base_url: str = 'http://localhost:3000', timeout: float = 30.0): super().__init__(base_url, timeout) self.metrics = MetricsTree(self) def get_address(self, address: Address) -> AddressStats: """Address information. - Retrieve comprehensive information about a Bitcoin address including balance, transaction history, UTXOs, and estimated investment metrics. Supports all standard Bitcoin address types (P2PKH, P2SH, P2WPKH, P2WSH, P2TR, etc.).""" - return self.get_json(f"/api/address/{address}") + Retrieve address information including balance and transaction counts. Supports all standard Bitcoin address types (P2PKH, P2SH, P2WPKH, P2WSH, P2TR). - def get_address_txs( - self, - address: Address, - after_txid: Optional[str] = None, - limit: Optional[float] = None, - ) -> List[Txid]: + *[Mempool.space docs](https://mempool.space/docs/api/rest#get-address)* + + Endpoint: `GET /api/address/{address}`""" + return self.get_json(f'/api/address/{address}') + + def get_address_txs(self, address: Address, after_txid: Optional[str] = None, limit: Optional[float] = None) -> List[Txid]: """Address transaction IDs. - Get transaction IDs for an address, newest first. Use after_txid for pagination.""" + Get transaction IDs for an address, newest first. Use after_txid for pagination. + + *[Mempool.space docs](https://mempool.space/docs/api/rest#get-address-transactions)* + + Endpoint: `GET /api/address/{address}/txs`""" params = [] - if after_txid is not None: - params.append(f"after_txid={after_txid}") - if limit is not None: - params.append(f"limit={limit}") - query = "&".join(params) - path = f"/api/address/{address}/txs{'?' + query if query else ''}" + if after_txid is not None: params.append(f'after_txid={after_txid}') + if limit is not None: params.append(f'limit={limit}') + query = '&'.join(params) + path = f'/api/address/{address}/txs{"?" + query if query else ""}' return self.get_json(path) - def get_address_txs_chain( - self, - address: Address, - after_txid: Optional[str] = None, - limit: Optional[float] = None, - ) -> List[Txid]: + def get_address_confirmed_txs(self, address: Address, after_txid: Optional[str] = None, limit: Optional[float] = None) -> List[Txid]: """Address confirmed transactions. - Get confirmed transaction IDs for an address, 25 per page. Use ?after_txid= for pagination.""" + Get confirmed transaction IDs for an address, 25 per page. Use ?after_txid= for pagination. + + *[Mempool.space docs](https://mempool.space/docs/api/rest#get-address-transactions-chain)* + + Endpoint: `GET /api/address/{address}/txs/chain`""" params = [] - if after_txid is not None: - params.append(f"after_txid={after_txid}") - if limit is not None: - params.append(f"limit={limit}") - query = "&".join(params) - path = f"/api/address/{address}/txs/chain{'?' + query if query else ''}" + if after_txid is not None: params.append(f'after_txid={after_txid}') + if limit is not None: params.append(f'limit={limit}') + query = '&'.join(params) + path = f'/api/address/{address}/txs/chain{"?" + query if query else ""}' return self.get_json(path) - def get_address_txs_mempool(self, address: Address) -> List[Txid]: + def get_address_mempool_txs(self, address: Address) -> List[Txid]: """Address mempool transactions. - Get unconfirmed transaction IDs for an address from the mempool (up to 50).""" - return self.get_json(f"/api/address/{address}/txs/mempool") + Get unconfirmed transaction IDs for an address from the mempool (up to 50). - def get_address_utxo(self, address: Address) -> List[Utxo]: + *[Mempool.space docs](https://mempool.space/docs/api/rest#get-address-transactions-mempool)* + + Endpoint: `GET /api/address/{address}/txs/mempool`""" + return self.get_json(f'/api/address/{address}/txs/mempool') + + def get_address_utxos(self, address: Address) -> List[Utxo]: """Address UTXOs. - Get unspent transaction outputs for an address.""" - return self.get_json(f"/api/address/{address}/utxo") + Get unspent transaction outputs (UTXOs) for an address. Returns txid, vout, value, and confirmation status for each UTXO. - def get_block_height(self, height: Height) -> BlockInfo: + *[Mempool.space docs](https://mempool.space/docs/api/rest#get-address-utxo)* + + Endpoint: `GET /api/address/{address}/utxo`""" + return self.get_json(f'/api/address/{address}/utxo') + + def get_block_by_height(self, height: Height) -> BlockInfo: """Block by height. - Retrieve block information by block height. Returns block metadata including hash, timestamp, difficulty, size, weight, and transaction count.""" - return self.get_json(f"/api/block-height/{height}") + Retrieve block information by block height. Returns block metadata including hash, timestamp, difficulty, size, weight, and transaction count. - def get_block_by_hash(self, hash: BlockHash) -> BlockInfo: + *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-height)* + + Endpoint: `GET /api/block-height/{height}`""" + return self.get_json(f'/api/block-height/{height}') + + def get_block(self, hash: BlockHash) -> BlockInfo: """Block information. - Retrieve block information by block hash. Returns block metadata including height, timestamp, difficulty, size, weight, and transaction count.""" - return self.get_json(f"/api/block/{hash}") + Retrieve block information by block hash. Returns block metadata including height, timestamp, difficulty, size, weight, and transaction count. - def get_block_by_hash_raw(self, hash: BlockHash) -> List[float]: + *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block)* + + Endpoint: `GET /api/block/{hash}`""" + return self.get_json(f'/api/block/{hash}') + + def get_block_raw(self, hash: BlockHash) -> List[float]: """Raw block. - Returns the raw block data in binary format.""" - return self.get_json(f"/api/block/{hash}/raw") + Returns the raw block data in binary format. - def get_block_by_hash_status(self, hash: BlockHash) -> BlockStatus: + *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-raw)* + + Endpoint: `GET /api/block/{hash}/raw`""" + return self.get_json(f'/api/block/{hash}/raw') + + def get_block_status(self, hash: BlockHash) -> BlockStatus: """Block status. - 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.""" - return self.get_json(f"/api/block/{hash}/status") + 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. - def get_block_by_hash_txid_by_index(self, hash: BlockHash, index: TxIndex) -> Txid: + *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-status)* + + Endpoint: `GET /api/block/{hash}/status`""" + return self.get_json(f'/api/block/{hash}/status') + + def get_block_txid(self, hash: BlockHash, index: TxIndex) -> Txid: """Transaction ID at index. - Retrieve a single transaction ID at a specific index within a block. Returns plain text txid.""" - return self.get_json(f"/api/block/{hash}/txid/{index}") + Retrieve a single transaction ID at a specific index within a block. Returns plain text txid. - def get_block_by_hash_txids(self, hash: BlockHash) -> List[Txid]: + *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-transaction-id)* + + Endpoint: `GET /api/block/{hash}/txid/{index}`""" + return self.get_json(f'/api/block/{hash}/txid/{index}') + + def get_block_txids(self, hash: BlockHash) -> List[Txid]: """Block transaction IDs. - Retrieve all transaction IDs in a block by block hash.""" - return self.get_json(f"/api/block/{hash}/txids") + Retrieve all transaction IDs in a block. Returns an array of txids in block order. - def get_block_by_hash_txs_by_start_index( - self, hash: BlockHash, start_index: TxIndex - ) -> List[Transaction]: + *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-transaction-ids)* + + Endpoint: `GET /api/block/{hash}/txids`""" + return self.get_json(f'/api/block/{hash}/txids') + + def get_block_txs(self, hash: BlockHash, start_index: TxIndex) -> List[Transaction]: """Block transactions (paginated). - Retrieve transactions in a block by block hash, starting from the specified index. Returns up to 25 transactions at a time.""" - return self.get_json(f"/api/block/{hash}/txs/{start_index}") + Retrieve transactions in a block by block hash, starting from the specified index. Returns up to 25 transactions at a time. + + *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-transactions)* + + Endpoint: `GET /api/block/{hash}/txs/{start_index}`""" + return self.get_json(f'/api/block/{hash}/txs/{start_index}') def get_blocks(self) -> List[BlockInfo]: """Recent blocks. - Retrieve the last 10 blocks. Returns block metadata for each block.""" - return self.get_json("/api/blocks") + Retrieve the last 10 blocks. Returns block metadata for each block. - def get_blocks_by_height(self, height: Height) -> List[BlockInfo]: + *[Mempool.space docs](https://mempool.space/docs/api/rest#get-blocks)* + + Endpoint: `GET /api/blocks`""" + return self.get_json('/api/blocks') + + def get_blocks_from_height(self, height: Height) -> List[BlockInfo]: """Blocks from height. - 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.""" - return self.get_json(f"/api/blocks/{height}") + 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. - def get_mempool_info(self) -> MempoolInfo: + *[Mempool.space docs](https://mempool.space/docs/api/rest#get-blocks)* + + Endpoint: `GET /api/blocks/{height}`""" + return self.get_json(f'/api/blocks/{height}') + + def get_mempool(self) -> MempoolInfo: """Mempool statistics. - Get current mempool statistics including transaction count, total vsize, and total fees.""" - return self.get_json("/api/mempool/info") + Get current mempool statistics including transaction count, total vsize, and total fees. + + *[Mempool.space docs](https://mempool.space/docs/api/rest#get-mempool)* + + Endpoint: `GET /api/mempool/info`""" + return self.get_json('/api/mempool/info') def get_mempool_txids(self) -> List[Txid]: """Mempool transaction IDs. - Get all transaction IDs currently in the mempool.""" - return self.get_json("/api/mempool/txids") + Get all transaction IDs currently in the mempool. - def get_metric(self, metric: Metric) -> List[Index]: + *[Mempool.space docs](https://mempool.space/docs/api/rest#get-mempool-transaction-ids)* + + Endpoint: `GET /api/mempool/txids`""" + return self.get_json('/api/mempool/txids') + + def get_metric_info(self, metric: Metric) -> List[Index]: """Get supported indexes for a metric. - Returns the list of indexes are supported by the specified metric. For example, `realized_price` might be available on dateindex, weekindex, and monthindex.""" - return self.get_json(f"/api/metric/{metric}") + Returns the list of indexes supported by the specified metric. For example, `realized_price` might be available on dateindex, weekindex, and monthindex. - def get_metric_by_index( - self, - metric: Metric, - index: Index, - start: Optional[float] = None, - end: Optional[float] = None, - limit: Optional[str] = None, - format: Optional[Format] = None, - ) -> Union[AnyMetricData, str]: + Endpoint: `GET /api/metric/{metric}`""" + return self.get_json(f'/api/metric/{metric}') + + def get_metric(self, metric: Metric, index: Index, start: Optional[float] = None, end: Optional[float] = None, limit: Optional[str] = None, format: Optional[Format] = None) -> Union[AnyMetricData, str]: """Get metric data. - Fetch data for a specific metric at the given index. Use query parameters to filter by date range and format (json/csv).""" + Fetch data for a specific metric at the given index. Use query parameters to filter by date range and format (json/csv). + + Endpoint: `GET /api/metric/{metric}/{index}`""" params = [] - if start is not None: - params.append(f"start={start}") - if end is not None: - params.append(f"end={end}") - if limit is not None: - params.append(f"limit={limit}") - if format is not None: - params.append(f"format={format}") - query = "&".join(params) - path = f"/api/metric/{metric}/{index}{'?' + query if query else ''}" - if format == "csv": + if start is not None: params.append(f'start={start}') + if end is not None: params.append(f'end={end}') + if limit is not None: params.append(f'limit={limit}') + if format is not None: params.append(f'format={format}') + query = '&'.join(params) + path = f'/api/metric/{metric}/{index}{"?" + query if query else ""}' + if format == 'csv': return self.get_text(path) return self.get_json(path) - def get_metrics(self) -> TreeNode: + def get_metrics_tree(self) -> TreeNode: """Metrics catalog. - Returns the complete hierarchical catalog of available metrics organized as a tree structure. Metrics are grouped by categories and subcategories. Best viewed in an interactive JSON viewer (e.g., Firefox's built-in JSON viewer) for easy navigation of the nested structure.""" - return self.get_json("/api/metrics") + Returns the complete hierarchical catalog of available metrics organized as a tree structure. Metrics are grouped by categories and subcategories. - def get_metrics_bulk( - self, - metrics: Metrics, - index: Index, - start: Optional[float] = None, - end: Optional[float] = None, - limit: Optional[str] = None, - format: Optional[Format] = None, - ) -> Union[List[AnyMetricData], str]: + Endpoint: `GET /api/metrics`""" + return self.get_json('/api/metrics') + + def get_metrics(self, metrics: Metrics, index: Index, start: Optional[float] = None, end: Optional[float] = None, limit: Optional[str] = None, format: Optional[Format] = None) -> Union[List[AnyMetricData], str]: """Bulk metric data. - Fetch multiple metrics in a single request. Supports filtering by index and date range. Returns an array of MetricData objects.""" + Fetch multiple metrics in a single request. Supports filtering by index and date range. Returns an array of MetricData objects. For a single metric, use `get_metric` instead. + + Endpoint: `GET /api/metrics/bulk`""" params = [] - params.append(f"metrics={metrics}") - params.append(f"index={index}") - if start is not None: - params.append(f"start={start}") - if end is not None: - params.append(f"end={end}") - if limit is not None: - params.append(f"limit={limit}") - if format is not None: - params.append(f"format={format}") - query = "&".join(params) - path = f"/api/metrics/bulk{'?' + query if query else ''}" - if format == "csv": + params.append(f'metrics={metrics}') + params.append(f'index={index}') + if start is not None: params.append(f'start={start}') + if end is not None: params.append(f'end={end}') + if limit is not None: params.append(f'limit={limit}') + if format is not None: params.append(f'format={format}') + query = '&'.join(params) + path = f'/api/metrics/bulk{"?" + query if query else ""}' + if format == 'csv': return self.get_text(path) return self.get_json(path) def get_metrics_count(self) -> List[MetricCount]: """Metric count. - Current metric count""" - return self.get_json("/api/metrics/count") + Returns the number of metrics available per index type. - def get_metrics_indexes(self) -> List[IndexInfo]: + Endpoint: `GET /api/metrics/count`""" + return self.get_json('/api/metrics/count') + + def get_indexes(self) -> List[IndexInfo]: """List available indexes. - Returns all available indexes with their accepted query aliases. Use any alias when querying metrics.""" - return self.get_json("/api/metrics/indexes") + Returns all available indexes with their accepted query aliases. Use any alias when querying metrics. - def get_metrics_list(self, page: Optional[float] = None) -> PaginatedMetrics: + Endpoint: `GET /api/metrics/indexes`""" + return self.get_json('/api/metrics/indexes') + + def list_metrics(self, page: Optional[float] = None) -> PaginatedMetrics: """Metrics list. - Paginated list of available metrics""" + Paginated flat list of all available metric names. Use `page` query param for pagination. + + Endpoint: `GET /api/metrics/list`""" params = [] - if page is not None: - params.append(f"page={page}") - query = "&".join(params) - path = f"/api/metrics/list{'?' + query if query else ''}" + if page is not None: params.append(f'page={page}') + query = '&'.join(params) + path = f'/api/metrics/list{"?" + query if query else ""}' return self.get_json(path) - def get_metrics_search_by_metric( - self, metric: Metric, limit: Optional[Limit] = None - ) -> List[Metric]: + def search_metrics(self, metric: Metric, limit: Optional[Limit] = None) -> List[Metric]: """Search metrics. - Fuzzy search for metrics by name. Supports partial matches and typos.""" + Fuzzy search for metrics by name. Supports partial matches and typos. + + Endpoint: `GET /api/metrics/search/{metric}`""" params = [] - if limit is not None: - params.append(f"limit={limit}") - query = "&".join(params) - path = f"/api/metrics/search/{metric}{'?' + query if query else ''}" + if limit is not None: params.append(f'limit={limit}') + query = '&'.join(params) + path = f'/api/metrics/search/{metric}{"?" + query if query else ""}' return self.get_json(path) - def get_tx_by_txid(self, txid: Txid) -> Transaction: + def get_tx(self, txid: Txid) -> Transaction: """Transaction information. - Retrieve complete transaction data by transaction ID (txid). Returns the full transaction details including inputs, outputs, and metadata. The transaction data is read directly from the blockchain data files.""" - return self.get_json(f"/api/tx/{txid}") + Retrieve complete transaction data by transaction ID (txid). Returns inputs, outputs, fee, size, and confirmation status. - def get_tx_by_txid_hex(self, txid: Txid) -> Hex: + *[Mempool.space docs](https://mempool.space/docs/api/rest#get-transaction)* + + Endpoint: `GET /api/tx/{txid}`""" + return self.get_json(f'/api/tx/{txid}') + + def get_tx_hex(self, txid: Txid) -> Hex: """Transaction hex. - Retrieve the raw transaction as a hex-encoded string. Returns the serialized transaction in hexadecimal format.""" - return self.get_json(f"/api/tx/{txid}/hex") + Retrieve the raw transaction as a hex-encoded string. Returns the serialized transaction in hexadecimal format. - def get_tx_by_txid_outspend_by_vout(self, txid: Txid, vout: Vout) -> TxOutspend: + *[Mempool.space docs](https://mempool.space/docs/api/rest#get-transaction-hex)* + + Endpoint: `GET /api/tx/{txid}/hex`""" + return self.get_json(f'/api/tx/{txid}/hex') + + def get_tx_outspend(self, txid: Txid, vout: Vout) -> TxOutspend: """Output spend status. - Get the spending status of a transaction output. Returns whether the output has been spent and, if so, the spending transaction details.""" - return self.get_json(f"/api/tx/{txid}/outspend/{vout}") + Get the spending status of a transaction output. Returns whether the output has been spent and, if so, the spending transaction details. - def get_tx_by_txid_outspends(self, txid: Txid) -> List[TxOutspend]: + *[Mempool.space docs](https://mempool.space/docs/api/rest#get-transaction-outspend)* + + Endpoint: `GET /api/tx/{txid}/outspend/{vout}`""" + return self.get_json(f'/api/tx/{txid}/outspend/{vout}') + + def get_tx_outspends(self, txid: Txid) -> List[TxOutspend]: """All output spend statuses. - Get the spending status of all outputs in a transaction. Returns an array with the spend status for each output.""" - return self.get_json(f"/api/tx/{txid}/outspends") + Get the spending status of all outputs in a transaction. Returns an array with the spend status for each output. - def get_tx_by_txid_status(self, txid: Txid) -> TxStatus: + *[Mempool.space docs](https://mempool.space/docs/api/rest#get-transaction-outspends)* + + Endpoint: `GET /api/tx/{txid}/outspends`""" + return self.get_json(f'/api/tx/{txid}/outspends') + + def get_tx_status(self, txid: Txid) -> TxStatus: """Transaction status. - Retrieve the confirmation status of a transaction. Returns whether the transaction is confirmed and, if so, the block height, hash, and timestamp.""" - return self.get_json(f"/api/tx/{txid}/status") + Retrieve the confirmation status of a transaction. Returns whether the transaction is confirmed and, if so, the block height, hash, and timestamp. - def get_v1_difficulty_adjustment(self) -> DifficultyAdjustment: + *[Mempool.space docs](https://mempool.space/docs/api/rest#get-transaction-status)* + + Endpoint: `GET /api/tx/{txid}/status`""" + return self.get_json(f'/api/tx/{txid}/status') + + def get_difficulty_adjustment(self) -> DifficultyAdjustment: """Difficulty adjustment. - Get current difficulty adjustment information including progress through the current epoch, estimated retarget date, and difficulty change prediction.""" - return self.get_json("/api/v1/difficulty-adjustment") + Get current difficulty adjustment information including progress through the current epoch, estimated retarget date, and difficulty change prediction. - def get_v1_fees_mempool_blocks(self) -> List[MempoolBlock]: + *[Mempool.space docs](https://mempool.space/docs/api/rest#get-difficulty-adjustment)* + + Endpoint: `GET /api/v1/difficulty-adjustment`""" + return self.get_json('/api/v1/difficulty-adjustment') + + def get_mempool_blocks(self) -> List[MempoolBlock]: """Projected mempool blocks. - Get projected blocks from the mempool for fee estimation. Each block contains statistics about transactions that would be included if a block were mined now.""" - return self.get_json("/api/v1/fees/mempool-blocks") + Get projected blocks from the mempool for fee estimation. Each block contains statistics about transactions that would be included if a block were mined now. - def get_v1_fees_recommended(self) -> RecommendedFees: + *[Mempool.space docs](https://mempool.space/docs/api/rest#get-mempool-blocks-fees)* + + Endpoint: `GET /api/v1/fees/mempool-blocks`""" + return self.get_json('/api/v1/fees/mempool-blocks') + + def get_recommended_fees(self) -> RecommendedFees: """Recommended fees. - Get recommended fee rates for different confirmation targets based on current mempool state.""" - return self.get_json("/api/v1/fees/recommended") + Get recommended fee rates for different confirmation targets based on current mempool state. - def get_v1_mining_blocks_fees_by_time_period( - self, time_period: TimePeriod - ) -> List[BlockFeesEntry]: + *[Mempool.space docs](https://mempool.space/docs/api/rest#get-recommended-fees)* + + Endpoint: `GET /api/v1/fees/recommended`""" + return self.get_json('/api/v1/fees/recommended') + + def get_block_fee_rates(self, time_period: TimePeriod) -> Any: + """Block fee rates (WIP). + + **Work in progress.** Get block fee rate percentiles (min, 10th, 25th, median, 75th, 90th, max) for a time period. Valid periods: 24h, 3d, 1w, 1m, 3m, 6m, 1y, 2y, 3y + + *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-feerates)* + + Endpoint: `GET /api/v1/mining/blocks/fee-rates/{time_period}`""" + return self.get_json(f'/api/v1/mining/blocks/fee-rates/{time_period}') + + def get_block_fees(self, time_period: TimePeriod) -> List[BlockFeesEntry]: """Block fees. - Get average block fees for a time period. Valid periods: 24h, 3d, 1w, 1m, 3m, 6m, 1y, 2y, 3y""" - return self.get_json(f"/api/v1/mining/blocks/fees/{time_period}") + Get average block fees for a time period. Valid periods: 24h, 3d, 1w, 1m, 3m, 6m, 1y, 2y, 3y - def get_v1_mining_blocks_rewards_by_time_period( - self, time_period: TimePeriod - ) -> List[BlockRewardsEntry]: + *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-fees)* + + Endpoint: `GET /api/v1/mining/blocks/fees/{time_period}`""" + return self.get_json(f'/api/v1/mining/blocks/fees/{time_period}') + + def get_block_rewards(self, time_period: TimePeriod) -> List[BlockRewardsEntry]: """Block rewards. - Get average block rewards (coinbase = subsidy + fees) for a time period. Valid periods: 24h, 3d, 1w, 1m, 3m, 6m, 1y, 2y, 3y""" - return self.get_json(f"/api/v1/mining/blocks/rewards/{time_period}") + Get average block rewards (coinbase = subsidy + fees) for a time period. Valid periods: 24h, 3d, 1w, 1m, 3m, 6m, 1y, 2y, 3y - def get_v1_mining_blocks_sizes_weights_by_time_period( - self, time_period: TimePeriod - ) -> BlockSizesWeights: + *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-rewards)* + + Endpoint: `GET /api/v1/mining/blocks/rewards/{time_period}`""" + return self.get_json(f'/api/v1/mining/blocks/rewards/{time_period}') + + def get_block_sizes_weights(self, time_period: TimePeriod) -> BlockSizesWeights: """Block sizes and weights. - Get average block sizes and weights for a time period. Valid periods: 24h, 3d, 1w, 1m, 3m, 6m, 1y, 2y, 3y""" - return self.get_json(f"/api/v1/mining/blocks/sizes-weights/{time_period}") + Get average block sizes and weights for a time period. Valid periods: 24h, 3d, 1w, 1m, 3m, 6m, 1y, 2y, 3y - def get_v1_mining_blocks_timestamp(self, timestamp: Timestamp) -> BlockTimestamp: + *[Mempool.space docs](https://mempool.space/docs/api/rest#get-sizes-weights)* + + Endpoint: `GET /api/v1/mining/blocks/sizes-weights/{time_period}`""" + return self.get_json(f'/api/v1/mining/blocks/sizes-weights/{time_period}') + + def get_block_by_timestamp(self, timestamp: Timestamp) -> BlockTimestamp: """Block by timestamp. - Find the block closest to a given UNIX timestamp.""" - return self.get_json(f"/api/v1/mining/blocks/timestamp/{timestamp}") + Find the block closest to a given UNIX timestamp. - def get_v1_mining_difficulty_adjustments(self) -> List[DifficultyAdjustmentEntry]: + *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-timestamp)* + + Endpoint: `GET /api/v1/mining/blocks/timestamp/{timestamp}`""" + return self.get_json(f'/api/v1/mining/blocks/timestamp/{timestamp}') + + def get_difficulty_adjustments(self) -> List[DifficultyAdjustmentEntry]: """Difficulty adjustments (all time). - Get historical difficulty adjustments. Returns array of [timestamp, height, difficulty, change_percent].""" - return self.get_json("/api/v1/mining/difficulty-adjustments") + Get historical difficulty adjustments including timestamp, block height, difficulty value, and percentage change. - def get_v1_mining_difficulty_adjustments_by_time_period( - self, time_period: TimePeriod - ) -> List[DifficultyAdjustmentEntry]: + *[Mempool.space docs](https://mempool.space/docs/api/rest#get-difficulty-adjustments)* + + Endpoint: `GET /api/v1/mining/difficulty-adjustments`""" + return self.get_json('/api/v1/mining/difficulty-adjustments') + + def get_difficulty_adjustments_by_period(self, time_period: TimePeriod) -> List[DifficultyAdjustmentEntry]: """Difficulty adjustments. - Get historical difficulty adjustments for a time period. Valid periods: 24h, 3d, 1w, 1m, 3m, 6m, 1y, 2y, 3y. Returns array of [timestamp, height, difficulty, change_percent].""" - return self.get_json(f"/api/v1/mining/difficulty-adjustments/{time_period}") + Get historical difficulty adjustments for a time period. Valid periods: 24h, 3d, 1w, 1m, 3m, 6m, 1y, 2y, 3y. - def get_v1_mining_hashrate(self) -> HashrateSummary: + *[Mempool.space docs](https://mempool.space/docs/api/rest#get-difficulty-adjustments)* + + Endpoint: `GET /api/v1/mining/difficulty-adjustments/{time_period}`""" + return self.get_json(f'/api/v1/mining/difficulty-adjustments/{time_period}') + + def get_hashrate(self) -> HashrateSummary: """Network hashrate (all time). - Get network hashrate and difficulty data for all time.""" - return self.get_json("/api/v1/mining/hashrate") + Get network hashrate and difficulty data for all time. - def get_v1_mining_hashrate_by_time_period( - self, time_period: TimePeriod - ) -> HashrateSummary: + *[Mempool.space docs](https://mempool.space/docs/api/rest#get-hashrate)* + + Endpoint: `GET /api/v1/mining/hashrate`""" + return self.get_json('/api/v1/mining/hashrate') + + def get_hashrate_by_period(self, time_period: TimePeriod) -> HashrateSummary: """Network hashrate. - Get network hashrate and difficulty data for a time period. Valid periods: 24h, 3d, 1w, 1m, 3m, 6m, 1y, 2y, 3y""" - return self.get_json(f"/api/v1/mining/hashrate/{time_period}") + Get network hashrate and difficulty data for a time period. Valid periods: 24h, 3d, 1w, 1m, 3m, 6m, 1y, 2y, 3y - def get_v1_mining_pool_by_slug(self, slug: PoolSlug) -> PoolDetail: + *[Mempool.space docs](https://mempool.space/docs/api/rest#get-hashrate)* + + Endpoint: `GET /api/v1/mining/hashrate/{time_period}`""" + return self.get_json(f'/api/v1/mining/hashrate/{time_period}') + + def get_pool(self, slug: PoolSlug) -> PoolDetail: """Mining pool details. - Get detailed information about a specific mining pool including block counts and shares for different time periods.""" - return self.get_json(f"/api/v1/mining/pool/{slug}") + Get detailed information about a specific mining pool including block counts and shares for different time periods. - def get_v1_mining_pools(self) -> List[PoolInfo]: + *[Mempool.space docs](https://mempool.space/docs/api/rest#get-mining-pool)* + + Endpoint: `GET /api/v1/mining/pool/{slug}`""" + return self.get_json(f'/api/v1/mining/pool/{slug}') + + def get_pools(self) -> List[PoolInfo]: """List all mining pools. - Get list of all known mining pools with their identifiers.""" - return self.get_json("/api/v1/mining/pools") + Get list of all known mining pools with their identifiers. - def get_v1_mining_pools_by_time_period( - self, time_period: TimePeriod - ) -> PoolsSummary: + *[Mempool.space docs](https://mempool.space/docs/api/rest#get-mining-pools)* + + Endpoint: `GET /api/v1/mining/pools`""" + return self.get_json('/api/v1/mining/pools') + + def get_pool_stats(self, time_period: TimePeriod) -> PoolsSummary: """Mining pool statistics. - Get mining pool statistics for a time period. Valid periods: 24h, 3d, 1w, 1m, 3m, 6m, 1y, 2y, 3y""" - return self.get_json(f"/api/v1/mining/pools/{time_period}") + Get mining pool statistics for a time period. Valid periods: 24h, 3d, 1w, 1m, 3m, 6m, 1y, 2y, 3y - def get_v1_mining_reward_stats_by_block_count( - self, block_count: float - ) -> RewardStats: + *[Mempool.space docs](https://mempool.space/docs/api/rest#get-mining-pools)* + + Endpoint: `GET /api/v1/mining/pools/{time_period}`""" + return self.get_json(f'/api/v1/mining/pools/{time_period}') + + def get_reward_stats(self, block_count: float) -> RewardStats: """Mining reward statistics. - Get mining reward statistics for the last N blocks including total rewards, fees, and transaction count.""" - return self.get_json(f"/api/v1/mining/reward-stats/{block_count}") + Get mining reward statistics for the last N blocks including total rewards, fees, and transaction count. - def get_v1_validate_address(self, address: str) -> AddressValidation: + *[Mempool.space docs](https://mempool.space/docs/api/rest#get-reward-stats)* + + Endpoint: `GET /api/v1/mining/reward-stats/{block_count}`""" + return self.get_json(f'/api/v1/mining/reward-stats/{block_count}') + + def validate_address(self, address: str) -> AddressValidation: """Validate address. - Validate a Bitcoin address and get information about its type and scriptPubKey.""" - return self.get_json(f"/api/v1/validate-address/{address}") + Validate a Bitcoin address and get information about its type and scriptPubKey. + + *[Mempool.space docs](https://mempool.space/docs/api/rest#get-address-validate)* + + Endpoint: `GET /api/v1/validate-address/{address}`""" + return self.get_json(f'/api/v1/validate-address/{address}') def get_health(self) -> Health: """Health check. - Returns the health status of the API server""" - return self.get_json("/health") + Returns the health status of the API server + + Endpoint: `GET /health`""" + return self.get_json('/health') def get_version(self) -> str: """API version. - Returns the current version of the API server""" - return self.get_json("/version") + Returns the current version of the API server + + Endpoint: `GET /version`""" + return self.get_json('/version') + diff --git a/websites/bitview/index.html b/websites/bitview/index.html index e3b9ea5d5..b4295119e 100644 --- a/websites/bitview/index.html +++ b/websites/bitview/index.html @@ -1558,12 +1558,12 @@ - + - + - + @@ -1577,21 +1577,21 @@ - + - + - + - + - - - + + + - + @@ -1604,7 +1604,7 @@ - + @@ -1629,12 +1629,12 @@