diff --git a/Cargo.lock b/Cargo.lock index f7bd29388..1379005d8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3088,6 +3088,7 @@ version = "1.0.149" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" dependencies = [ + "indexmap", "itoa", "memchr", "serde", diff --git a/Cargo.toml b/Cargo.toml index 388bdfc9d..7bce93776 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -75,7 +75,7 @@ schemars = "1.2.0" serde = "1.0.228" serde_bytes = "0.11.19" serde_derive = "1.0.228" -serde_json = { version = "1.0.149", features = ["float_roundtrip"] } +serde_json = { version = "1.0.149", features = ["float_roundtrip", "preserve_order"] } smallvec = "1.15.1" tokio = { version = "1.49.0", features = ["rt-multi-thread"] } tracing = { version = "0.1", default-features = false, features = ["std"] } diff --git a/crates/brk_bindgen/src/analysis/tree.rs b/crates/brk_bindgen/src/analysis/tree.rs index 0d7abff44..d27dd13f6 100644 --- a/crates/brk_bindgen/src/analysis/tree.rs +++ b/crates/brk_bindgen/src/analysis/tree.rs @@ -17,6 +17,20 @@ pub fn get_first_leaf_name(node: &TreeNode) -> Option { } } +/// Get the shortest leaf name from a tree node. +/// +/// This is useful for pattern base analysis where we want the "base" case +/// (e.g., the leaf without suffix like `_btc` or `_usd`). +fn get_shortest_leaf_name(node: &TreeNode) -> Option { + match node { + TreeNode::Leaf(leaf) => Some(leaf.name().to_string()), + TreeNode::Branch(children) => children + .values() + .filter_map(get_shortest_leaf_name) + .min_by_key(|name| name.len()), + } +} + /// Get all leaf names from a tree node. pub fn get_all_leaf_names(node: &TreeNode) -> Vec { match node { @@ -122,14 +136,17 @@ pub fn get_pattern_instance_base(node: &TreeNode) -> String { analyze_pattern_level(&child_names).base } -/// Get (field_name, first_leaf_name) pairs for direct children of a branch node. +/// Get (field_name, shortest_leaf_name) pairs for direct children of a branch node. +/// +/// Uses the shortest leaf name from each child subtree to find the "base" case +/// (the leaf without suffix modifiers like `_btc` or `_usd`). fn get_direct_children_for_analysis(node: &TreeNode) -> Vec<(String, String)> { match node { TreeNode::Leaf(leaf) => vec![(leaf.name().to_string(), leaf.name().to_string())], TreeNode::Branch(children) => children .iter() .filter_map(|(field_name, child)| { - get_first_leaf_name(child).map(|leaf_name| (field_name.clone(), leaf_name)) + get_shortest_leaf_name(child).map(|leaf_name| (field_name.clone(), leaf_name)) }) .collect(), } diff --git a/crates/brk_bindgen/src/generators/javascript/api.rs b/crates/brk_bindgen/src/generators/javascript/api.rs index e7990e051..cdacd24df 100644 --- a/crates/brk_bindgen/src/generators/javascript/api.rs +++ b/crates/brk_bindgen/src/generators/javascript/api.rs @@ -12,7 +12,13 @@ pub fn generate_api_methods(output: &mut String, endpoints: &[Endpoint]) { } let method_name = endpoint_to_method_name(endpoint); - let return_type = normalize_return_type(endpoint.response_type.as_deref().unwrap_or("*")); + let base_return_type = + normalize_return_type(endpoint.response_type.as_deref().unwrap_or("*")); + let return_type = if endpoint.supports_csv { + format!("{} | string", base_return_type) + } else { + base_return_type + }; writeln!(output, " /**").unwrap(); if let Some(summary) = &endpoint.summary { @@ -58,7 +64,7 @@ pub fn generate_api_methods(output: &mut String, endpoints: &[Endpoint]) { let path = build_path_template(&endpoint.path, &endpoint.path_params); if endpoint.query_params.is_empty() { - writeln!(output, " return this.get(`{}`);", path).unwrap(); + writeln!(output, " return this.getJson(`{}`);", path).unwrap(); } else { writeln!(output, " const params = new URLSearchParams();").unwrap(); for param in &endpoint.query_params { @@ -79,12 +85,16 @@ pub fn generate_api_methods(output: &mut String, endpoints: &[Endpoint]) { } } writeln!(output, " const query = params.toString();").unwrap(); - writeln!( - output, - " return this.get(`{}${{query ? '?' + query : ''}}`);", - path - ) - .unwrap(); + writeln!(output, " const path = `{}${{query ? '?' + query : ''}}`;", path).unwrap(); + + if endpoint.supports_csv { + writeln!(output, " if (format === 'csv') {{").unwrap(); + writeln!(output, " return this.getText(path);").unwrap(); + writeln!(output, " }}").unwrap(); + writeln!(output, " return this.getJson(path);").unwrap(); + } else { + writeln!(output, " return this.getJson(path);").unwrap(); + } } writeln!(output, " }}\n").unwrap(); diff --git a/crates/brk_bindgen/src/generators/javascript/client.rs b/crates/brk_bindgen/src/generators/javascript/client.rs index 8bf09453f..3e9baf24e 100644 --- a/crates/brk_bindgen/src/generators/javascript/client.rs +++ b/crates/brk_bindgen/src/generators/javascript/client.rs @@ -52,8 +52,8 @@ class BrkError extends Error {{ * @template T * @typedef {{Object}} MetricData * @property {{number}} total - Total number of data points - * @property {{number}} from - Start index (inclusive) - * @property {{number}} to - End index (exclusive) + * @property {{number}} start - Start index (inclusive) + * @property {{number}} end - End index (exclusive) * @property {{T[]}} data - The metric data */ /** @typedef {{MetricData}} AnyMetricData */ @@ -62,7 +62,7 @@ class BrkError extends Error {{ * @template T * @typedef {{Object}} MetricEndpoint * @property {{(onUpdate?: (value: MetricData) => void) => Promise>}} get - Fetch all data points - * @property {{(from?: number, to?: number, onUpdate?: (value: MetricData) => void) => Promise>}} range - Fetch data in range + * @property {{(start?: number, end?: number, onUpdate?: (value: MetricData) => void) => Promise>}} range - Fetch data in range * @property {{string}} path - The endpoint path */ /** @typedef {{MetricEndpoint}} AnyMetricEndpoint */ @@ -89,13 +89,13 @@ class BrkError extends Error {{ function _endpoint(client, name, index) {{ const p = `/api/metric/${{name}}/${{index}}`; return {{ - get: (onUpdate) => client.get(p, onUpdate), - range: (from, to, onUpdate) => {{ + get: (onUpdate) => client.getJson(p, onUpdate), + range: (start, end, onUpdate) => {{ const params = new URLSearchParams(); - if (from !== undefined) params.set('from', String(from)); - if (to !== undefined) params.set('to', String(to)); + if (start !== undefined) params.set('start', String(start)); + if (end !== undefined) params.set('end', String(end)); const query = params.toString(); - return client.get(query ? `${{p}}?${{query}}` : p, onUpdate); + return client.getJson(query ? `${{p}}?${{query}}` : p, onUpdate); }}, get path() {{ return p; }}, }}; @@ -114,6 +114,18 @@ class BrkClientBase {{ this.timeout = isString ? 5000 : (options.timeout ?? 5000); }} + /** + * @param {{string}} path + * @returns {{Promise}} + */ + async get(path) {{ + 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); + return res; + }} + /** * Make a GET request with stale-while-revalidate caching * @template T @@ -121,7 +133,7 @@ class BrkClientBase {{ * @param {{(value: T) => void}} [onUpdate] - Called when data is available * @returns {{Promise}} */ - async get(path, onUpdate) {{ + async getJson(path, onUpdate) {{ const base = this.baseUrl.endsWith('/') ? this.baseUrl.slice(0, -1) : this.baseUrl; const url = `${{base}}${{path}}`; const cache = await _cachePromise; @@ -135,8 +147,7 @@ class BrkClientBase {{ }} try {{ - const res = await fetch(url, {{ signal: AbortSignal.timeout(this.timeout) }}); - if (!res.ok) throw new BrkError(`HTTP ${{res.status}}`, res.status); + const res = await this.get(path); if (cachedRes?.headers.get('ETag') === res.headers.get('ETag')) return cachedJson; const cloned = res.clone(); @@ -149,6 +160,16 @@ class BrkClientBase {{ throw e; }} }} + + /** + * Make a GET request and return raw text (for CSV responses) + * @param {{string}} path + * @returns {{Promise}} + */ + async getText(path) {{ + const res = await this.get(path); + return res.text(); + }} }} /** diff --git a/crates/brk_bindgen/src/generators/javascript/tree.rs b/crates/brk_bindgen/src/generators/javascript/tree.rs index c50619d38..16a46ffa2 100644 --- a/crates/brk_bindgen/src/generators/javascript/tree.rs +++ b/crates/brk_bindgen/src/generators/javascript/tree.rs @@ -14,7 +14,7 @@ use crate::{ use super::api::generate_api_methods; use super::client::generate_static_constants; -/// Generate JSDoc typedefs for the catalog tree. +/// Generate JSDoc typedefs for the metrics tree. pub fn generate_tree_typedefs(output: &mut String, catalog: &TreeNode, metadata: &ClientMetadata) { writeln!(output, "// Catalog tree typedefs\n").unwrap(); @@ -22,7 +22,7 @@ pub fn generate_tree_typedefs(output: &mut String, catalog: &TreeNode, metadata: let mut generated = HashSet::new(); generate_tree_typedef( output, - "CatalogTree", + "MetricsTree", catalog, &pattern_lookup, metadata, @@ -98,7 +98,7 @@ pub fn generate_main_client( writeln!(output, "/**").unwrap(); writeln!( output, - " * Main BRK client with catalog tree and API methods" + " * Main BRK client with metrics tree and API methods" ) .unwrap(); writeln!(output, " * @extends BrkClientBase").unwrap(); @@ -112,14 +112,14 @@ pub fn generate_main_client( writeln!(output, " */").unwrap(); writeln!(output, " constructor(options) {{").unwrap(); writeln!(output, " super(options);").unwrap(); - writeln!(output, " /** @type {{CatalogTree}} */").unwrap(); - writeln!(output, " this.tree = this._buildTree('');").unwrap(); + writeln!(output, " /** @type {{MetricsTree}} */").unwrap(); + writeln!(output, " this.metrics = this._buildTree('');").unwrap(); writeln!(output, " }}\n").unwrap(); writeln!(output, " /**").unwrap(); writeln!(output, " * @private").unwrap(); writeln!(output, " * @param {{string}} basePath").unwrap(); - writeln!(output, " * @returns {{CatalogTree}}").unwrap(); + writeln!(output, " * @returns {{MetricsTree}}").unwrap(); writeln!(output, " */").unwrap(); writeln!(output, " _buildTree(basePath) {{").unwrap(); writeln!(output, " return {{").unwrap(); diff --git a/crates/brk_bindgen/src/generators/python/api.rs b/crates/brk_bindgen/src/generators/python/api.rs index 5d3254626..a97c1ec98 100644 --- a/crates/brk_bindgen/src/generators/python/api.rs +++ b/crates/brk_bindgen/src/generators/python/api.rs @@ -12,7 +12,7 @@ pub fn generate_main_client(output: &mut String, endpoints: &[Endpoint]) { writeln!(output, "class BrkClient(BrkClientBase):").unwrap(); writeln!( output, - " \"\"\"Main BRK client with catalog tree and API methods.\"\"\"" + " \"\"\"Main BRK client with metrics tree and API methods.\"\"\"" ) .unwrap(); writeln!(output).unwrap(); @@ -26,7 +26,7 @@ pub fn generate_main_client(output: &mut String, endpoints: &[Endpoint]) { ) .unwrap(); writeln!(output, " super().__init__(base_url, timeout)").unwrap(); - writeln!(output, " self.tree = CatalogTree(self)").unwrap(); + writeln!(output, " self.metrics = MetricsTree(self)").unwrap(); writeln!(output).unwrap(); // Generate API methods @@ -41,7 +41,7 @@ pub fn generate_api_methods(output: &mut String, endpoints: &[Endpoint]) { } let method_name = endpoint_to_method_name(endpoint); - let return_type = normalize_return_type( + let base_return_type = normalize_return_type( &endpoint .response_type .as_deref() @@ -49,6 +49,12 @@ pub fn generate_api_methods(output: &mut String, endpoints: &[Endpoint]) { .unwrap_or_else(|| "Any".to_string()), ); + let return_type = if endpoint.supports_csv { + format!("Union[{}, str]", base_return_type) + } else { + base_return_type + }; + // Build method signature let params = build_method_params(endpoint); writeln!( @@ -79,9 +85,9 @@ pub fn generate_api_methods(output: &mut String, endpoints: &[Endpoint]) { if endpoint.query_params.is_empty() { if endpoint.path_params.is_empty() { - writeln!(output, " return self.get('{}')", path).unwrap(); + writeln!(output, " return self.get_json('{}')", path).unwrap(); } else { - writeln!(output, " return self.get(f'{}')", path).unwrap(); + writeln!(output, " return self.get_json(f'{}')", path).unwrap(); } } else { writeln!(output, " params = []").unwrap(); @@ -107,10 +113,18 @@ pub fn generate_api_methods(output: &mut String, endpoints: &[Endpoint]) { writeln!(output, " query = '&'.join(params)").unwrap(); writeln!( output, - " return self.get(f'{}{{\"?\" + query if query else \"\"}}')", + " path = f'{}{{\"?\" + query if query else \"\"}}'", path ) .unwrap(); + + if endpoint.supports_csv { + writeln!(output, " if format == 'csv':").unwrap(); + writeln!(output, " return self.get_text(path)").unwrap(); + writeln!(output, " return self.get_json(path)").unwrap(); + } else { + writeln!(output, " return self.get_json(path)").unwrap(); + } } writeln!(output).unwrap(); diff --git a/crates/brk_bindgen/src/generators/python/client.rs b/crates/brk_bindgen/src/generators/python/client.rs index 99fc203cd..8303d9f82 100644 --- a/crates/brk_bindgen/src/generators/python/client.rs +++ b/crates/brk_bindgen/src/generators/python/client.rs @@ -81,25 +81,48 @@ class BrkClientBase: """Base HTTP client for making requests.""" def __init__(self, base_url: str, timeout: float = 30.0): - self.base_url = base_url - self.timeout = timeout - self._client = httpx.Client(timeout=timeout) + parsed = urlparse(base_url) + self._host = parsed.netloc + self._secure = parsed.scheme == 'https' + self._timeout = timeout + self._conn: Optional[Union[HTTPSConnection, HTTPConnection]] = None - def get(self, path: str) -> Any: - """Make a GET request.""" + def _connect(self) -> Union[HTTPSConnection, HTTPConnection]: + """Get or create HTTP connection.""" + if self._conn is None: + if self._secure: + self._conn = HTTPSConnection(self._host, timeout=self._timeout) + else: + self._conn = HTTPConnection(self._host, timeout=self._timeout) + return self._conn + + def get(self, path: str) -> bytes: + """Make a GET request and return raw bytes.""" try: - base = self.base_url.rstrip('/') - response = self._client.get(f"{{base}}{{path}}") - response.raise_for_status() - return response.json() - except httpx.HTTPStatusError as e: - raise BrkError(f"HTTP error: {{e.response.status_code}}", e.response.status_code) - except httpx.RequestError as e: + conn = self._connect() + conn.request("GET", path) + res = conn.getresponse() + data = res.read() + if res.status >= 400: + raise BrkError(f"HTTP error: {{res.status}}", res.status) + return data + except (ConnectionError, OSError, TimeoutError) as e: + self._conn = None raise BrkError(str(e)) + def get_json(self, path: str) -> Any: + """Make a GET request and return JSON.""" + return json.loads(self.get(path)) + + def get_text(self, path: str) -> str: + """Make a GET request and return text.""" + return self.get(path).decode() + def close(self): """Close the HTTP client.""" - self._client.close() + if self._conn: + self._conn.close() + self._conn = None def __enter__(self): return self @@ -124,8 +147,8 @@ pub fn generate_endpoint_class(output: &mut String) { r#"class MetricData(TypedDict, Generic[T]): """Metric data with range information.""" total: int - from_: int # 'from' is reserved in Python - to: int + start: int + end: int data: List[T] @@ -143,18 +166,18 @@ class MetricEndpoint(Generic[T]): def get(self) -> MetricData[T]: """Fetch all data points for this metric/index.""" - return self._client.get(self.path()) + return self._client.get_json(self.path()) - def range(self, from_val: Optional[int] = None, to_val: 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 from_val is not None: - params.append(f"from={{from_val}}") - if to_val is not None: - params.append(f"to={{to_val}}") + if start is not None: + params.append(f"start={{start}}") + if end is not None: + params.append(f"end={{end}}") query = "&".join(params) p = self.path() - return self._client.get(f"{{p}}?{{query}}" if query else p) + return self._client.get_json(f"{{p}}?{{query}}" if query else p) def path(self) -> str: """Get the endpoint path.""" diff --git a/crates/brk_bindgen/src/generators/python/mod.rs b/crates/brk_bindgen/src/generators/python/mod.rs index 789d1a86e..2bd877ff6 100644 --- a/crates/brk_bindgen/src/generators/python/mod.rs +++ b/crates/brk_bindgen/src/generators/python/mod.rs @@ -24,13 +24,14 @@ pub fn generate_python_client( writeln!(output, "# Auto-generated BRK Python client").unwrap(); writeln!(output, "# Do not edit manually\n").unwrap(); - writeln!(output, "from __future__ import annotations").unwrap(); writeln!( output, "from typing import TypeVar, Generic, Any, Optional, List, Literal, TypedDict, Union, Protocol" ) .unwrap(); - writeln!(output, "import httpx\n").unwrap(); + writeln!(output, "from http.client import HTTPSConnection, HTTPConnection").unwrap(); + writeln!(output, "from urllib.parse import urlparse").unwrap(); + writeln!(output, "import json\n").unwrap(); writeln!(output, "T = TypeVar('T')\n").unwrap(); types::generate_type_definitions(&mut output, schemas); diff --git a/crates/brk_bindgen/src/generators/python/tree.rs b/crates/brk_bindgen/src/generators/python/tree.rs index aee8c36b1..b14a29542 100644 --- a/crates/brk_bindgen/src/generators/python/tree.rs +++ b/crates/brk_bindgen/src/generators/python/tree.rs @@ -12,13 +12,13 @@ use crate::{ /// Generate tree classes pub fn generate_tree_classes(output: &mut String, catalog: &TreeNode, metadata: &ClientMetadata) { - writeln!(output, "# Catalog tree classes\n").unwrap(); + writeln!(output, "# Metrics tree classes\n").unwrap(); let pattern_lookup = metadata.pattern_lookup(); let mut generated = HashSet::new(); generate_tree_class( output, - "CatalogTree", + "MetricsTree", catalog, &pattern_lookup, metadata, @@ -39,8 +39,30 @@ fn generate_tree_class( return; }; + // Generate child classes FIRST (post-order traversal) + // This ensures children are defined before parent references them + for (child_name, child_node) in ctx.children.iter() { + if let TreeNode::Branch(grandchildren) = child_node { + let child_fields = get_node_fields(grandchildren, pattern_lookup); + + // Generate inline class if no pattern match OR pattern is not parameterizable + if !metadata.is_parameterizable_fields(&child_fields) { + let child_class = child_type_name(name, child_name); + generate_tree_class( + output, + &child_class, + child_node, + pattern_lookup, + metadata, + generated, + ); + } + } + } + + // THEN generate the current class (after all children are defined) writeln!(output, "class {}:", name).unwrap(); - writeln!(output, " \"\"\"Catalog tree node.\"\"\"").unwrap(); + writeln!(output, " \"\"\"Metrics tree node.\"\"\"").unwrap(); writeln!(output, " ").unwrap(); writeln!( output, @@ -92,24 +114,4 @@ fn generate_tree_class( } writeln!(output).unwrap(); - - // Generate child classes - for (child_name, child_node) in ctx.children { - if let TreeNode::Branch(grandchildren) = child_node { - let child_fields = get_node_fields(grandchildren, pattern_lookup); - - // Generate inline class if no pattern match OR pattern is not parameterizable - if !metadata.is_parameterizable_fields(&child_fields) { - let child_class = child_type_name(name, child_name); - generate_tree_class( - output, - &child_class, - child_node, - pattern_lookup, - metadata, - generated, - ); - } - } - } } diff --git a/crates/brk_bindgen/src/generators/python/types.rs b/crates/brk_bindgen/src/generators/python/types.rs index 82bde5308..4d340f900 100644 --- a/crates/brk_bindgen/src/generators/python/types.rs +++ b/crates/brk_bindgen/src/generators/python/types.rs @@ -17,67 +17,81 @@ pub fn generate_type_definitions(output: &mut String, schemas: &TypeSchemas) { let sorted_names = topological_sort_schemas(schemas); - for name in sorted_names { - if MANUAL_GENERIC_TYPES.contains(&name.as_str()) { - continue; - } + // Partition into simple type aliases and TypedDict classes + // Generate type aliases first to avoid forward reference issues + let (type_aliases, typed_dicts): (Vec<_>, Vec<_>) = sorted_names + .into_iter() + .filter(|name| !MANUAL_GENERIC_TYPES.contains(&name.as_str())) + .filter(|name| schemas.contains_key(name)) + .partition(|name| { + schemas + .get(name) + .map(|s| s.get("properties").is_none()) + .unwrap_or(false) + }); - let Some(schema) = schemas.get(&name) else { - continue; - }; + // Generate simple type aliases first + // Quote references to TypedDicts since they're defined after + let typed_dict_set: HashSet<_> = typed_dicts.iter().cloned().collect(); + for name in type_aliases { + let schema = &schemas[&name]; let type_desc = schema.get("description").and_then(|d| d.as_str()); - - if let Some(props) = schema.get("properties").and_then(|p| p.as_object()) { - writeln!(output, "class {}(TypedDict):", name).unwrap(); - - // Collect field descriptions for Attributes section - let field_docs: Vec<(String, Option<&str>)> = props - .iter() - .map(|(prop_name, prop_schema)| { - let safe_name = escape_python_keyword(prop_name); - let desc = prop_schema.get("description").and_then(|d| d.as_str()); - (safe_name, desc) - }) - .collect(); - let has_field_docs = field_docs.iter().any(|(_, d)| d.is_some()); - - // Generate docstring if we have type description or field descriptions - if type_desc.is_some() || has_field_docs { - writeln!(output, " \"\"\"").unwrap(); - if let Some(desc) = type_desc { - for line in desc.lines() { - writeln!(output, " {}", line).unwrap(); - } - } - if has_field_docs { - if type_desc.is_some() { - writeln!(output).unwrap(); - } - writeln!(output, " Attributes:").unwrap(); - for (field_name, desc) in &field_docs { - if let Some(d) = desc { - writeln!(output, " {}: {}", field_name, d).unwrap(); - } - } - } - writeln!(output, " \"\"\"").unwrap(); + let py_type = schema_to_python_type_quoting(schema, Some(&name), &typed_dict_set); + if let Some(desc) = type_desc { + for line in desc.lines() { + writeln!(output, "# {}", line).unwrap(); } + } + writeln!(output, "{} = {}", name, py_type).unwrap(); + } - for (prop_name, prop_schema) in props { - let prop_type = schema_to_python_type_ctx(prop_schema, Some(&name)); + // Then generate TypedDict classes + for name in typed_dicts { + let schema = &schemas[&name]; + let type_desc = schema.get("description").and_then(|d| d.as_str()); + let props = schema.get("properties").and_then(|p| p.as_object()).unwrap(); + + writeln!(output, "class {}(TypedDict):", name).unwrap(); + + // Collect field descriptions for Attributes section + let field_docs: Vec<(String, Option<&str>)> = props + .iter() + .map(|(prop_name, prop_schema)| { let safe_name = escape_python_keyword(prop_name); - writeln!(output, " {}: {}", safe_name, prop_type).unwrap(); - } - writeln!(output).unwrap(); - } else { - let py_type = schema_to_python_type_ctx(schema, Some(&name)); + let desc = prop_schema.get("description").and_then(|d| d.as_str()); + (safe_name, desc) + }) + .collect(); + let has_field_docs = field_docs.iter().any(|(_, d)| d.is_some()); + + // Generate docstring if we have type description or field descriptions + if type_desc.is_some() || has_field_docs { + writeln!(output, " \"\"\"").unwrap(); if let Some(desc) = type_desc { for line in desc.lines() { - writeln!(output, "# {}", line).unwrap(); + writeln!(output, " {}", line).unwrap(); } } - writeln!(output, "{} = {}", name, py_type).unwrap(); + if has_field_docs { + if type_desc.is_some() { + writeln!(output).unwrap(); + } + writeln!(output, " Attributes:").unwrap(); + for (field_name, desc) in &field_docs { + if let Some(d) = desc { + writeln!(output, " {}: {}", field_name, d).unwrap(); + } + } + } + writeln!(output, " \"\"\"").unwrap(); } + + for (prop_name, prop_schema) in props { + let prop_type = schema_to_python_type_ctx(prop_schema, Some(&name)); + let safe_name = escape_python_keyword(prop_name); + writeln!(output, " {}: {}", safe_name, prop_type).unwrap(); + } + writeln!(output).unwrap(); } writeln!(output).unwrap(); } @@ -194,6 +208,70 @@ fn json_type_to_python(ty: &str, schema: &Value, current_type: Option<&str>) -> } } +/// Convert JSON Schema to Python type, quoting types in the given set +fn schema_to_python_type_quoting( + schema: &Value, + current_type: Option<&str>, + quote_types: &HashSet, +) -> String { + if let Some(all_of) = schema.get("allOf").and_then(|v| v.as_array()) { + for item in all_of { + let resolved = schema_to_python_type_quoting(item, current_type, quote_types); + if resolved != "Any" { + return resolved; + } + } + } + + // Handle $ref + if let Some(ref_path) = schema.get("$ref").and_then(|r| r.as_str()) { + let type_name = ref_to_type_name(ref_path).unwrap_or("Any"); + // Quote self-references or types in quote_types set + if current_type == Some(type_name) || quote_types.contains(type_name) { + return format!("\"{}\"", type_name); + } + return type_name.to_string(); + } + + // Handle enum (array of string values) + if let Some(enum_values) = schema.get("enum").and_then(|e| e.as_array()) { + let literals: Vec = enum_values + .iter() + .filter_map(|v| v.as_str()) + .map(|s| format!("\"{}\"", s)) + .collect(); + if !literals.is_empty() { + return format!("Literal[{}]", literals.join(", ")); + } + } + + if let Some(variants) = schema + .get("anyOf") + .or_else(|| schema.get("oneOf")) + .and_then(|v| v.as_array()) + { + let types: Vec = variants + .iter() + .map(|v| schema_to_python_type_quoting(v, current_type, quote_types)) + .collect(); + let filtered: Vec<_> = types.iter().filter(|t| *t != "Any").collect(); + if !filtered.is_empty() { + return format!( + "Union[{}]", + filtered + .iter() + .map(|s| s.as_str()) + .collect::>() + .join(", ") + ); + } + return format!("Union[{}]", types.join(", ")); + } + + // Fall back to regular conversion for other cases + schema_to_python_type_ctx(schema, current_type) +} + /// Convert JSON Schema to Python type with context for detecting self-references pub fn schema_to_python_type_ctx(schema: &Value, current_type: Option<&str>) -> String { if let Some(all_of) = schema.get("allOf").and_then(|v| v.as_array()) { diff --git a/crates/brk_bindgen/src/generators/rust/api.rs b/crates/brk_bindgen/src/generators/rust/api.rs index 28add2875..1d23b64a5 100644 --- a/crates/brk_bindgen/src/generators/rust/api.rs +++ b/crates/brk_bindgen/src/generators/rust/api.rs @@ -10,10 +10,10 @@ use super::types::js_type_to_rust; pub fn generate_main_client(output: &mut String, endpoints: &[Endpoint]) { writeln!( output, - r#"/// Main BRK client with catalog tree and API methods. + r#"/// Main BRK client with metrics tree and API methods. pub struct BrkClient {{ base: Arc, - tree: CatalogTree, + metrics: MetricsTree, }} impl BrkClient {{ @@ -23,20 +23,20 @@ impl BrkClient {{ /// Create a new client with the given base URL. pub fn new(base_url: impl Into) -> Self {{ let base = Arc::new(BrkClientBase::new(base_url)); - let tree = CatalogTree::new(base.clone(), String::new()); - Self {{ base, tree }} + let metrics = MetricsTree::new(base.clone(), String::new()); + Self {{ base, metrics }} }} /// Create a new client with options. pub fn with_options(options: BrkClientOptions) -> Self {{ let base = Arc::new(BrkClientBase::with_options(options)); - let tree = CatalogTree::new(base.clone(), String::new()); - Self {{ base, tree }} + let metrics = MetricsTree::new(base.clone(), String::new()); + Self {{ base, metrics }} }} - /// Get the catalog tree for navigating metrics. - pub fn tree(&self) -> &CatalogTree {{ - &self.tree + /// Get the metrics tree for navigating metrics. + pub fn metrics(&self) -> &MetricsTree {{ + &self.metrics }} "#, VERSION = VERSION @@ -56,12 +56,18 @@ pub fn generate_api_methods(output: &mut String, endpoints: &[Endpoint]) { } let method_name = endpoint_to_method_name(endpoint); - let return_type = endpoint + let base_return_type = endpoint .response_type .as_deref() .map(js_type_to_rust) .unwrap_or_else(|| "serde_json::Value".to_string()); + let return_type = if endpoint.supports_csv { + format!("FormatResponse<{}>", base_return_type) + } else { + base_return_type.clone() + }; + writeln!( output, " /// {}", @@ -83,10 +89,10 @@ pub fn generate_api_methods(output: &mut String, endpoints: &[Endpoint]) { ) .unwrap(); - let path = build_path_template(&endpoint.path); + let (path, index_arg) = build_path_template(endpoint); if endpoint.query_params.is_empty() { - writeln!(output, " self.base.get(&format!(\"{}\"))", path).unwrap(); + writeln!(output, " self.base.get_json(&format!(\"{}\"{}))", path, index_arg).unwrap(); } else { writeln!(output, " let mut query = Vec::new();").unwrap(); for param in &endpoint.query_params { @@ -107,12 +113,17 @@ pub fn generate_api_methods(output: &mut String, endpoints: &[Endpoint]) { } } writeln!(output, " let query_str = if query.is_empty() {{ String::new() }} else {{ format!(\"?{{}}\", query.join(\"&\")) }};").unwrap(); - writeln!( - output, - " self.base.get(&format!(\"{}{{}}\", query_str))", - path - ) - .unwrap(); + writeln!(output, " let path = format!(\"{}{{}}\"{}, query_str);", path, index_arg).unwrap(); + + if endpoint.supports_csv { + writeln!(output, " if format == Some(Format::CSV) {{").unwrap(); + writeln!(output, " self.base.get_text(&path).map(FormatResponse::Csv)").unwrap(); + writeln!(output, " }} else {{").unwrap(); + writeln!(output, " self.base.get_json(&path).map(FormatResponse::Json)").unwrap(); + writeln!(output, " }}").unwrap(); + } else { + writeln!(output, " self.base.get_json(&path)").unwrap(); + } } writeln!(output, " }}\n").unwrap(); @@ -126,19 +137,36 @@ fn endpoint_to_method_name(endpoint: &Endpoint) -> String { fn build_method_params(endpoint: &Endpoint) -> String { let mut params = Vec::new(); for param in &endpoint.path_params { - params.push(format!(", {}: &str", param.name)); + let rust_type = param_type_to_rust(¶m.param_type); + params.push(format!(", {}: {}", param.name, rust_type)); } for param in &endpoint.query_params { + let rust_type = param_type_to_rust(¶m.param_type); if param.required { - params.push(format!(", {}: &str", param.name)); + params.push(format!(", {}: {}", param.name, rust_type)); } else { - params.push(format!(", {}: Option<&str>", param.name)); + params.push(format!(", {}: Option<{}>", param.name, rust_type)); } } params.join("") } -/// OpenAPI path placeholders `{param}` are already valid Rust format string syntax. -fn build_path_template(path: &str) -> &str { - path +/// Convert parameter type to Rust type for function signatures. +fn param_type_to_rust(param_type: &str) -> String { + match param_type { + "string" | "*" => "&str".to_string(), + "integer" | "number" => "i64".to_string(), + "boolean" => "bool".to_string(), + other => other.to_string(), // Domain types like Index, Metric, Format + } +} + +/// Build path template and extra format args for Index params. +fn build_path_template(endpoint: &Endpoint) -> (String, &'static str) { + let has_index_param = endpoint.path_params.iter().any(|p| p.name == "index" && p.param_type == "Index"); + if has_index_param { + (endpoint.path.replace("{index}", "{}"), ", index.serialize_long()") + } else { + (endpoint.path.clone(), "") + } } diff --git a/crates/brk_bindgen/src/generators/rust/client.rs b/crates/brk_bindgen/src/generators/rust/client.rs index 18c66fdc6..ac3fa0443 100644 --- a/crates/brk_bindgen/src/generators/rust/client.rs +++ b/crates/brk_bindgen/src/generators/rust/client.rs @@ -82,8 +82,7 @@ impl BrkClientBase {{ }} }} - /// Make a GET request. - pub fn get(&self, path: &str) -> Result {{ + fn get(&self, path: &str) -> Result {{ let base = self.base_url.trim_end_matches('/'); let url = format!("{{}}{{}}", base, path); let response = minreq::get(&url) @@ -97,10 +96,23 @@ impl BrkClientBase {{ }}); }} - response + Ok(response) + }} + + /// Make a GET request and deserialize JSON response. + pub fn get_json(&self, path: &str) -> Result {{ + self.get(path)? .json() .map_err(|e| BrkError {{ message: e.to_string() }}) }} + + /// Make a GET request and return raw text response. + pub fn get_text(&self, path: &str) -> Result {{ + self.get(path)? + .as_str() + .map(|s| s.to_string()) + .map_err(|e| BrkError {{ message: e.to_string() }}) + }} }} /// Build metric name with optional prefix. @@ -162,21 +174,21 @@ impl Endpoint {{ /// Fetch all data points for this metric/index. pub fn get(&self) -> Result> {{ - self.client.get(&self.path()) + self.client.get_json(&self.path()) }} /// Fetch data points within a range. - pub fn range(&self, from: Option, to: Option) -> Result> {{ + pub fn range(&self, start: Option, end: Option) -> Result> {{ let mut params = Vec::new(); - if let Some(f) = from {{ params.push(format!("from={{}}", f)); }} - if let Some(t) = to {{ params.push(format!("to={{}}", t)); }} + if let Some(s) = start {{ params.push(format!("start={{}}", s)); }} + if let Some(e) = end {{ params.push(format!("end={{}}", e)); }} let p = self.path(); let path = if params.is_empty() {{ p }} else {{ format!("{{}}?{{}}", p, params.join("&")) }}; - self.client.get(&path) + self.client.get_json(&path) }} /// Get the endpoint path. diff --git a/crates/brk_bindgen/src/generators/rust/tree.rs b/crates/brk_bindgen/src/generators/rust/tree.rs index 1ab3dd32e..f82115fe8 100644 --- a/crates/brk_bindgen/src/generators/rust/tree.rs +++ b/crates/brk_bindgen/src/generators/rust/tree.rs @@ -13,13 +13,13 @@ use crate::{ /// Generate tree structs. pub fn generate_tree(output: &mut String, catalog: &TreeNode, metadata: &ClientMetadata) { - writeln!(output, "// Catalog tree\n").unwrap(); + writeln!(output, "// Metrics tree\n").unwrap(); let pattern_lookup = metadata.pattern_lookup(); let mut generated = HashSet::new(); generate_tree_node( output, - "CatalogTree", + "MetricsTree", catalog, &pattern_lookup, metadata, @@ -39,7 +39,7 @@ fn generate_tree_node( return; }; - writeln!(output, "/// Catalog tree node.").unwrap(); + writeln!(output, "/// Metrics tree node.").unwrap(); writeln!(output, "pub struct {} {{", name).unwrap(); for ((field, child_fields), (child_name, _)) in diff --git a/crates/brk_bindgen/src/openapi.rs b/crates/brk_bindgen/src/openapi.rs index f4758e30e..263fd4b66 100644 --- a/crates/brk_bindgen/src/openapi.rs +++ b/crates/brk_bindgen/src/openapi.rs @@ -2,7 +2,7 @@ use std::{collections::BTreeMap, io}; use crate::ref_to_type_name; use oas3::Spec; -use oas3::spec::{ObjectOrReference, Operation, ParameterIn, PathItem, Schema, SchemaTypeSet}; +use oas3::spec::{ObjectOrReference, ObjectSchema, Operation, ParameterIn, PathItem, Schema, SchemaType, SchemaTypeSet}; use serde_json::Value; /// Type schema extracted from OpenAPI components @@ -31,6 +31,8 @@ pub struct Endpoint { pub response_type: Option, /// Whether this endpoint is deprecated pub deprecated: bool, + /// Whether this endpoint supports CSV format (text/csv content type) + pub supports_csv: bool, } impl Endpoint { @@ -186,10 +188,11 @@ fn get_operations(path_item: &PathItem) -> Vec<(String, &Operation)> { } fn extract_endpoint(path: &str, method: &str, operation: &Operation) -> Option { - let path_params = extract_parameters(operation, ParameterIn::Path); + let path_params = extract_path_parameters(path, operation); let query_params = extract_parameters(operation, ParameterIn::Query); let response_type = extract_response_type(operation); + let supports_csv = check_csv_support(operation); Some(Endpoint { method: method.to_string(), @@ -202,9 +205,51 @@ fn extract_endpoint(path: &str, method: &str, operation: &Operation) -> Option bool { + let Some(responses) = operation.responses.as_ref() else { + return false; + }; + let Some(response) = responses.get("200") else { + return false; + }; + match response { + ObjectOrReference::Object(response) => response.content.contains_key("text/csv"), + ObjectOrReference::Ref { .. } => false, + } +} + +/// Extract path parameters in the order they appear in the path URL. +fn extract_path_parameters(path: &str, operation: &Operation) -> Vec { + // Extract parameter names from the path in order (e.g., "/api/metric/{metric}/{index}" -> ["metric", "index"]) + let path_order: Vec<&str> = path + .split('/') + .filter_map(|segment| { + segment + .strip_prefix('{') + .and_then(|s| s.strip_suffix('}')) + }) + .collect(); + + // Get all path parameters from the operation + let params = extract_parameters(operation, ParameterIn::Path); + + // Sort by position in the path + let mut sorted_params: Vec = params; + sorted_params.sort_by_key(|p| { + path_order + .iter() + .position(|&name| name == p.name) + .unwrap_or(usize::MAX) + }); + + sorted_params +} + fn extract_parameters(operation: &Operation, location: ParameterIn) -> Vec { operation .parameters @@ -271,25 +316,36 @@ fn schema_type_from_schema(schema: &Schema) -> Option { } } -fn schema_to_type_name(schema: &oas3::spec::ObjectSchema) -> Option { +fn schema_to_type_name(schema: &ObjectSchema) -> Option { let schema_type = schema.schema_type.as_ref()?; match schema_type { - SchemaTypeSet::Single(t) => match t { - oas3::spec::SchemaType::String => Some("string".to_string()), - oas3::spec::SchemaType::Number => Some("number".to_string()), - oas3::spec::SchemaType::Integer => Some("number".to_string()), - oas3::spec::SchemaType::Boolean => Some("boolean".to_string()), - oas3::spec::SchemaType::Array => { - let inner = match &schema.items { - Some(boxed_schema) => schema_type_from_schema(boxed_schema), - None => Some("*".to_string()), - }; - inner.map(|t| format!("{}[]", t)) - } - oas3::spec::SchemaType::Object => Some("Object".to_string()), - oas3::spec::SchemaType::Null => Some("null".to_string()), - }, - SchemaTypeSet::Multiple(_) => Some("*".to_string()), + SchemaTypeSet::Single(t) => single_type_to_name(t, schema), + SchemaTypeSet::Multiple(types) => { + // For nullable types like ["integer", "null"], return the non-null type + types + .iter() + .find(|t| !matches!(t, SchemaType::Null)) + .and_then(|t| single_type_to_name(t, schema)) + .or(Some("*".to_string())) + } + } +} + +fn single_type_to_name(t: &SchemaType, schema: &ObjectSchema) -> Option { + match t { + SchemaType::String => Some("string".to_string()), + SchemaType::Number => Some("number".to_string()), + SchemaType::Integer => Some("number".to_string()), + SchemaType::Boolean => Some("boolean".to_string()), + SchemaType::Array => { + let inner = match &schema.items { + Some(boxed_schema) => schema_type_from_schema(boxed_schema), + None => Some("*".to_string()), + }; + inner.map(|t| format!("{}[]", t)) + } + SchemaType::Object => Some("Object".to_string()), + SchemaType::Null => Some("null".to_string()), } } diff --git a/crates/brk_bindgen/src/types/mod.rs b/crates/brk_bindgen/src/types/mod.rs index 23331db6b..a3811e6c4 100644 --- a/crates/brk_bindgen/src/types/mod.rs +++ b/crates/brk_bindgen/src/types/mod.rs @@ -21,9 +21,21 @@ pub struct GenericSyntax { } impl GenericSyntax { - pub const PYTHON: Self = Self { open: '[', close: ']', default_type: "Any" }; - pub const JAVASCRIPT: Self = Self { open: '<', close: '>', default_type: "unknown" }; - pub const RUST: Self = Self { open: '<', close: '>', default_type: "_" }; + pub const PYTHON: Self = Self { + open: '[', + close: ']', + default_type: "Any", + }; + pub const JAVASCRIPT: Self = Self { + open: '<', + close: '>', + default_type: "unknown", + }; + pub const RUST: Self = Self { + open: '<', + close: '>', + default_type: "_", + }; pub fn wrap(&self, name: &str, type_param: &str) -> String { // Convert the type_param from Rust syntax to target syntax @@ -46,11 +58,11 @@ impl GenericSyntax { /// Extract the innermost type from nested generics. /// E.g., `Close` -> `Cents`, `Foo>` -> `Baz` fn extract_inner_type_recursive(type_str: &str) -> String { - if let Some(start) = type_str.find('<') { - if let Some(end) = type_str.rfind('>') { - let inner = &type_str[start + 1..end]; - return extract_inner_type_recursive(inner); - } + if let Some(start) = type_str.find('<') + && let Some(end) = type_str.rfind('>') + { + let inner = &type_str[start + 1..end]; + return extract_inner_type_recursive(inner); } type_str.to_string() } diff --git a/crates/brk_client/examples/basic.rs b/crates/brk_client/examples/basic.rs index f544ce597..2e49a9686 100644 --- a/crates/brk_client/examples/basic.rs +++ b/crates/brk_client/examples/basic.rs @@ -1,6 +1,7 @@ //! Basic example of using the BRK client. use brk_client::{BrkClient, BrkClientOptions}; +use brk_types::{FormatResponse, Index, Metric}; fn main() -> brk_client::Result<()> { // Create client with default options @@ -12,9 +13,9 @@ fn main() -> brk_client::Result<()> { timeout_secs: 60, }); - // Fetch price data using the typed tree API + // Fetch price data using the typed metrics API let price_close = client - .tree() + .metrics() .price .usd .split @@ -26,7 +27,7 @@ fn main() -> brk_client::Result<()> { // Fetch block data let block_count = client - .tree() + .metrics() .blocks .count .block_count @@ -40,7 +41,7 @@ fn main() -> brk_client::Result<()> { // dbg!( client - .tree() + .metrics() .supply .circulating .bitcoin @@ -49,7 +50,7 @@ fn main() -> brk_client::Result<()> { .path() ); let circulating = client - .tree() + .metrics() .supply .circulating .bitcoin @@ -59,9 +60,20 @@ fn main() -> brk_client::Result<()> { println!("Last 3 circulating supply values: {:?}", circulating); // Using generic metric fetching - let metricdata = - client.get_metric_by_index("dateindex", "price_close", None, None, Some("-3"), None)?; - println!("Generic fetch result count: {}", metricdata.data.len()); + let metricdata = client.get_metric_by_index( + Metric::from("price_close"), + Index::DateIndex, + Some(-3), + None, + None, + None, + )?; + match metricdata { + FormatResponse::Json(m) => { + println!("Generic fetch result count: {}", m.data.len()); + } + FormatResponse::Csv(_) => panic!(), + }; Ok(()) } diff --git a/crates/brk_client/src/lib.rs b/crates/brk_client/src/lib.rs index 810aaefd3..c01123056 100644 --- a/crates/brk_client/src/lib.rs +++ b/crates/brk_client/src/lib.rs @@ -7,11 +7,10 @@ #![allow(clippy::useless_format)] #![allow(clippy::unnecessary_to_owned)] -use std::sync::Arc; -use serde::de::DeserializeOwned; pub use brk_cohort::*; pub use brk_types::*; - +use serde::de::DeserializeOwned; +use std::sync::Arc; /// Error type for BRK client operations. #[derive(Debug)] @@ -70,14 +69,15 @@ impl BrkClientBase { } } - /// Make a GET request. - pub fn get(&self, path: &str) -> Result { + fn get(&self, path: &str) -> Result { let base = self.base_url.trim_end_matches('/'); let url = format!("{}{}", base, path); let response = minreq::get(&url) .with_timeout(self.timeout_secs) .send() - .map_err(|e| BrkError { message: e.to_string() })?; + .map_err(|e| BrkError { + message: e.to_string(), + })?; if response.status_code >= 400 { return Err(BrkError { @@ -85,19 +85,37 @@ impl BrkClientBase { }); } - response - .json() - .map_err(|e| BrkError { message: e.to_string() }) + Ok(response) + } + + /// Make a GET request and deserialize JSON response. + pub fn get_json(&self, path: &str) -> Result { + self.get(path)?.json().map_err(|e| BrkError { + message: e.to_string(), + }) + } + + /// Make a GET request and return raw text response. + pub fn get_text(&self, path: &str) -> Result { + self.get(path)? + .as_str() + .map(|s| s.to_string()) + .map_err(|e| BrkError { + message: e.to_string(), + }) } } /// Build metric name with optional prefix. #[inline] fn _m(acc: &str, s: &str) -> String { - if acc.is_empty() { s.to_string() } else { format!("{acc}_{s}") } + if acc.is_empty() { + s.to_string() + } else { + format!("{acc}_{s}") + } } - /// Non-generic trait for metric patterns (usable in collections). pub trait AnyMetricPattern { /// Get the metric name. @@ -113,7 +131,6 @@ pub trait MetricPattern: AnyMetricPattern { fn get(&self, index: Index) -> Option>; } - /// An endpoint for a specific metric + index combination. pub struct Endpoint { client: Arc, @@ -134,21 +151,25 @@ impl Endpoint { /// Fetch all data points for this metric/index. pub fn get(&self) -> Result> { - self.client.get(&self.path()) + self.client.get_json(&self.path()) } /// Fetch data points within a range. - pub fn range(&self, from: Option, to: Option) -> Result> { + pub fn range(&self, start: Option, end: Option) -> Result> { let mut params = Vec::new(); - if let Some(f) = from { params.push(format!("from={}", f)); } - if let Some(t) = to { params.push(format!("to={}", t)); } + if let Some(s) = start { + params.push(format!("start={}", s)); + } + if let Some(e) = end { + params.push(format!("end={}", e)); + } let p = self.path(); let path = if params.is_empty() { p } else { format!("{}?{}", p, params.join("&")) }; - self.client.get(&path) + self.client.get_json(&path) } /// Get the endpoint path. @@ -157,7 +178,6 @@ impl Endpoint { } } - // Index accessor structs /// Container for index endpoint methods. @@ -175,7 +195,11 @@ impl MetricPattern1By { Endpoint::new(self.client.clone(), self.name.clone(), Index::DecadeIndex) } pub fn difficultyepoch(&self) -> Endpoint { - Endpoint::new(self.client.clone(), self.name.clone(), Index::DifficultyEpoch) + Endpoint::new( + self.client.clone(), + self.name.clone(), + Index::DifficultyEpoch, + ) } pub fn height(&self) -> Endpoint { Endpoint::new(self.client.clone(), self.name.clone(), Index::Height) @@ -214,7 +238,7 @@ impl MetricPattern1 { client, name, _marker: std::marker::PhantomData, - } + }, } } @@ -276,7 +300,11 @@ impl MetricPattern2By { Endpoint::new(self.client.clone(), self.name.clone(), Index::DecadeIndex) } pub fn difficultyepoch(&self) -> Endpoint { - Endpoint::new(self.client.clone(), self.name.clone(), Index::DifficultyEpoch) + Endpoint::new( + self.client.clone(), + self.name.clone(), + Index::DifficultyEpoch, + ) } pub fn monthindex(&self) -> Endpoint { Endpoint::new(self.client.clone(), self.name.clone(), Index::MonthIndex) @@ -312,7 +340,7 @@ impl MetricPattern2 { client, name, _marker: std::marker::PhantomData, - } + }, } } @@ -408,7 +436,7 @@ impl MetricPattern3 { client, name, _marker: std::marker::PhantomData, - } + }, } } @@ -501,7 +529,7 @@ impl MetricPattern4 { client, name, _marker: std::marker::PhantomData, - } + }, } } @@ -577,7 +605,7 @@ impl MetricPattern5 { client, name, _marker: std::marker::PhantomData, - } + }, } } @@ -593,10 +621,7 @@ impl AnyMetricPattern for MetricPattern5 { } fn indexes(&self) -> &'static [Index] { - &[ - Index::DateIndex, - Index::Height, - ] + &[Index::DateIndex, Index::Height] } } @@ -640,7 +665,7 @@ impl MetricPattern6 { client, name, _marker: std::marker::PhantomData, - } + }, } } @@ -656,9 +681,7 @@ impl AnyMetricPattern for MetricPattern6 { } fn indexes(&self) -> &'static [Index] { - &[ - Index::DateIndex, - ] + &[Index::DateIndex] } } @@ -701,7 +724,7 @@ impl MetricPattern7 { client, name, _marker: std::marker::PhantomData, - } + }, } } @@ -717,9 +740,7 @@ impl AnyMetricPattern for MetricPattern7 { } fn indexes(&self) -> &'static [Index] { - &[ - Index::DecadeIndex, - ] + &[Index::DecadeIndex] } } @@ -741,7 +762,11 @@ pub struct MetricPattern8By { impl MetricPattern8By { pub fn difficultyepoch(&self) -> Endpoint { - Endpoint::new(self.client.clone(), self.name.clone(), Index::DifficultyEpoch) + Endpoint::new( + self.client.clone(), + self.name.clone(), + Index::DifficultyEpoch, + ) } } @@ -762,7 +787,7 @@ impl MetricPattern8 { client, name, _marker: std::marker::PhantomData, - } + }, } } @@ -778,9 +803,7 @@ impl AnyMetricPattern for MetricPattern8 { } fn indexes(&self) -> &'static [Index] { - &[ - Index::DifficultyEpoch, - ] + &[Index::DifficultyEpoch] } } @@ -802,7 +825,11 @@ pub struct MetricPattern9By { impl MetricPattern9By { pub fn emptyoutputindex(&self) -> Endpoint { - Endpoint::new(self.client.clone(), self.name.clone(), Index::EmptyOutputIndex) + Endpoint::new( + self.client.clone(), + self.name.clone(), + Index::EmptyOutputIndex, + ) } } @@ -823,7 +850,7 @@ impl MetricPattern9 { client, name, _marker: std::marker::PhantomData, - } + }, } } @@ -839,9 +866,7 @@ impl AnyMetricPattern for MetricPattern9 { } fn indexes(&self) -> &'static [Index] { - &[ - Index::EmptyOutputIndex, - ] + &[Index::EmptyOutputIndex] } } @@ -884,7 +909,7 @@ impl MetricPattern10 { client, name, _marker: std::marker::PhantomData, - } + }, } } @@ -900,9 +925,7 @@ impl AnyMetricPattern for MetricPattern10 { } fn indexes(&self) -> &'static [Index] { - &[ - Index::HalvingEpoch, - ] + &[Index::HalvingEpoch] } } @@ -945,7 +968,7 @@ impl MetricPattern11 { client, name, _marker: std::marker::PhantomData, - } + }, } } @@ -961,9 +984,7 @@ impl AnyMetricPattern for MetricPattern11 { } fn indexes(&self) -> &'static [Index] { - &[ - Index::Height, - ] + &[Index::Height] } } @@ -1006,7 +1027,7 @@ impl MetricPattern12 { client, name, _marker: std::marker::PhantomData, - } + }, } } @@ -1022,9 +1043,7 @@ impl AnyMetricPattern for MetricPattern12 { } fn indexes(&self) -> &'static [Index] { - &[ - Index::TxInIndex, - ] + &[Index::TxInIndex] } } @@ -1067,7 +1086,7 @@ impl MetricPattern13 { client, name, _marker: std::marker::PhantomData, - } + }, } } @@ -1083,9 +1102,7 @@ impl AnyMetricPattern for MetricPattern13 { } fn indexes(&self) -> &'static [Index] { - &[ - Index::MonthIndex, - ] + &[Index::MonthIndex] } } @@ -1128,7 +1145,7 @@ impl MetricPattern14 { client, name, _marker: std::marker::PhantomData, - } + }, } } @@ -1144,9 +1161,7 @@ impl AnyMetricPattern for MetricPattern14 { } fn indexes(&self) -> &'static [Index] { - &[ - Index::OpReturnIndex, - ] + &[Index::OpReturnIndex] } } @@ -1189,7 +1204,7 @@ impl MetricPattern15 { client, name, _marker: std::marker::PhantomData, - } + }, } } @@ -1205,9 +1220,7 @@ impl AnyMetricPattern for MetricPattern15 { } fn indexes(&self) -> &'static [Index] { - &[ - Index::TxOutIndex, - ] + &[Index::TxOutIndex] } } @@ -1229,7 +1242,11 @@ pub struct MetricPattern16By { impl MetricPattern16By { pub fn p2aaddressindex(&self) -> Endpoint { - Endpoint::new(self.client.clone(), self.name.clone(), Index::P2AAddressIndex) + Endpoint::new( + self.client.clone(), + self.name.clone(), + Index::P2AAddressIndex, + ) } } @@ -1250,7 +1267,7 @@ impl MetricPattern16 { client, name, _marker: std::marker::PhantomData, - } + }, } } @@ -1266,9 +1283,7 @@ impl AnyMetricPattern for MetricPattern16 { } fn indexes(&self) -> &'static [Index] { - &[ - Index::P2AAddressIndex, - ] + &[Index::P2AAddressIndex] } } @@ -1290,7 +1305,11 @@ pub struct MetricPattern17By { impl MetricPattern17By { pub fn p2msoutputindex(&self) -> Endpoint { - Endpoint::new(self.client.clone(), self.name.clone(), Index::P2MSOutputIndex) + Endpoint::new( + self.client.clone(), + self.name.clone(), + Index::P2MSOutputIndex, + ) } } @@ -1311,7 +1330,7 @@ impl MetricPattern17 { client, name, _marker: std::marker::PhantomData, - } + }, } } @@ -1327,9 +1346,7 @@ impl AnyMetricPattern for MetricPattern17 { } fn indexes(&self) -> &'static [Index] { - &[ - Index::P2MSOutputIndex, - ] + &[Index::P2MSOutputIndex] } } @@ -1351,7 +1368,11 @@ pub struct MetricPattern18By { impl MetricPattern18By { pub fn p2pk33addressindex(&self) -> Endpoint { - Endpoint::new(self.client.clone(), self.name.clone(), Index::P2PK33AddressIndex) + Endpoint::new( + self.client.clone(), + self.name.clone(), + Index::P2PK33AddressIndex, + ) } } @@ -1372,7 +1393,7 @@ impl MetricPattern18 { client, name, _marker: std::marker::PhantomData, - } + }, } } @@ -1388,9 +1409,7 @@ impl AnyMetricPattern for MetricPattern18 { } fn indexes(&self) -> &'static [Index] { - &[ - Index::P2PK33AddressIndex, - ] + &[Index::P2PK33AddressIndex] } } @@ -1412,7 +1431,11 @@ pub struct MetricPattern19By { impl MetricPattern19By { pub fn p2pk65addressindex(&self) -> Endpoint { - Endpoint::new(self.client.clone(), self.name.clone(), Index::P2PK65AddressIndex) + Endpoint::new( + self.client.clone(), + self.name.clone(), + Index::P2PK65AddressIndex, + ) } } @@ -1433,7 +1456,7 @@ impl MetricPattern19 { client, name, _marker: std::marker::PhantomData, - } + }, } } @@ -1449,9 +1472,7 @@ impl AnyMetricPattern for MetricPattern19 { } fn indexes(&self) -> &'static [Index] { - &[ - Index::P2PK65AddressIndex, - ] + &[Index::P2PK65AddressIndex] } } @@ -1473,7 +1494,11 @@ pub struct MetricPattern20By { impl MetricPattern20By { pub fn p2pkhaddressindex(&self) -> Endpoint { - Endpoint::new(self.client.clone(), self.name.clone(), Index::P2PKHAddressIndex) + Endpoint::new( + self.client.clone(), + self.name.clone(), + Index::P2PKHAddressIndex, + ) } } @@ -1494,7 +1519,7 @@ impl MetricPattern20 { client, name, _marker: std::marker::PhantomData, - } + }, } } @@ -1510,9 +1535,7 @@ impl AnyMetricPattern for MetricPattern20 { } fn indexes(&self) -> &'static [Index] { - &[ - Index::P2PKHAddressIndex, - ] + &[Index::P2PKHAddressIndex] } } @@ -1534,7 +1557,11 @@ pub struct MetricPattern21By { impl MetricPattern21By { pub fn p2shaddressindex(&self) -> Endpoint { - Endpoint::new(self.client.clone(), self.name.clone(), Index::P2SHAddressIndex) + Endpoint::new( + self.client.clone(), + self.name.clone(), + Index::P2SHAddressIndex, + ) } } @@ -1555,7 +1582,7 @@ impl MetricPattern21 { client, name, _marker: std::marker::PhantomData, - } + }, } } @@ -1571,9 +1598,7 @@ impl AnyMetricPattern for MetricPattern21 { } fn indexes(&self) -> &'static [Index] { - &[ - Index::P2SHAddressIndex, - ] + &[Index::P2SHAddressIndex] } } @@ -1595,7 +1620,11 @@ pub struct MetricPattern22By { impl MetricPattern22By { pub fn p2traddressindex(&self) -> Endpoint { - Endpoint::new(self.client.clone(), self.name.clone(), Index::P2TRAddressIndex) + Endpoint::new( + self.client.clone(), + self.name.clone(), + Index::P2TRAddressIndex, + ) } } @@ -1616,7 +1645,7 @@ impl MetricPattern22 { client, name, _marker: std::marker::PhantomData, - } + }, } } @@ -1632,9 +1661,7 @@ impl AnyMetricPattern for MetricPattern22 { } fn indexes(&self) -> &'static [Index] { - &[ - Index::P2TRAddressIndex, - ] + &[Index::P2TRAddressIndex] } } @@ -1656,7 +1683,11 @@ pub struct MetricPattern23By { impl MetricPattern23By { pub fn p2wpkhaddressindex(&self) -> Endpoint { - Endpoint::new(self.client.clone(), self.name.clone(), Index::P2WPKHAddressIndex) + Endpoint::new( + self.client.clone(), + self.name.clone(), + Index::P2WPKHAddressIndex, + ) } } @@ -1677,7 +1708,7 @@ impl MetricPattern23 { client, name, _marker: std::marker::PhantomData, - } + }, } } @@ -1693,9 +1724,7 @@ impl AnyMetricPattern for MetricPattern23 { } fn indexes(&self) -> &'static [Index] { - &[ - Index::P2WPKHAddressIndex, - ] + &[Index::P2WPKHAddressIndex] } } @@ -1717,7 +1746,11 @@ pub struct MetricPattern24By { impl MetricPattern24By { pub fn p2wshaddressindex(&self) -> Endpoint { - Endpoint::new(self.client.clone(), self.name.clone(), Index::P2WSHAddressIndex) + Endpoint::new( + self.client.clone(), + self.name.clone(), + Index::P2WSHAddressIndex, + ) } } @@ -1738,7 +1771,7 @@ impl MetricPattern24 { client, name, _marker: std::marker::PhantomData, - } + }, } } @@ -1754,9 +1787,7 @@ impl AnyMetricPattern for MetricPattern24 { } fn indexes(&self) -> &'static [Index] { - &[ - Index::P2WSHAddressIndex, - ] + &[Index::P2WSHAddressIndex] } } @@ -1799,7 +1830,7 @@ impl MetricPattern25 { client, name, _marker: std::marker::PhantomData, - } + }, } } @@ -1815,9 +1846,7 @@ impl AnyMetricPattern for MetricPattern25 { } fn indexes(&self) -> &'static [Index] { - &[ - Index::QuarterIndex, - ] + &[Index::QuarterIndex] } } @@ -1860,7 +1889,7 @@ impl MetricPattern26 { client, name, _marker: std::marker::PhantomData, - } + }, } } @@ -1876,9 +1905,7 @@ impl AnyMetricPattern for MetricPattern26 { } fn indexes(&self) -> &'static [Index] { - &[ - Index::SemesterIndex, - ] + &[Index::SemesterIndex] } } @@ -1921,7 +1948,7 @@ impl MetricPattern27 { client, name, _marker: std::marker::PhantomData, - } + }, } } @@ -1937,9 +1964,7 @@ impl AnyMetricPattern for MetricPattern27 { } fn indexes(&self) -> &'static [Index] { - &[ - Index::TxIndex, - ] + &[Index::TxIndex] } } @@ -1961,7 +1986,11 @@ pub struct MetricPattern28By { impl MetricPattern28By { pub fn unknownoutputindex(&self) -> Endpoint { - Endpoint::new(self.client.clone(), self.name.clone(), Index::UnknownOutputIndex) + Endpoint::new( + self.client.clone(), + self.name.clone(), + Index::UnknownOutputIndex, + ) } } @@ -1982,7 +2011,7 @@ impl MetricPattern28 { client, name, _marker: std::marker::PhantomData, - } + }, } } @@ -1998,9 +2027,7 @@ impl AnyMetricPattern for MetricPattern28 { } fn indexes(&self) -> &'static [Index] { - &[ - Index::UnknownOutputIndex, - ] + &[Index::UnknownOutputIndex] } } @@ -2043,7 +2070,7 @@ impl MetricPattern29 { client, name, _marker: std::marker::PhantomData, - } + }, } } @@ -2059,9 +2086,7 @@ impl AnyMetricPattern for MetricPattern29 { } fn indexes(&self) -> &'static [Index] { - &[ - Index::WeekIndex, - ] + &[Index::WeekIndex] } } @@ -2104,7 +2129,7 @@ impl MetricPattern30 { client, name, _marker: std::marker::PhantomData, - } + }, } } @@ -2120,9 +2145,7 @@ impl AnyMetricPattern for MetricPattern30 { } fn indexes(&self) -> &'static [Index] { - &[ - Index::YearIndex, - ] + &[Index::YearIndex] } } @@ -2144,7 +2167,11 @@ pub struct MetricPattern31By { impl MetricPattern31By { pub fn loadedaddressindex(&self) -> Endpoint { - Endpoint::new(self.client.clone(), self.name.clone(), Index::LoadedAddressIndex) + Endpoint::new( + self.client.clone(), + self.name.clone(), + Index::LoadedAddressIndex, + ) } } @@ -2165,7 +2192,7 @@ impl MetricPattern31 { client, name, _marker: std::marker::PhantomData, - } + }, } } @@ -2181,9 +2208,7 @@ impl AnyMetricPattern for MetricPattern31 { } fn indexes(&self) -> &'static [Index] { - &[ - Index::LoadedAddressIndex, - ] + &[Index::LoadedAddressIndex] } } @@ -2205,7 +2230,11 @@ pub struct MetricPattern32By { impl MetricPattern32By { pub fn emptyaddressindex(&self) -> Endpoint { - Endpoint::new(self.client.clone(), self.name.clone(), Index::EmptyAddressIndex) + Endpoint::new( + self.client.clone(), + self.name.clone(), + Index::EmptyAddressIndex, + ) } } @@ -2226,7 +2255,7 @@ impl MetricPattern32 { client, name, _marker: std::marker::PhantomData, - } + }, } } @@ -2242,9 +2271,7 @@ impl AnyMetricPattern for MetricPattern32 { } fn indexes(&self) -> &'static [Index] { - &[ - Index::EmptyAddressIndex, - ] + &[Index::EmptyAddressIndex] } } @@ -2300,31 +2327,88 @@ impl RealizedPattern3 { pub fn new(client: Arc, acc: String) -> Self { Self { adjusted_sopr: MetricPattern6::new(client.clone(), _m(&acc, "adjusted_sopr")), - adjusted_sopr_30d_ema: MetricPattern6::new(client.clone(), _m(&acc, "adjusted_sopr_30d_ema")), - adjusted_sopr_7d_ema: MetricPattern6::new(client.clone(), _m(&acc, "adjusted_sopr_7d_ema")), - adjusted_value_created: MetricPattern1::new(client.clone(), _m(&acc, "adjusted_value_created")), - adjusted_value_destroyed: MetricPattern1::new(client.clone(), _m(&acc, "adjusted_value_destroyed")), + adjusted_sopr_30d_ema: MetricPattern6::new( + client.clone(), + _m(&acc, "adjusted_sopr_30d_ema"), + ), + adjusted_sopr_7d_ema: MetricPattern6::new( + client.clone(), + _m(&acc, "adjusted_sopr_7d_ema"), + ), + adjusted_value_created: MetricPattern1::new( + client.clone(), + _m(&acc, "adjusted_value_created"), + ), + adjusted_value_destroyed: MetricPattern1::new( + client.clone(), + _m(&acc, "adjusted_value_destroyed"), + ), mvrv: MetricPattern4::new(client.clone(), _m(&acc, "mvrv")), neg_realized_loss: BitcoinPattern::new(client.clone(), _m(&acc, "neg_realized_loss")), net_realized_pnl: BlockCountPattern::new(client.clone(), _m(&acc, "net_realized_pnl")), - net_realized_pnl_cumulative_30d_delta: MetricPattern4::new(client.clone(), _m(&acc, "net_realized_pnl_cumulative_30d_delta")), - net_realized_pnl_cumulative_30d_delta_rel_to_market_cap: MetricPattern4::new(client.clone(), _m(&acc, "net_realized_pnl_cumulative_30d_delta_rel_to_market_cap")), - net_realized_pnl_cumulative_30d_delta_rel_to_realized_cap: MetricPattern4::new(client.clone(), _m(&acc, "net_realized_pnl_cumulative_30d_delta_rel_to_realized_cap")), - net_realized_pnl_rel_to_realized_cap: BlockCountPattern::new(client.clone(), _m(&acc, "net_realized_pnl_rel_to_realized_cap")), + net_realized_pnl_cumulative_30d_delta: MetricPattern4::new( + client.clone(), + _m(&acc, "net_realized_pnl_cumulative_30d_delta"), + ), + net_realized_pnl_cumulative_30d_delta_rel_to_market_cap: MetricPattern4::new( + client.clone(), + _m( + &acc, + "net_realized_pnl_cumulative_30d_delta_rel_to_market_cap", + ), + ), + net_realized_pnl_cumulative_30d_delta_rel_to_realized_cap: MetricPattern4::new( + client.clone(), + _m( + &acc, + "net_realized_pnl_cumulative_30d_delta_rel_to_realized_cap", + ), + ), + net_realized_pnl_rel_to_realized_cap: BlockCountPattern::new( + client.clone(), + _m(&acc, "net_realized_pnl_rel_to_realized_cap"), + ), realized_cap: MetricPattern1::new(client.clone(), _m(&acc, "realized_cap")), - realized_cap_30d_delta: MetricPattern4::new(client.clone(), _m(&acc, "realized_cap_30d_delta")), - realized_cap_rel_to_own_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "realized_cap_rel_to_own_market_cap")), + realized_cap_30d_delta: MetricPattern4::new( + client.clone(), + _m(&acc, "realized_cap_30d_delta"), + ), + realized_cap_rel_to_own_market_cap: MetricPattern1::new( + client.clone(), + _m(&acc, "realized_cap_rel_to_own_market_cap"), + ), realized_loss: BlockCountPattern::new(client.clone(), _m(&acc, "realized_loss")), - realized_loss_rel_to_realized_cap: BlockCountPattern::new(client.clone(), _m(&acc, "realized_loss_rel_to_realized_cap")), + realized_loss_rel_to_realized_cap: BlockCountPattern::new( + client.clone(), + _m(&acc, "realized_loss_rel_to_realized_cap"), + ), realized_price: MetricPattern1::new(client.clone(), _m(&acc, "realized_price")), - realized_price_extra: ActivePriceRatioPattern::new(client.clone(), _m(&acc, "realized_price_ratio")), + realized_price_extra: ActivePriceRatioPattern::new( + client.clone(), + _m(&acc, "realized_price_ratio"), + ), realized_profit: BlockCountPattern::new(client.clone(), _m(&acc, "realized_profit")), - realized_profit_rel_to_realized_cap: BlockCountPattern::new(client.clone(), _m(&acc, "realized_profit_rel_to_realized_cap")), - realized_profit_to_loss_ratio: MetricPattern6::new(client.clone(), _m(&acc, "realized_profit_to_loss_ratio")), + realized_profit_rel_to_realized_cap: BlockCountPattern::new( + client.clone(), + _m(&acc, "realized_profit_rel_to_realized_cap"), + ), + realized_profit_to_loss_ratio: MetricPattern6::new( + client.clone(), + _m(&acc, "realized_profit_to_loss_ratio"), + ), realized_value: MetricPattern1::new(client.clone(), _m(&acc, "realized_value")), - sell_side_risk_ratio: MetricPattern6::new(client.clone(), _m(&acc, "sell_side_risk_ratio")), - sell_side_risk_ratio_30d_ema: MetricPattern6::new(client.clone(), _m(&acc, "sell_side_risk_ratio_30d_ema")), - sell_side_risk_ratio_7d_ema: MetricPattern6::new(client.clone(), _m(&acc, "sell_side_risk_ratio_7d_ema")), + sell_side_risk_ratio: MetricPattern6::new( + client.clone(), + _m(&acc, "sell_side_risk_ratio"), + ), + sell_side_risk_ratio_30d_ema: MetricPattern6::new( + client.clone(), + _m(&acc, "sell_side_risk_ratio_30d_ema"), + ), + sell_side_risk_ratio_7d_ema: MetricPattern6::new( + client.clone(), + _m(&acc, "sell_side_risk_ratio_7d_ema"), + ), sopr: MetricPattern6::new(client.clone(), _m(&acc, "sopr")), sopr_30d_ema: MetricPattern6::new(client.clone(), _m(&acc, "sopr_30d_ema")), sopr_7d_ema: MetricPattern6::new(client.clone(), _m(&acc, "sopr_7d_ema")), @@ -2374,29 +2458,80 @@ impl RealizedPattern4 { pub fn new(client: Arc, acc: String) -> Self { Self { adjusted_sopr: MetricPattern6::new(client.clone(), _m(&acc, "adjusted_sopr")), - adjusted_sopr_30d_ema: MetricPattern6::new(client.clone(), _m(&acc, "adjusted_sopr_30d_ema")), - adjusted_sopr_7d_ema: MetricPattern6::new(client.clone(), _m(&acc, "adjusted_sopr_7d_ema")), - adjusted_value_created: MetricPattern1::new(client.clone(), _m(&acc, "adjusted_value_created")), - adjusted_value_destroyed: MetricPattern1::new(client.clone(), _m(&acc, "adjusted_value_destroyed")), + adjusted_sopr_30d_ema: MetricPattern6::new( + client.clone(), + _m(&acc, "adjusted_sopr_30d_ema"), + ), + adjusted_sopr_7d_ema: MetricPattern6::new( + client.clone(), + _m(&acc, "adjusted_sopr_7d_ema"), + ), + adjusted_value_created: MetricPattern1::new( + client.clone(), + _m(&acc, "adjusted_value_created"), + ), + adjusted_value_destroyed: MetricPattern1::new( + client.clone(), + _m(&acc, "adjusted_value_destroyed"), + ), mvrv: MetricPattern4::new(client.clone(), _m(&acc, "mvrv")), neg_realized_loss: BitcoinPattern::new(client.clone(), _m(&acc, "neg_realized_loss")), net_realized_pnl: BlockCountPattern::new(client.clone(), _m(&acc, "net_realized_pnl")), - net_realized_pnl_cumulative_30d_delta: MetricPattern4::new(client.clone(), _m(&acc, "net_realized_pnl_cumulative_30d_delta")), - net_realized_pnl_cumulative_30d_delta_rel_to_market_cap: MetricPattern4::new(client.clone(), _m(&acc, "net_realized_pnl_cumulative_30d_delta_rel_to_market_cap")), - net_realized_pnl_cumulative_30d_delta_rel_to_realized_cap: MetricPattern4::new(client.clone(), _m(&acc, "net_realized_pnl_cumulative_30d_delta_rel_to_realized_cap")), - net_realized_pnl_rel_to_realized_cap: BlockCountPattern::new(client.clone(), _m(&acc, "net_realized_pnl_rel_to_realized_cap")), + net_realized_pnl_cumulative_30d_delta: MetricPattern4::new( + client.clone(), + _m(&acc, "net_realized_pnl_cumulative_30d_delta"), + ), + net_realized_pnl_cumulative_30d_delta_rel_to_market_cap: MetricPattern4::new( + client.clone(), + _m( + &acc, + "net_realized_pnl_cumulative_30d_delta_rel_to_market_cap", + ), + ), + net_realized_pnl_cumulative_30d_delta_rel_to_realized_cap: MetricPattern4::new( + client.clone(), + _m( + &acc, + "net_realized_pnl_cumulative_30d_delta_rel_to_realized_cap", + ), + ), + net_realized_pnl_rel_to_realized_cap: BlockCountPattern::new( + client.clone(), + _m(&acc, "net_realized_pnl_rel_to_realized_cap"), + ), realized_cap: MetricPattern1::new(client.clone(), _m(&acc, "realized_cap")), - realized_cap_30d_delta: MetricPattern4::new(client.clone(), _m(&acc, "realized_cap_30d_delta")), + realized_cap_30d_delta: MetricPattern4::new( + client.clone(), + _m(&acc, "realized_cap_30d_delta"), + ), realized_loss: BlockCountPattern::new(client.clone(), _m(&acc, "realized_loss")), - realized_loss_rel_to_realized_cap: BlockCountPattern::new(client.clone(), _m(&acc, "realized_loss_rel_to_realized_cap")), + realized_loss_rel_to_realized_cap: BlockCountPattern::new( + client.clone(), + _m(&acc, "realized_loss_rel_to_realized_cap"), + ), realized_price: MetricPattern1::new(client.clone(), _m(&acc, "realized_price")), - realized_price_extra: RealizedPriceExtraPattern::new(client.clone(), _m(&acc, "realized_price")), + realized_price_extra: RealizedPriceExtraPattern::new( + client.clone(), + _m(&acc, "realized_price"), + ), realized_profit: BlockCountPattern::new(client.clone(), _m(&acc, "realized_profit")), - realized_profit_rel_to_realized_cap: BlockCountPattern::new(client.clone(), _m(&acc, "realized_profit_rel_to_realized_cap")), + realized_profit_rel_to_realized_cap: BlockCountPattern::new( + client.clone(), + _m(&acc, "realized_profit_rel_to_realized_cap"), + ), realized_value: MetricPattern1::new(client.clone(), _m(&acc, "realized_value")), - sell_side_risk_ratio: MetricPattern6::new(client.clone(), _m(&acc, "sell_side_risk_ratio")), - sell_side_risk_ratio_30d_ema: MetricPattern6::new(client.clone(), _m(&acc, "sell_side_risk_ratio_30d_ema")), - sell_side_risk_ratio_7d_ema: MetricPattern6::new(client.clone(), _m(&acc, "sell_side_risk_ratio_7d_ema")), + sell_side_risk_ratio: MetricPattern6::new( + client.clone(), + _m(&acc, "sell_side_risk_ratio"), + ), + sell_side_risk_ratio_30d_ema: MetricPattern6::new( + client.clone(), + _m(&acc, "sell_side_risk_ratio_30d_ema"), + ), + sell_side_risk_ratio_7d_ema: MetricPattern6::new( + client.clone(), + _m(&acc, "sell_side_risk_ratio_7d_ema"), + ), sopr: MetricPattern6::new(client.clone(), _m(&acc, "sopr")), sopr_30d_ema: MetricPattern6::new(client.clone(), _m(&acc, "sopr_30d_ema")), sopr_7d_ema: MetricPattern6::new(client.clone(), _m(&acc, "sopr_7d_ema")), @@ -2513,24 +2648,69 @@ impl RealizedPattern2 { mvrv: MetricPattern4::new(client.clone(), _m(&acc, "mvrv")), neg_realized_loss: BitcoinPattern::new(client.clone(), _m(&acc, "neg_realized_loss")), net_realized_pnl: BlockCountPattern::new(client.clone(), _m(&acc, "net_realized_pnl")), - net_realized_pnl_cumulative_30d_delta: MetricPattern4::new(client.clone(), _m(&acc, "net_realized_pnl_cumulative_30d_delta")), - net_realized_pnl_cumulative_30d_delta_rel_to_market_cap: MetricPattern4::new(client.clone(), _m(&acc, "net_realized_pnl_cumulative_30d_delta_rel_to_market_cap")), - net_realized_pnl_cumulative_30d_delta_rel_to_realized_cap: MetricPattern4::new(client.clone(), _m(&acc, "net_realized_pnl_cumulative_30d_delta_rel_to_realized_cap")), - net_realized_pnl_rel_to_realized_cap: BlockCountPattern::new(client.clone(), _m(&acc, "net_realized_pnl_rel_to_realized_cap")), + net_realized_pnl_cumulative_30d_delta: MetricPattern4::new( + client.clone(), + _m(&acc, "net_realized_pnl_cumulative_30d_delta"), + ), + net_realized_pnl_cumulative_30d_delta_rel_to_market_cap: MetricPattern4::new( + client.clone(), + _m( + &acc, + "net_realized_pnl_cumulative_30d_delta_rel_to_market_cap", + ), + ), + net_realized_pnl_cumulative_30d_delta_rel_to_realized_cap: MetricPattern4::new( + client.clone(), + _m( + &acc, + "net_realized_pnl_cumulative_30d_delta_rel_to_realized_cap", + ), + ), + net_realized_pnl_rel_to_realized_cap: BlockCountPattern::new( + client.clone(), + _m(&acc, "net_realized_pnl_rel_to_realized_cap"), + ), realized_cap: MetricPattern1::new(client.clone(), _m(&acc, "realized_cap")), - realized_cap_30d_delta: MetricPattern4::new(client.clone(), _m(&acc, "realized_cap_30d_delta")), - realized_cap_rel_to_own_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "realized_cap_rel_to_own_market_cap")), + realized_cap_30d_delta: MetricPattern4::new( + client.clone(), + _m(&acc, "realized_cap_30d_delta"), + ), + realized_cap_rel_to_own_market_cap: MetricPattern1::new( + client.clone(), + _m(&acc, "realized_cap_rel_to_own_market_cap"), + ), realized_loss: BlockCountPattern::new(client.clone(), _m(&acc, "realized_loss")), - realized_loss_rel_to_realized_cap: BlockCountPattern::new(client.clone(), _m(&acc, "realized_loss_rel_to_realized_cap")), + realized_loss_rel_to_realized_cap: BlockCountPattern::new( + client.clone(), + _m(&acc, "realized_loss_rel_to_realized_cap"), + ), realized_price: MetricPattern1::new(client.clone(), _m(&acc, "realized_price")), - realized_price_extra: ActivePriceRatioPattern::new(client.clone(), _m(&acc, "realized_price_ratio")), + realized_price_extra: ActivePriceRatioPattern::new( + client.clone(), + _m(&acc, "realized_price_ratio"), + ), realized_profit: BlockCountPattern::new(client.clone(), _m(&acc, "realized_profit")), - realized_profit_rel_to_realized_cap: BlockCountPattern::new(client.clone(), _m(&acc, "realized_profit_rel_to_realized_cap")), - realized_profit_to_loss_ratio: MetricPattern6::new(client.clone(), _m(&acc, "realized_profit_to_loss_ratio")), + realized_profit_rel_to_realized_cap: BlockCountPattern::new( + client.clone(), + _m(&acc, "realized_profit_rel_to_realized_cap"), + ), + realized_profit_to_loss_ratio: MetricPattern6::new( + client.clone(), + _m(&acc, "realized_profit_to_loss_ratio"), + ), realized_value: MetricPattern1::new(client.clone(), _m(&acc, "realized_value")), - sell_side_risk_ratio: MetricPattern6::new(client.clone(), _m(&acc, "sell_side_risk_ratio")), - sell_side_risk_ratio_30d_ema: MetricPattern6::new(client.clone(), _m(&acc, "sell_side_risk_ratio_30d_ema")), - sell_side_risk_ratio_7d_ema: MetricPattern6::new(client.clone(), _m(&acc, "sell_side_risk_ratio_7d_ema")), + sell_side_risk_ratio: MetricPattern6::new( + client.clone(), + _m(&acc, "sell_side_risk_ratio"), + ), + sell_side_risk_ratio_30d_ema: MetricPattern6::new( + client.clone(), + _m(&acc, "sell_side_risk_ratio_30d_ema"), + ), + sell_side_risk_ratio_7d_ema: MetricPattern6::new( + client.clone(), + _m(&acc, "sell_side_risk_ratio_7d_ema"), + ), sopr: MetricPattern6::new(client.clone(), _m(&acc, "sopr")), sopr_30d_ema: MetricPattern6::new(client.clone(), _m(&acc, "sopr_30d_ema")), sopr_7d_ema: MetricPattern6::new(client.clone(), _m(&acc, "sopr_7d_ema")), @@ -2577,22 +2757,61 @@ impl RealizedPattern { mvrv: MetricPattern4::new(client.clone(), _m(&acc, "mvrv")), neg_realized_loss: BitcoinPattern::new(client.clone(), _m(&acc, "neg_realized_loss")), net_realized_pnl: BlockCountPattern::new(client.clone(), _m(&acc, "net_realized_pnl")), - net_realized_pnl_cumulative_30d_delta: MetricPattern4::new(client.clone(), _m(&acc, "net_realized_pnl_cumulative_30d_delta")), - net_realized_pnl_cumulative_30d_delta_rel_to_market_cap: MetricPattern4::new(client.clone(), _m(&acc, "net_realized_pnl_cumulative_30d_delta_rel_to_market_cap")), - net_realized_pnl_cumulative_30d_delta_rel_to_realized_cap: MetricPattern4::new(client.clone(), _m(&acc, "net_realized_pnl_cumulative_30d_delta_rel_to_realized_cap")), - net_realized_pnl_rel_to_realized_cap: BlockCountPattern::new(client.clone(), _m(&acc, "net_realized_pnl_rel_to_realized_cap")), + net_realized_pnl_cumulative_30d_delta: MetricPattern4::new( + client.clone(), + _m(&acc, "net_realized_pnl_cumulative_30d_delta"), + ), + net_realized_pnl_cumulative_30d_delta_rel_to_market_cap: MetricPattern4::new( + client.clone(), + _m( + &acc, + "net_realized_pnl_cumulative_30d_delta_rel_to_market_cap", + ), + ), + net_realized_pnl_cumulative_30d_delta_rel_to_realized_cap: MetricPattern4::new( + client.clone(), + _m( + &acc, + "net_realized_pnl_cumulative_30d_delta_rel_to_realized_cap", + ), + ), + net_realized_pnl_rel_to_realized_cap: BlockCountPattern::new( + client.clone(), + _m(&acc, "net_realized_pnl_rel_to_realized_cap"), + ), realized_cap: MetricPattern1::new(client.clone(), _m(&acc, "realized_cap")), - realized_cap_30d_delta: MetricPattern4::new(client.clone(), _m(&acc, "realized_cap_30d_delta")), + realized_cap_30d_delta: MetricPattern4::new( + client.clone(), + _m(&acc, "realized_cap_30d_delta"), + ), realized_loss: BlockCountPattern::new(client.clone(), _m(&acc, "realized_loss")), - realized_loss_rel_to_realized_cap: BlockCountPattern::new(client.clone(), _m(&acc, "realized_loss_rel_to_realized_cap")), + realized_loss_rel_to_realized_cap: BlockCountPattern::new( + client.clone(), + _m(&acc, "realized_loss_rel_to_realized_cap"), + ), realized_price: MetricPattern1::new(client.clone(), _m(&acc, "realized_price")), - realized_price_extra: RealizedPriceExtraPattern::new(client.clone(), _m(&acc, "realized_price")), + realized_price_extra: RealizedPriceExtraPattern::new( + client.clone(), + _m(&acc, "realized_price"), + ), realized_profit: BlockCountPattern::new(client.clone(), _m(&acc, "realized_profit")), - realized_profit_rel_to_realized_cap: BlockCountPattern::new(client.clone(), _m(&acc, "realized_profit_rel_to_realized_cap")), + realized_profit_rel_to_realized_cap: BlockCountPattern::new( + client.clone(), + _m(&acc, "realized_profit_rel_to_realized_cap"), + ), realized_value: MetricPattern1::new(client.clone(), _m(&acc, "realized_value")), - sell_side_risk_ratio: MetricPattern6::new(client.clone(), _m(&acc, "sell_side_risk_ratio")), - sell_side_risk_ratio_30d_ema: MetricPattern6::new(client.clone(), _m(&acc, "sell_side_risk_ratio_30d_ema")), - sell_side_risk_ratio_7d_ema: MetricPattern6::new(client.clone(), _m(&acc, "sell_side_risk_ratio_7d_ema")), + sell_side_risk_ratio: MetricPattern6::new( + client.clone(), + _m(&acc, "sell_side_risk_ratio"), + ), + sell_side_risk_ratio_30d_ema: MetricPattern6::new( + client.clone(), + _m(&acc, "sell_side_risk_ratio_30d_ema"), + ), + sell_side_risk_ratio_7d_ema: MetricPattern6::new( + client.clone(), + _m(&acc, "sell_side_risk_ratio_7d_ema"), + ), sopr: MetricPattern6::new(client.clone(), _m(&acc, "sopr")), sopr_30d_ema: MetricPattern6::new(client.clone(), _m(&acc, "sopr_30d_ema")), sopr_7d_ema: MetricPattern6::new(client.clone(), _m(&acc, "sopr_7d_ema")), @@ -2781,24 +3000,75 @@ impl RelativePattern5 { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - neg_unrealized_loss_rel_to_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "neg_unrealized_loss_rel_to_market_cap")), - neg_unrealized_loss_rel_to_own_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "neg_unrealized_loss_rel_to_own_market_cap")), - neg_unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1::new(client.clone(), _m(&acc, "neg_unrealized_loss_rel_to_own_total_unrealized_pnl")), - net_unrealized_pnl_rel_to_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "net_unrealized_pnl_rel_to_market_cap")), - net_unrealized_pnl_rel_to_own_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "net_unrealized_pnl_rel_to_own_market_cap")), - net_unrealized_pnl_rel_to_own_total_unrealized_pnl: MetricPattern1::new(client.clone(), _m(&acc, "net_unrealized_pnl_rel_to_own_total_unrealized_pnl")), + neg_unrealized_loss_rel_to_market_cap: MetricPattern1::new( + client.clone(), + _m(&acc, "neg_unrealized_loss_rel_to_market_cap"), + ), + neg_unrealized_loss_rel_to_own_market_cap: MetricPattern1::new( + client.clone(), + _m(&acc, "neg_unrealized_loss_rel_to_own_market_cap"), + ), + neg_unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1::new( + client.clone(), + _m(&acc, "neg_unrealized_loss_rel_to_own_total_unrealized_pnl"), + ), + net_unrealized_pnl_rel_to_market_cap: MetricPattern1::new( + client.clone(), + _m(&acc, "net_unrealized_pnl_rel_to_market_cap"), + ), + net_unrealized_pnl_rel_to_own_market_cap: MetricPattern1::new( + client.clone(), + _m(&acc, "net_unrealized_pnl_rel_to_own_market_cap"), + ), + net_unrealized_pnl_rel_to_own_total_unrealized_pnl: MetricPattern1::new( + client.clone(), + _m(&acc, "net_unrealized_pnl_rel_to_own_total_unrealized_pnl"), + ), nupl: MetricPattern1::new(client.clone(), _m(&acc, "nupl")), - supply_in_loss_rel_to_circulating_supply: MetricPattern1::new(client.clone(), _m(&acc, "supply_in_loss_rel_to_circulating_supply")), - supply_in_loss_rel_to_own_supply: MetricPattern1::new(client.clone(), _m(&acc, "supply_in_loss_rel_to_own_supply")), - supply_in_profit_rel_to_circulating_supply: MetricPattern1::new(client.clone(), _m(&acc, "supply_in_profit_rel_to_circulating_supply")), - supply_in_profit_rel_to_own_supply: MetricPattern1::new(client.clone(), _m(&acc, "supply_in_profit_rel_to_own_supply")), - supply_rel_to_circulating_supply: MetricPattern4::new(client.clone(), _m(&acc, "supply_rel_to_circulating_supply")), - unrealized_loss_rel_to_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "unrealized_loss_rel_to_market_cap")), - unrealized_loss_rel_to_own_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "unrealized_loss_rel_to_own_market_cap")), - unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1::new(client.clone(), _m(&acc, "unrealized_loss_rel_to_own_total_unrealized_pnl")), - unrealized_profit_rel_to_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "unrealized_profit_rel_to_market_cap")), - unrealized_profit_rel_to_own_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "unrealized_profit_rel_to_own_market_cap")), - unrealized_profit_rel_to_own_total_unrealized_pnl: MetricPattern1::new(client.clone(), _m(&acc, "unrealized_profit_rel_to_own_total_unrealized_pnl")), + supply_in_loss_rel_to_circulating_supply: MetricPattern1::new( + client.clone(), + _m(&acc, "supply_in_loss_rel_to_circulating_supply"), + ), + supply_in_loss_rel_to_own_supply: MetricPattern1::new( + client.clone(), + _m(&acc, "supply_in_loss_rel_to_own_supply"), + ), + supply_in_profit_rel_to_circulating_supply: MetricPattern1::new( + client.clone(), + _m(&acc, "supply_in_profit_rel_to_circulating_supply"), + ), + supply_in_profit_rel_to_own_supply: MetricPattern1::new( + client.clone(), + _m(&acc, "supply_in_profit_rel_to_own_supply"), + ), + supply_rel_to_circulating_supply: MetricPattern4::new( + client.clone(), + _m(&acc, "supply_rel_to_circulating_supply"), + ), + unrealized_loss_rel_to_market_cap: MetricPattern1::new( + client.clone(), + _m(&acc, "unrealized_loss_rel_to_market_cap"), + ), + unrealized_loss_rel_to_own_market_cap: MetricPattern1::new( + client.clone(), + _m(&acc, "unrealized_loss_rel_to_own_market_cap"), + ), + unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1::new( + client.clone(), + _m(&acc, "unrealized_loss_rel_to_own_total_unrealized_pnl"), + ), + unrealized_profit_rel_to_market_cap: MetricPattern1::new( + client.clone(), + _m(&acc, "unrealized_profit_rel_to_market_cap"), + ), + unrealized_profit_rel_to_own_market_cap: MetricPattern1::new( + client.clone(), + _m(&acc, "unrealized_profit_rel_to_own_market_cap"), + ), + unrealized_profit_rel_to_own_total_unrealized_pnl: MetricPattern1::new( + client.clone(), + _m(&acc, "unrealized_profit_rel_to_own_total_unrealized_pnl"), + ), } } } @@ -2900,18 +3170,102 @@ impl PeriodLumpSumStackPattern { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - _10y: _2015Pattern::new(client.clone(), if acc.is_empty() { "10y".to_string() } else { format!("10y_{acc}") }), - _1m: _2015Pattern::new(client.clone(), if acc.is_empty() { "1m".to_string() } else { format!("1m_{acc}") }), - _1w: _2015Pattern::new(client.clone(), if acc.is_empty() { "1w".to_string() } else { format!("1w_{acc}") }), - _1y: _2015Pattern::new(client.clone(), if acc.is_empty() { "1y".to_string() } else { format!("1y_{acc}") }), - _2y: _2015Pattern::new(client.clone(), if acc.is_empty() { "2y".to_string() } else { format!("2y_{acc}") }), - _3m: _2015Pattern::new(client.clone(), if acc.is_empty() { "3m".to_string() } else { format!("3m_{acc}") }), - _3y: _2015Pattern::new(client.clone(), if acc.is_empty() { "3y".to_string() } else { format!("3y_{acc}") }), - _4y: _2015Pattern::new(client.clone(), if acc.is_empty() { "4y".to_string() } else { format!("4y_{acc}") }), - _5y: _2015Pattern::new(client.clone(), if acc.is_empty() { "5y".to_string() } else { format!("5y_{acc}") }), - _6m: _2015Pattern::new(client.clone(), if acc.is_empty() { "6m".to_string() } else { format!("6m_{acc}") }), - _6y: _2015Pattern::new(client.clone(), if acc.is_empty() { "6y".to_string() } else { format!("6y_{acc}") }), - _8y: _2015Pattern::new(client.clone(), if acc.is_empty() { "8y".to_string() } else { format!("8y_{acc}") }), + _10y: _2015Pattern::new( + client.clone(), + if acc.is_empty() { + "10y".to_string() + } else { + format!("10y_{acc}") + }, + ), + _1m: _2015Pattern::new( + client.clone(), + if acc.is_empty() { + "1m".to_string() + } else { + format!("1m_{acc}") + }, + ), + _1w: _2015Pattern::new( + client.clone(), + if acc.is_empty() { + "1w".to_string() + } else { + format!("1w_{acc}") + }, + ), + _1y: _2015Pattern::new( + client.clone(), + if acc.is_empty() { + "1y".to_string() + } else { + format!("1y_{acc}") + }, + ), + _2y: _2015Pattern::new( + client.clone(), + if acc.is_empty() { + "2y".to_string() + } else { + format!("2y_{acc}") + }, + ), + _3m: _2015Pattern::new( + client.clone(), + if acc.is_empty() { + "3m".to_string() + } else { + format!("3m_{acc}") + }, + ), + _3y: _2015Pattern::new( + client.clone(), + if acc.is_empty() { + "3y".to_string() + } else { + format!("3y_{acc}") + }, + ), + _4y: _2015Pattern::new( + client.clone(), + if acc.is_empty() { + "4y".to_string() + } else { + format!("4y_{acc}") + }, + ), + _5y: _2015Pattern::new( + client.clone(), + if acc.is_empty() { + "5y".to_string() + } else { + format!("5y_{acc}") + }, + ), + _6m: _2015Pattern::new( + client.clone(), + if acc.is_empty() { + "6m".to_string() + } else { + format!("6m_{acc}") + }, + ), + _6y: _2015Pattern::new( + client.clone(), + if acc.is_empty() { + "6y".to_string() + } else { + format!("6y_{acc}") + }, + ), + _8y: _2015Pattern::new( + client.clone(), + if acc.is_empty() { + "8y".to_string() + } else { + format!("8y_{acc}") + }, + ), } } } @@ -2936,27 +3290,111 @@ impl PeriodAveragePricePattern { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - _10y: MetricPattern4::new(client.clone(), if acc.is_empty() { "10y".to_string() } else { format!("10y_{acc}") }), - _1m: MetricPattern4::new(client.clone(), if acc.is_empty() { "1m".to_string() } else { format!("1m_{acc}") }), - _1w: MetricPattern4::new(client.clone(), if acc.is_empty() { "1w".to_string() } else { format!("1w_{acc}") }), - _1y: MetricPattern4::new(client.clone(), if acc.is_empty() { "1y".to_string() } else { format!("1y_{acc}") }), - _2y: MetricPattern4::new(client.clone(), if acc.is_empty() { "2y".to_string() } else { format!("2y_{acc}") }), - _3m: MetricPattern4::new(client.clone(), if acc.is_empty() { "3m".to_string() } else { format!("3m_{acc}") }), - _3y: MetricPattern4::new(client.clone(), if acc.is_empty() { "3y".to_string() } else { format!("3y_{acc}") }), - _4y: MetricPattern4::new(client.clone(), if acc.is_empty() { "4y".to_string() } else { format!("4y_{acc}") }), - _5y: MetricPattern4::new(client.clone(), if acc.is_empty() { "5y".to_string() } else { format!("5y_{acc}") }), - _6m: MetricPattern4::new(client.clone(), if acc.is_empty() { "6m".to_string() } else { format!("6m_{acc}") }), - _6y: MetricPattern4::new(client.clone(), if acc.is_empty() { "6y".to_string() } else { format!("6y_{acc}") }), - _8y: MetricPattern4::new(client.clone(), if acc.is_empty() { "8y".to_string() } else { format!("8y_{acc}") }), + _10y: MetricPattern4::new( + client.clone(), + if acc.is_empty() { + "10y".to_string() + } else { + format!("10y_{acc}") + }, + ), + _1m: MetricPattern4::new( + client.clone(), + if acc.is_empty() { + "1m".to_string() + } else { + format!("1m_{acc}") + }, + ), + _1w: MetricPattern4::new( + client.clone(), + if acc.is_empty() { + "1w".to_string() + } else { + format!("1w_{acc}") + }, + ), + _1y: MetricPattern4::new( + client.clone(), + if acc.is_empty() { + "1y".to_string() + } else { + format!("1y_{acc}") + }, + ), + _2y: MetricPattern4::new( + client.clone(), + if acc.is_empty() { + "2y".to_string() + } else { + format!("2y_{acc}") + }, + ), + _3m: MetricPattern4::new( + client.clone(), + if acc.is_empty() { + "3m".to_string() + } else { + format!("3m_{acc}") + }, + ), + _3y: MetricPattern4::new( + client.clone(), + if acc.is_empty() { + "3y".to_string() + } else { + format!("3y_{acc}") + }, + ), + _4y: MetricPattern4::new( + client.clone(), + if acc.is_empty() { + "4y".to_string() + } else { + format!("4y_{acc}") + }, + ), + _5y: MetricPattern4::new( + client.clone(), + if acc.is_empty() { + "5y".to_string() + } else { + format!("5y_{acc}") + }, + ), + _6m: MetricPattern4::new( + client.clone(), + if acc.is_empty() { + "6m".to_string() + } else { + format!("6m_{acc}") + }, + ), + _6y: MetricPattern4::new( + client.clone(), + if acc.is_empty() { + "6y".to_string() + } else { + format!("6y_{acc}") + }, + ), + _8y: MetricPattern4::new( + client.clone(), + if acc.is_empty() { + "8y".to_string() + } else { + format!("8y_{acc}") + }, + ), } } } /// Pattern struct for repeated tree structure. -pub struct FullnessPattern { +pub struct DollarsPattern { pub average: MetricPattern2, pub base: MetricPattern11, - pub cumulative: MetricPattern2, + pub cumulative: MetricPattern1, pub max: MetricPattern2, pub median: MetricPattern6, pub min: MetricPattern2, @@ -2967,13 +3405,13 @@ pub struct FullnessPattern { pub sum: MetricPattern2, } -impl FullnessPattern { +impl DollarsPattern { /// 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")), + cumulative: MetricPattern1::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")), @@ -3020,10 +3458,10 @@ impl ClassAveragePricePattern { } /// Pattern struct for repeated tree structure. -pub struct DollarsPattern { +pub struct FullnessPattern { pub average: MetricPattern2, pub base: MetricPattern11, - pub cumulative: MetricPattern1, + pub cumulative: MetricPattern2, pub max: MetricPattern2, pub median: MetricPattern6, pub min: MetricPattern2, @@ -3034,13 +3472,13 @@ pub struct DollarsPattern { pub sum: MetricPattern2, } -impl DollarsPattern { +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: MetricPattern1::new(client.clone(), _m(&acc, "cumulative")), + 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")), @@ -3053,38 +3491,6 @@ impl DollarsPattern { } } -/// Pattern struct for repeated tree structure. -pub struct RelativePattern { - pub neg_unrealized_loss_rel_to_market_cap: MetricPattern1, - pub net_unrealized_pnl_rel_to_market_cap: MetricPattern1, - pub nupl: MetricPattern1, - pub supply_in_loss_rel_to_circulating_supply: MetricPattern1, - pub supply_in_loss_rel_to_own_supply: MetricPattern1, - pub supply_in_profit_rel_to_circulating_supply: MetricPattern1, - pub supply_in_profit_rel_to_own_supply: MetricPattern1, - pub supply_rel_to_circulating_supply: MetricPattern4, - pub unrealized_loss_rel_to_market_cap: MetricPattern1, - pub unrealized_profit_rel_to_market_cap: MetricPattern1, -} - -impl RelativePattern { - /// Create a new pattern node with accumulated metric name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - neg_unrealized_loss_rel_to_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "neg_unrealized_loss_rel_to_market_cap")), - net_unrealized_pnl_rel_to_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "net_unrealized_pnl_rel_to_market_cap")), - nupl: MetricPattern1::new(client.clone(), _m(&acc, "nupl")), - supply_in_loss_rel_to_circulating_supply: MetricPattern1::new(client.clone(), _m(&acc, "supply_in_loss_rel_to_circulating_supply")), - supply_in_loss_rel_to_own_supply: MetricPattern1::new(client.clone(), _m(&acc, "supply_in_loss_rel_to_own_supply")), - supply_in_profit_rel_to_circulating_supply: MetricPattern1::new(client.clone(), _m(&acc, "supply_in_profit_rel_to_circulating_supply")), - supply_in_profit_rel_to_own_supply: MetricPattern1::new(client.clone(), _m(&acc, "supply_in_profit_rel_to_own_supply")), - supply_rel_to_circulating_supply: MetricPattern4::new(client.clone(), _m(&acc, "supply_rel_to_circulating_supply")), - unrealized_loss_rel_to_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "unrealized_loss_rel_to_market_cap")), - unrealized_profit_rel_to_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "unrealized_profit_rel_to_market_cap")), - } - } -} - /// Pattern struct for repeated tree structure. pub struct RelativePattern2 { pub neg_unrealized_loss_rel_to_own_market_cap: MetricPattern1, @@ -3103,16 +3509,105 @@ impl RelativePattern2 { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - neg_unrealized_loss_rel_to_own_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "neg_unrealized_loss_rel_to_own_market_cap")), - neg_unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1::new(client.clone(), _m(&acc, "neg_unrealized_loss_rel_to_own_total_unrealized_pnl")), - net_unrealized_pnl_rel_to_own_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "net_unrealized_pnl_rel_to_own_market_cap")), - net_unrealized_pnl_rel_to_own_total_unrealized_pnl: MetricPattern1::new(client.clone(), _m(&acc, "net_unrealized_pnl_rel_to_own_total_unrealized_pnl")), - supply_in_loss_rel_to_own_supply: MetricPattern1::new(client.clone(), _m(&acc, "supply_in_loss_rel_to_own_supply")), - supply_in_profit_rel_to_own_supply: MetricPattern1::new(client.clone(), _m(&acc, "supply_in_profit_rel_to_own_supply")), - unrealized_loss_rel_to_own_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "unrealized_loss_rel_to_own_market_cap")), - unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1::new(client.clone(), _m(&acc, "unrealized_loss_rel_to_own_total_unrealized_pnl")), - unrealized_profit_rel_to_own_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "unrealized_profit_rel_to_own_market_cap")), - unrealized_profit_rel_to_own_total_unrealized_pnl: MetricPattern1::new(client.clone(), _m(&acc, "unrealized_profit_rel_to_own_total_unrealized_pnl")), + neg_unrealized_loss_rel_to_own_market_cap: MetricPattern1::new( + client.clone(), + _m(&acc, "neg_unrealized_loss_rel_to_own_market_cap"), + ), + neg_unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1::new( + client.clone(), + _m(&acc, "neg_unrealized_loss_rel_to_own_total_unrealized_pnl"), + ), + net_unrealized_pnl_rel_to_own_market_cap: MetricPattern1::new( + client.clone(), + _m(&acc, "net_unrealized_pnl_rel_to_own_market_cap"), + ), + net_unrealized_pnl_rel_to_own_total_unrealized_pnl: MetricPattern1::new( + client.clone(), + _m(&acc, "net_unrealized_pnl_rel_to_own_total_unrealized_pnl"), + ), + supply_in_loss_rel_to_own_supply: MetricPattern1::new( + client.clone(), + _m(&acc, "supply_in_loss_rel_to_own_supply"), + ), + supply_in_profit_rel_to_own_supply: MetricPattern1::new( + client.clone(), + _m(&acc, "supply_in_profit_rel_to_own_supply"), + ), + unrealized_loss_rel_to_own_market_cap: MetricPattern1::new( + client.clone(), + _m(&acc, "unrealized_loss_rel_to_own_market_cap"), + ), + unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1::new( + client.clone(), + _m(&acc, "unrealized_loss_rel_to_own_total_unrealized_pnl"), + ), + unrealized_profit_rel_to_own_market_cap: MetricPattern1::new( + client.clone(), + _m(&acc, "unrealized_profit_rel_to_own_market_cap"), + ), + unrealized_profit_rel_to_own_total_unrealized_pnl: MetricPattern1::new( + client.clone(), + _m(&acc, "unrealized_profit_rel_to_own_total_unrealized_pnl"), + ), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct RelativePattern { + pub neg_unrealized_loss_rel_to_market_cap: MetricPattern1, + pub net_unrealized_pnl_rel_to_market_cap: MetricPattern1, + pub nupl: MetricPattern1, + pub supply_in_loss_rel_to_circulating_supply: MetricPattern1, + pub supply_in_loss_rel_to_own_supply: MetricPattern1, + pub supply_in_profit_rel_to_circulating_supply: MetricPattern1, + pub supply_in_profit_rel_to_own_supply: MetricPattern1, + pub supply_rel_to_circulating_supply: MetricPattern4, + pub unrealized_loss_rel_to_market_cap: MetricPattern1, + pub unrealized_profit_rel_to_market_cap: MetricPattern1, +} + +impl RelativePattern { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + neg_unrealized_loss_rel_to_market_cap: MetricPattern1::new( + client.clone(), + _m(&acc, "neg_unrealized_loss_rel_to_market_cap"), + ), + net_unrealized_pnl_rel_to_market_cap: MetricPattern1::new( + client.clone(), + _m(&acc, "net_unrealized_pnl_rel_to_market_cap"), + ), + nupl: MetricPattern1::new(client.clone(), _m(&acc, "nupl")), + supply_in_loss_rel_to_circulating_supply: MetricPattern1::new( + client.clone(), + _m(&acc, "supply_in_loss_rel_to_circulating_supply"), + ), + supply_in_loss_rel_to_own_supply: MetricPattern1::new( + client.clone(), + _m(&acc, "supply_in_loss_rel_to_own_supply"), + ), + supply_in_profit_rel_to_circulating_supply: MetricPattern1::new( + client.clone(), + _m(&acc, "supply_in_profit_rel_to_circulating_supply"), + ), + supply_in_profit_rel_to_own_supply: MetricPattern1::new( + client.clone(), + _m(&acc, "supply_in_profit_rel_to_own_supply"), + ), + supply_rel_to_circulating_supply: MetricPattern4::new( + client.clone(), + _m(&acc, "supply_rel_to_circulating_supply"), + ), + unrealized_loss_rel_to_market_cap: MetricPattern1::new( + client.clone(), + _m(&acc, "unrealized_loss_rel_to_market_cap"), + ), + unrealized_profit_rel_to_market_cap: MetricPattern1::new( + client.clone(), + _m(&acc, "unrealized_profit_rel_to_market_cap"), + ), } } } @@ -3236,6 +3731,81 @@ impl _0satsPattern { } } +/// Pattern struct for repeated tree structure. +pub struct PeriodCagrPattern { + pub _10y: MetricPattern4, + pub _2y: MetricPattern4, + pub _3y: MetricPattern4, + pub _4y: MetricPattern4, + pub _5y: MetricPattern4, + pub _6y: MetricPattern4, + pub _8y: MetricPattern4, +} + +impl PeriodCagrPattern { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + _10y: MetricPattern4::new( + client.clone(), + if acc.is_empty() { + "10y".to_string() + } else { + format!("10y_{acc}") + }, + ), + _2y: MetricPattern4::new( + client.clone(), + if acc.is_empty() { + "2y".to_string() + } else { + format!("2y_{acc}") + }, + ), + _3y: MetricPattern4::new( + client.clone(), + if acc.is_empty() { + "3y".to_string() + } else { + format!("3y_{acc}") + }, + ), + _4y: MetricPattern4::new( + client.clone(), + if acc.is_empty() { + "4y".to_string() + } else { + format!("4y_{acc}") + }, + ), + _5y: MetricPattern4::new( + client.clone(), + if acc.is_empty() { + "5y".to_string() + } else { + format!("5y_{acc}") + }, + ), + _6y: MetricPattern4::new( + client.clone(), + if acc.is_empty() { + "6y".to_string() + } else { + format!("6y_{acc}") + }, + ), + _8y: MetricPattern4::new( + client.clone(), + if acc.is_empty() { + "8y".to_string() + } else { + format!("8y_{acc}") + }, + ), + } + } +} + /// Pattern struct for repeated tree structure. pub struct _10yTo12yPattern { pub activity: ActivityPattern2, @@ -3288,32 +3858,6 @@ impl _10yPattern { } } -/// Pattern struct for repeated tree structure. -pub struct _0satsPattern2 { - pub activity: ActivityPattern2, - pub cost_basis: CostBasisPattern, - pub outputs: OutputsPattern, - pub realized: RealizedPattern, - pub relative: RelativePattern4, - pub supply: SupplyPattern2, - pub unrealized: UnrealizedPattern, -} - -impl _0satsPattern2 { - /// 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: RealizedPattern::new(client.clone(), acc.clone()), - relative: RelativePattern4::new(client.clone(), _m(&acc, "supply_in")), - supply: SupplyPattern2::new(client.clone(), _m(&acc, "supply")), - unrealized: UnrealizedPattern::new(client.clone(), acc.clone()), - } - } -} - /// Pattern struct for repeated tree structure. pub struct _100btcPattern { pub activity: ActivityPattern2, @@ -3340,32 +3884,6 @@ impl _100btcPattern { } } -/// Pattern struct for repeated tree structure. -pub struct PeriodCagrPattern { - pub _10y: MetricPattern4, - pub _2y: MetricPattern4, - pub _3y: MetricPattern4, - pub _4y: MetricPattern4, - pub _5y: MetricPattern4, - pub _6y: MetricPattern4, - pub _8y: MetricPattern4, -} - -impl PeriodCagrPattern { - /// Create a new pattern node with accumulated metric name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - _10y: MetricPattern4::new(client.clone(), if acc.is_empty() { "10y".to_string() } else { format!("10y_{acc}") }), - _2y: MetricPattern4::new(client.clone(), if acc.is_empty() { "2y".to_string() } else { format!("2y_{acc}") }), - _3y: MetricPattern4::new(client.clone(), if acc.is_empty() { "3y".to_string() } else { format!("3y_{acc}") }), - _4y: MetricPattern4::new(client.clone(), if acc.is_empty() { "4y".to_string() } else { format!("4y_{acc}") }), - _5y: MetricPattern4::new(client.clone(), if acc.is_empty() { "5y".to_string() } else { format!("5y_{acc}") }), - _6y: MetricPattern4::new(client.clone(), if acc.is_empty() { "6y".to_string() } else { format!("6y_{acc}") }), - _8y: MetricPattern4::new(client.clone(), if acc.is_empty() { "8y".to_string() } else { format!("8y_{acc}") }), - } - } -} - /// Pattern struct for repeated tree structure. pub struct UnrealizedPattern { pub neg_unrealized_loss: MetricPattern1, @@ -3381,17 +3899,52 @@ 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")), + 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")), + 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, + pub cost_basis: CostBasisPattern, + pub outputs: OutputsPattern, + pub realized: RealizedPattern, + pub relative: RelativePattern4, + pub supply: SupplyPattern2, + pub unrealized: UnrealizedPattern, +} + +impl _0satsPattern2 { + /// 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: RealizedPattern::new(client.clone(), acc.clone()), + relative: RelativePattern4::new(client.clone(), _m(&acc, "supply_in")), + supply: SupplyPattern2::new(client.clone(), _m(&acc, "supply")), + unrealized: UnrealizedPattern::new(client.clone(), acc.clone()), + } + } +} + /// Pattern struct for repeated tree structure. pub struct ActivityPattern2 { pub coinblocks_destroyed: BlockCountPattern, @@ -3405,9 +3958,18 @@ impl ActivityPattern2 { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - coinblocks_destroyed: BlockCountPattern::new(client.clone(), _m(&acc, "coinblocks_destroyed")), - coindays_destroyed: BlockCountPattern::new(client.clone(), _m(&acc, "coindays_destroyed")), - satblocks_destroyed: MetricPattern11::new(client.clone(), _m(&acc, "satblocks_destroyed")), + coinblocks_destroyed: BlockCountPattern::new( + client.clone(), + _m(&acc, "coinblocks_destroyed"), + ), + coindays_destroyed: BlockCountPattern::new( + client.clone(), + _m(&acc, "coindays_destroyed"), + ), + satblocks_destroyed: MetricPattern11::new( + client.clone(), + _m(&acc, "satblocks_destroyed"), + ), satdays_destroyed: MetricPattern11::new(client.clone(), _m(&acc, "satdays_destroyed")), sent: UnclaimedRewardsPattern::new(client.clone(), _m(&acc, "sent")), } @@ -3435,19 +3997,19 @@ impl SplitPattern2 { } /// Pattern struct for repeated tree structure. -pub struct UnclaimedRewardsPattern { - pub bitcoin: BitcoinPattern, - pub dollars: BlockCountPattern, - pub sats: BlockCountPattern, +pub struct CoinbasePattern { + pub bitcoin: FullnessPattern, + pub dollars: DollarsPattern, + pub sats: DollarsPattern, } -impl UnclaimedRewardsPattern { +impl CoinbasePattern { /// 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")), - dollars: BlockCountPattern::new(client.clone(), _m(&acc, "usd")), - sats: BlockCountPattern::new(client.clone(), acc.clone()), + bitcoin: FullnessPattern::new(client.clone(), _m(&acc, "btc")), + dollars: DollarsPattern::new(client.clone(), _m(&acc, "usd")), + sats: DollarsPattern::new(client.clone(), acc.clone()), } } } @@ -3464,25 +4026,10 @@ impl CostBasisPattern2 { 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 CoinbasePattern { - pub bitcoin: FullnessPattern, - pub dollars: DollarsPattern, - pub sats: DollarsPattern, -} - -impl CoinbasePattern { - /// Create a new pattern node with accumulated metric name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - bitcoin: FullnessPattern::new(client.clone(), _m(&acc, "btc")), - dollars: DollarsPattern::new(client.clone(), _m(&acc, "usd")), - sats: DollarsPattern::new(client.clone(), acc.clone()), + percentiles: PercentilesPattern::new( + client.clone(), + format!("{base_path}_percentiles"), + ), } } } @@ -3505,6 +4052,24 @@ impl CoinbasePattern2 { } } +/// Pattern struct for repeated tree structure. +pub struct ActiveSupplyPattern { + pub bitcoin: MetricPattern1, + pub dollars: MetricPattern1, + pub sats: MetricPattern1, +} + +impl ActiveSupplyPattern { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + bitcoin: MetricPattern1::new(client.clone(), _m(&acc, "btc")), + dollars: MetricPattern1::new(client.clone(), _m(&acc, "usd")), + sats: MetricPattern1::new(client.clone(), acc.clone()), + } + } +} + /// Pattern struct for repeated tree structure. pub struct _2015Pattern { pub bitcoin: MetricPattern4, @@ -3523,6 +4088,24 @@ impl _2015Pattern { } } +/// Pattern struct for repeated tree structure. +pub struct UnclaimedRewardsPattern { + pub bitcoin: BitcoinPattern, + pub dollars: BlockCountPattern, + pub sats: BlockCountPattern, +} + +impl UnclaimedRewardsPattern { + /// 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")), + dollars: BlockCountPattern::new(client.clone(), _m(&acc, "usd")), + sats: BlockCountPattern::new(client.clone(), acc.clone()), + } + } +} + /// Pattern struct for repeated tree structure. pub struct SegwitAdoptionPattern { pub base: MetricPattern11, @@ -3542,35 +4125,17 @@ impl SegwitAdoptionPattern { } /// Pattern struct for repeated tree structure. -pub struct ActiveSupplyPattern { - pub bitcoin: MetricPattern1, - pub dollars: MetricPattern1, - pub sats: MetricPattern1, +pub struct SupplyPattern2 { + pub halved: ActiveSupplyPattern, + pub total: ActiveSupplyPattern, } -impl ActiveSupplyPattern { +impl SupplyPattern2 { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - bitcoin: MetricPattern1::new(client.clone(), _m(&acc, "btc")), - dollars: MetricPattern1::new(client.clone(), _m(&acc, "usd")), - sats: MetricPattern1::new(client.clone(), acc.clone()), - } - } -} - -/// Pattern struct for repeated tree structure. -pub struct _1dReturns1mSdPattern { - pub sd: MetricPattern4, - pub sma: MetricPattern4, -} - -impl _1dReturns1mSdPattern { - /// Create a new pattern node with accumulated metric name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - sd: MetricPattern4::new(client.clone(), _m(&acc, "sd")), - sma: MetricPattern4::new(client.clone(), _m(&acc, "sma")), + halved: ActiveSupplyPattern::new(client.clone(), _m(&acc, "half")), + total: ActiveSupplyPattern::new(client.clone(), acc.clone()), } } } @@ -3591,22 +4156,6 @@ impl CostBasisPattern { } } -/// 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, @@ -3617,23 +4166,30 @@ impl RelativePattern4 { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - supply_in_loss_rel_to_own_supply: MetricPattern1::new(client.clone(), _m(&acc, "loss_rel_to_own_supply")), - supply_in_profit_rel_to_own_supply: MetricPattern1::new(client.clone(), _m(&acc, "profit_rel_to_own_supply")), + supply_in_loss_rel_to_own_supply: MetricPattern1::new( + client.clone(), + _m(&acc, "loss_rel_to_own_supply"), + ), + supply_in_profit_rel_to_own_supply: MetricPattern1::new( + client.clone(), + _m(&acc, "profit_rel_to_own_supply"), + ), } } } /// Pattern struct for repeated tree structure. -pub struct SatsPattern { - pub ohlc: MetricPattern1, - pub split: SplitPattern2, +pub struct _1dReturns1mSdPattern { + pub sd: MetricPattern4, + pub sma: MetricPattern4, } -impl SatsPattern { - pub fn new(client: Arc, base_path: String) -> Self { +impl _1dReturns1mSdPattern { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { Self { - ohlc: MetricPattern1::new(client.clone(), format!("{base_path}_ohlc")), - split: SplitPattern2::new(client.clone(), format!("{base_path}_split")), + sd: MetricPattern4::new(client.clone(), _m(&acc, "sd")), + sma: MetricPattern4::new(client.clone(), _m(&acc, "sma")), } } } @@ -3670,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 OutputsPattern { pub utxo_count: MetricPattern1, @@ -3698,51 +4269,57 @@ impl RealizedPriceExtraPattern { } } -// Catalog tree +// Metrics tree -/// Catalog tree node. -pub struct CatalogTree { - pub addresses: CatalogTree_Addresses, - pub blocks: CatalogTree_Blocks, - pub cointime: CatalogTree_Cointime, - pub constants: CatalogTree_Constants, - pub distribution: CatalogTree_Distribution, - pub indexes: CatalogTree_Indexes, - pub inputs: CatalogTree_Inputs, - pub market: CatalogTree_Market, - pub outputs: CatalogTree_Outputs, - pub pools: CatalogTree_Pools, - pub positions: CatalogTree_Positions, - pub price: CatalogTree_Price, - pub scripts: CatalogTree_Scripts, - pub supply: CatalogTree_Supply, - pub transactions: CatalogTree_Transactions, +/// Metrics tree node. +pub struct MetricsTree { + pub addresses: MetricsTree_Addresses, + pub blocks: MetricsTree_Blocks, + pub cointime: MetricsTree_Cointime, + pub constants: MetricsTree_Constants, + pub distribution: MetricsTree_Distribution, + pub indexes: MetricsTree_Indexes, + pub inputs: MetricsTree_Inputs, + pub market: MetricsTree_Market, + pub outputs: MetricsTree_Outputs, + pub pools: MetricsTree_Pools, + pub positions: MetricsTree_Positions, + pub price: MetricsTree_Price, + pub scripts: MetricsTree_Scripts, + pub supply: MetricsTree_Supply, + pub transactions: MetricsTree_Transactions, } -impl CatalogTree { +impl MetricsTree { pub fn new(client: Arc, base_path: String) -> Self { Self { - addresses: CatalogTree_Addresses::new(client.clone(), format!("{base_path}_addresses")), - blocks: CatalogTree_Blocks::new(client.clone(), format!("{base_path}_blocks")), - cointime: CatalogTree_Cointime::new(client.clone(), format!("{base_path}_cointime")), - constants: CatalogTree_Constants::new(client.clone(), format!("{base_path}_constants")), - distribution: CatalogTree_Distribution::new(client.clone(), format!("{base_path}_distribution")), - indexes: CatalogTree_Indexes::new(client.clone(), format!("{base_path}_indexes")), - inputs: CatalogTree_Inputs::new(client.clone(), format!("{base_path}_inputs")), - market: CatalogTree_Market::new(client.clone(), format!("{base_path}_market")), - outputs: CatalogTree_Outputs::new(client.clone(), format!("{base_path}_outputs")), - pools: CatalogTree_Pools::new(client.clone(), format!("{base_path}_pools")), - positions: CatalogTree_Positions::new(client.clone(), format!("{base_path}_positions")), - price: CatalogTree_Price::new(client.clone(), format!("{base_path}_price")), - scripts: CatalogTree_Scripts::new(client.clone(), format!("{base_path}_scripts")), - supply: CatalogTree_Supply::new(client.clone(), format!("{base_path}_supply")), - transactions: CatalogTree_Transactions::new(client.clone(), format!("{base_path}_transactions")), + addresses: MetricsTree_Addresses::new(client.clone(), format!("{base_path}_addresses")), + blocks: MetricsTree_Blocks::new(client.clone(), format!("{base_path}_blocks")), + cointime: MetricsTree_Cointime::new(client.clone(), format!("{base_path}_cointime")), + constants: MetricsTree_Constants::new(client.clone(), format!("{base_path}_constants")), + distribution: MetricsTree_Distribution::new( + client.clone(), + format!("{base_path}_distribution"), + ), + indexes: MetricsTree_Indexes::new(client.clone(), format!("{base_path}_indexes")), + inputs: MetricsTree_Inputs::new(client.clone(), format!("{base_path}_inputs")), + market: MetricsTree_Market::new(client.clone(), format!("{base_path}_market")), + outputs: MetricsTree_Outputs::new(client.clone(), format!("{base_path}_outputs")), + pools: MetricsTree_Pools::new(client.clone(), format!("{base_path}_pools")), + positions: MetricsTree_Positions::new(client.clone(), format!("{base_path}_positions")), + price: MetricsTree_Price::new(client.clone(), format!("{base_path}_price")), + scripts: MetricsTree_Scripts::new(client.clone(), format!("{base_path}_scripts")), + supply: MetricsTree_Supply::new(client.clone(), format!("{base_path}_supply")), + transactions: MetricsTree_Transactions::new( + client.clone(), + format!("{base_path}_transactions"), + ), } } } -/// Catalog tree node. -pub struct CatalogTree_Addresses { +/// Metrics tree node. +pub struct MetricsTree_Addresses { pub first_p2aaddressindex: MetricPattern11, pub first_p2pk33addressindex: MetricPattern11, pub first_p2pk65addressindex: MetricPattern11, @@ -3761,17 +4338,41 @@ pub struct CatalogTree_Addresses { pub p2wshbytes: MetricPattern24, } -impl CatalogTree_Addresses { +impl MetricsTree_Addresses { pub fn new(client: Arc, base_path: String) -> Self { Self { - first_p2aaddressindex: MetricPattern11::new(client.clone(), "first_p2aaddressindex".to_string()), - first_p2pk33addressindex: MetricPattern11::new(client.clone(), "first_p2pk33addressindex".to_string()), - first_p2pk65addressindex: MetricPattern11::new(client.clone(), "first_p2pk65addressindex".to_string()), - first_p2pkhaddressindex: MetricPattern11::new(client.clone(), "first_p2pkhaddressindex".to_string()), - first_p2shaddressindex: MetricPattern11::new(client.clone(), "first_p2shaddressindex".to_string()), - first_p2traddressindex: MetricPattern11::new(client.clone(), "first_p2traddressindex".to_string()), - first_p2wpkhaddressindex: MetricPattern11::new(client.clone(), "first_p2wpkhaddressindex".to_string()), - first_p2wshaddressindex: MetricPattern11::new(client.clone(), "first_p2wshaddressindex".to_string()), + first_p2aaddressindex: MetricPattern11::new( + client.clone(), + "first_p2aaddressindex".to_string(), + ), + first_p2pk33addressindex: MetricPattern11::new( + client.clone(), + "first_p2pk33addressindex".to_string(), + ), + first_p2pk65addressindex: MetricPattern11::new( + client.clone(), + "first_p2pk65addressindex".to_string(), + ), + first_p2pkhaddressindex: MetricPattern11::new( + client.clone(), + "first_p2pkhaddressindex".to_string(), + ), + first_p2shaddressindex: MetricPattern11::new( + client.clone(), + "first_p2shaddressindex".to_string(), + ), + first_p2traddressindex: MetricPattern11::new( + client.clone(), + "first_p2traddressindex".to_string(), + ), + first_p2wpkhaddressindex: MetricPattern11::new( + client.clone(), + "first_p2wpkhaddressindex".to_string(), + ), + first_p2wshaddressindex: MetricPattern11::new( + client.clone(), + "first_p2wshaddressindex".to_string(), + ), p2abytes: MetricPattern16::new(client.clone(), "p2abytes".to_string()), p2pk33bytes: MetricPattern18::new(client.clone(), "p2pk33bytes".to_string()), p2pk65bytes: MetricPattern19::new(client.clone(), "p2pk65bytes".to_string()), @@ -3784,36 +4385,48 @@ impl CatalogTree_Addresses { } } -/// Catalog tree node. -pub struct CatalogTree_Blocks { +/// Metrics tree node. +pub struct MetricsTree_Blocks { pub blockhash: MetricPattern11, - pub count: CatalogTree_Blocks_Count, - pub difficulty: CatalogTree_Blocks_Difficulty, + pub count: MetricsTree_Blocks_Count, + pub difficulty: MetricsTree_Blocks_Difficulty, pub fullness: FullnessPattern, - pub halving: CatalogTree_Blocks_Halving, - pub interval: CatalogTree_Blocks_Interval, - pub mining: CatalogTree_Blocks_Mining, - pub rewards: CatalogTree_Blocks_Rewards, - pub size: CatalogTree_Blocks_Size, - pub time: CatalogTree_Blocks_Time, + pub halving: MetricsTree_Blocks_Halving, + pub interval: MetricsTree_Blocks_Interval, + pub mining: MetricsTree_Blocks_Mining, + pub rewards: MetricsTree_Blocks_Rewards, + pub size: MetricsTree_Blocks_Size, + pub time: MetricsTree_Blocks_Time, pub total_size: MetricPattern11, pub vbytes: DollarsPattern, pub weight: DollarsPattern, } -impl CatalogTree_Blocks { +impl MetricsTree_Blocks { pub fn new(client: Arc, base_path: String) -> Self { Self { blockhash: MetricPattern11::new(client.clone(), "blockhash".to_string()), - count: CatalogTree_Blocks_Count::new(client.clone(), format!("{base_path}_count")), - difficulty: CatalogTree_Blocks_Difficulty::new(client.clone(), format!("{base_path}_difficulty")), + count: MetricsTree_Blocks_Count::new(client.clone(), format!("{base_path}_count")), + difficulty: MetricsTree_Blocks_Difficulty::new( + client.clone(), + format!("{base_path}_difficulty"), + ), fullness: FullnessPattern::new(client.clone(), "block_fullness".to_string()), - halving: CatalogTree_Blocks_Halving::new(client.clone(), format!("{base_path}_halving")), - interval: CatalogTree_Blocks_Interval::new(client.clone(), format!("{base_path}_interval")), - mining: CatalogTree_Blocks_Mining::new(client.clone(), format!("{base_path}_mining")), - rewards: CatalogTree_Blocks_Rewards::new(client.clone(), format!("{base_path}_rewards")), - size: CatalogTree_Blocks_Size::new(client.clone(), format!("{base_path}_size")), - time: CatalogTree_Blocks_Time::new(client.clone(), format!("{base_path}_time")), + halving: MetricsTree_Blocks_Halving::new( + client.clone(), + format!("{base_path}_halving"), + ), + interval: MetricsTree_Blocks_Interval::new( + client.clone(), + format!("{base_path}_interval"), + ), + mining: MetricsTree_Blocks_Mining::new(client.clone(), format!("{base_path}_mining")), + rewards: MetricsTree_Blocks_Rewards::new( + client.clone(), + format!("{base_path}_rewards"), + ), + size: MetricsTree_Blocks_Size::new(client.clone(), format!("{base_path}_size")), + time: MetricsTree_Blocks_Time::new(client.clone(), format!("{base_path}_time")), total_size: MetricPattern11::new(client.clone(), "total_size".to_string()), vbytes: DollarsPattern::new(client.clone(), "block_vbytes".to_string()), weight: DollarsPattern::new(client.clone(), "block_weight_average".to_string()), @@ -3821,8 +4434,8 @@ impl CatalogTree_Blocks { } } -/// Catalog tree node. -pub struct CatalogTree_Blocks_Count { +/// Metrics tree node. +pub struct MetricsTree_Blocks_Count { pub _1m_block_count: MetricPattern1, pub _1m_start: MetricPattern11, pub _1w_block_count: MetricPattern1, @@ -3835,7 +4448,7 @@ pub struct CatalogTree_Blocks_Count { pub block_count_target: MetricPattern4, } -impl CatalogTree_Blocks_Count { +impl MetricsTree_Blocks_Count { pub fn new(client: Arc, base_path: String) -> Self { Self { _1m_block_count: MetricPattern1::new(client.clone(), "1m_block_count".to_string()), @@ -3847,13 +4460,16 @@ impl CatalogTree_Blocks_Count { _24h_block_count: MetricPattern1::new(client.clone(), "24h_block_count".to_string()), _24h_start: MetricPattern11::new(client.clone(), "24h_start".to_string()), block_count: BlockCountPattern::new(client.clone(), "block_count".to_string()), - block_count_target: MetricPattern4::new(client.clone(), "block_count_target".to_string()), + block_count_target: MetricPattern4::new( + client.clone(), + "block_count_target".to_string(), + ), } } } -/// Catalog tree node. -pub struct CatalogTree_Blocks_Difficulty { +/// Metrics tree node. +pub struct MetricsTree_Blocks_Difficulty { pub adjustment: MetricPattern1, pub as_hash: MetricPattern1, pub blocks_before_next_adjustment: MetricPattern1, @@ -3862,38 +4478,50 @@ pub struct CatalogTree_Blocks_Difficulty { pub raw: MetricPattern1, } -impl CatalogTree_Blocks_Difficulty { +impl MetricsTree_Blocks_Difficulty { pub fn new(client: Arc, base_path: String) -> Self { Self { adjustment: MetricPattern1::new(client.clone(), "difficulty_adjustment".to_string()), as_hash: MetricPattern1::new(client.clone(), "difficulty_as_hash".to_string()), - blocks_before_next_adjustment: MetricPattern1::new(client.clone(), "blocks_before_next_difficulty_adjustment".to_string()), - days_before_next_adjustment: MetricPattern1::new(client.clone(), "days_before_next_difficulty_adjustment".to_string()), + blocks_before_next_adjustment: MetricPattern1::new( + client.clone(), + "blocks_before_next_difficulty_adjustment".to_string(), + ), + days_before_next_adjustment: MetricPattern1::new( + client.clone(), + "days_before_next_difficulty_adjustment".to_string(), + ), epoch: MetricPattern4::new(client.clone(), "difficultyepoch".to_string()), raw: MetricPattern1::new(client.clone(), "difficulty".to_string()), } } } -/// Catalog tree node. -pub struct CatalogTree_Blocks_Halving { +/// Metrics tree node. +pub struct MetricsTree_Blocks_Halving { pub blocks_before_next_halving: MetricPattern1, pub days_before_next_halving: MetricPattern1, pub epoch: MetricPattern4, } -impl CatalogTree_Blocks_Halving { +impl MetricsTree_Blocks_Halving { pub fn new(client: Arc, base_path: String) -> Self { Self { - blocks_before_next_halving: MetricPattern1::new(client.clone(), "blocks_before_next_halving".to_string()), - days_before_next_halving: MetricPattern1::new(client.clone(), "days_before_next_halving".to_string()), + blocks_before_next_halving: MetricPattern1::new( + client.clone(), + "blocks_before_next_halving".to_string(), + ), + days_before_next_halving: MetricPattern1::new( + client.clone(), + "days_before_next_halving".to_string(), + ), epoch: MetricPattern4::new(client.clone(), "halvingepoch".to_string()), } } } -/// Catalog tree node. -pub struct CatalogTree_Blocks_Interval { +/// Metrics tree node. +pub struct MetricsTree_Blocks_Interval { pub average: MetricPattern2, pub base: MetricPattern11, pub max: MetricPattern2, @@ -3905,7 +4533,7 @@ pub struct CatalogTree_Blocks_Interval { pub pct90: MetricPattern6, } -impl CatalogTree_Blocks_Interval { +impl MetricsTree_Blocks_Interval { pub fn new(client: Arc, base_path: String) -> Self { Self { average: MetricPattern2::new(client.clone(), "block_interval_average".to_string()), @@ -3921,8 +4549,8 @@ impl CatalogTree_Blocks_Interval { } } -/// Catalog tree node. -pub struct CatalogTree_Blocks_Mining { +/// Metrics tree node. +pub struct MetricsTree_Blocks_Mining { pub hash_price_phs: MetricPattern1, pub hash_price_phs_min: MetricPattern1, pub hash_price_rebound: MetricPattern1, @@ -3940,31 +4568,49 @@ pub struct CatalogTree_Blocks_Mining { pub hash_value_ths_min: MetricPattern1, } -impl CatalogTree_Blocks_Mining { +impl MetricsTree_Blocks_Mining { pub fn new(client: Arc, base_path: String) -> Self { Self { hash_price_phs: MetricPattern1::new(client.clone(), "hash_price_phs".to_string()), - hash_price_phs_min: MetricPattern1::new(client.clone(), "hash_price_phs_min".to_string()), - hash_price_rebound: MetricPattern1::new(client.clone(), "hash_price_rebound".to_string()), + hash_price_phs_min: MetricPattern1::new( + client.clone(), + "hash_price_phs_min".to_string(), + ), + hash_price_rebound: MetricPattern1::new( + client.clone(), + "hash_price_rebound".to_string(), + ), hash_price_ths: MetricPattern1::new(client.clone(), "hash_price_ths".to_string()), - hash_price_ths_min: MetricPattern1::new(client.clone(), "hash_price_ths_min".to_string()), + hash_price_ths_min: MetricPattern1::new( + client.clone(), + "hash_price_ths_min".to_string(), + ), hash_rate: MetricPattern1::new(client.clone(), "hash_rate".to_string()), hash_rate_1m_sma: MetricPattern4::new(client.clone(), "hash_rate_1m_sma".to_string()), hash_rate_1w_sma: MetricPattern4::new(client.clone(), "hash_rate_1w_sma".to_string()), hash_rate_1y_sma: MetricPattern4::new(client.clone(), "hash_rate_1y_sma".to_string()), hash_rate_2m_sma: MetricPattern4::new(client.clone(), "hash_rate_2m_sma".to_string()), hash_value_phs: MetricPattern1::new(client.clone(), "hash_value_phs".to_string()), - hash_value_phs_min: MetricPattern1::new(client.clone(), "hash_value_phs_min".to_string()), - hash_value_rebound: MetricPattern1::new(client.clone(), "hash_value_rebound".to_string()), + hash_value_phs_min: MetricPattern1::new( + client.clone(), + "hash_value_phs_min".to_string(), + ), + hash_value_rebound: MetricPattern1::new( + client.clone(), + "hash_value_rebound".to_string(), + ), hash_value_ths: MetricPattern1::new(client.clone(), "hash_value_ths".to_string()), - hash_value_ths_min: MetricPattern1::new(client.clone(), "hash_value_ths_min".to_string()), + hash_value_ths_min: MetricPattern1::new( + client.clone(), + "hash_value_ths_min".to_string(), + ), } } } -/// Catalog tree node. -pub struct CatalogTree_Blocks_Rewards { - pub _24h_coinbase_sum: CatalogTree_Blocks_Rewards_24hCoinbaseSum, +/// Metrics tree node. +pub struct MetricsTree_Blocks_Rewards { + pub _24h_coinbase_sum: MetricsTree_Blocks_Rewards_24hCoinbaseSum, pub coinbase: CoinbasePattern, pub fee_dominance: MetricPattern6, pub subsidy: CoinbasePattern, @@ -3973,28 +4619,37 @@ pub struct CatalogTree_Blocks_Rewards { pub unclaimed_rewards: UnclaimedRewardsPattern, } -impl CatalogTree_Blocks_Rewards { +impl MetricsTree_Blocks_Rewards { pub fn new(client: Arc, base_path: String) -> Self { Self { - _24h_coinbase_sum: CatalogTree_Blocks_Rewards_24hCoinbaseSum::new(client.clone(), format!("{base_path}__24h_coinbase_sum")), + _24h_coinbase_sum: MetricsTree_Blocks_Rewards_24hCoinbaseSum::new( + client.clone(), + format!("{base_path}__24h_coinbase_sum"), + ), coinbase: CoinbasePattern::new(client.clone(), "coinbase".to_string()), fee_dominance: MetricPattern6::new(client.clone(), "fee_dominance".to_string()), subsidy: CoinbasePattern::new(client.clone(), "subsidy".to_string()), subsidy_dominance: MetricPattern6::new(client.clone(), "subsidy_dominance".to_string()), - subsidy_usd_1y_sma: MetricPattern4::new(client.clone(), "subsidy_usd_1y_sma".to_string()), - unclaimed_rewards: UnclaimedRewardsPattern::new(client.clone(), "unclaimed_rewards".to_string()), + subsidy_usd_1y_sma: MetricPattern4::new( + client.clone(), + "subsidy_usd_1y_sma".to_string(), + ), + unclaimed_rewards: UnclaimedRewardsPattern::new( + client.clone(), + "unclaimed_rewards".to_string(), + ), } } } -/// Catalog tree node. -pub struct CatalogTree_Blocks_Rewards_24hCoinbaseSum { +/// Metrics tree node. +pub struct MetricsTree_Blocks_Rewards_24hCoinbaseSum { pub bitcoin: MetricPattern11, pub dollars: MetricPattern11, pub sats: MetricPattern11, } -impl CatalogTree_Blocks_Rewards_24hCoinbaseSum { +impl MetricsTree_Blocks_Rewards_24hCoinbaseSum { pub fn new(client: Arc, base_path: String) -> Self { Self { bitcoin: MetricPattern11::new(client.clone(), "24h_coinbase_sum_btc".to_string()), @@ -4004,8 +4659,8 @@ impl CatalogTree_Blocks_Rewards_24hCoinbaseSum { } } -/// Catalog tree node. -pub struct CatalogTree_Blocks_Size { +/// Metrics tree node. +pub struct MetricsTree_Blocks_Size { pub average: MetricPattern2, pub cumulative: MetricPattern1, pub max: MetricPattern2, @@ -4018,7 +4673,7 @@ pub struct CatalogTree_Blocks_Size { pub sum: MetricPattern2, } -impl CatalogTree_Blocks_Size { +impl MetricsTree_Blocks_Size { pub fn new(client: Arc, base_path: String) -> Self { Self { average: MetricPattern2::new(client.clone(), "block_size_average".to_string()), @@ -4035,15 +4690,15 @@ impl CatalogTree_Blocks_Size { } } -/// Catalog tree node. -pub struct CatalogTree_Blocks_Time { +/// Metrics tree node. +pub struct MetricsTree_Blocks_Time { pub date: MetricPattern11, pub date_fixed: MetricPattern11, pub timestamp: MetricPattern1, pub timestamp_fixed: MetricPattern11, } -impl CatalogTree_Blocks_Time { +impl MetricsTree_Blocks_Time { pub fn new(client: Arc, base_path: String) -> Self { Self { date: MetricPattern11::new(client.clone(), "date".to_string()), @@ -4054,31 +4709,40 @@ impl CatalogTree_Blocks_Time { } } -/// Catalog tree node. -pub struct CatalogTree_Cointime { - pub activity: CatalogTree_Cointime_Activity, - pub adjusted: CatalogTree_Cointime_Adjusted, - pub cap: CatalogTree_Cointime_Cap, - pub pricing: CatalogTree_Cointime_Pricing, - pub supply: CatalogTree_Cointime_Supply, - pub value: CatalogTree_Cointime_Value, +/// Metrics tree node. +pub struct MetricsTree_Cointime { + pub activity: MetricsTree_Cointime_Activity, + pub adjusted: MetricsTree_Cointime_Adjusted, + pub cap: MetricsTree_Cointime_Cap, + pub pricing: MetricsTree_Cointime_Pricing, + pub supply: MetricsTree_Cointime_Supply, + pub value: MetricsTree_Cointime_Value, } -impl CatalogTree_Cointime { +impl MetricsTree_Cointime { pub fn new(client: Arc, base_path: String) -> Self { Self { - activity: CatalogTree_Cointime_Activity::new(client.clone(), format!("{base_path}_activity")), - adjusted: CatalogTree_Cointime_Adjusted::new(client.clone(), format!("{base_path}_adjusted")), - cap: CatalogTree_Cointime_Cap::new(client.clone(), format!("{base_path}_cap")), - pricing: CatalogTree_Cointime_Pricing::new(client.clone(), format!("{base_path}_pricing")), - supply: CatalogTree_Cointime_Supply::new(client.clone(), format!("{base_path}_supply")), - value: CatalogTree_Cointime_Value::new(client.clone(), format!("{base_path}_value")), + activity: MetricsTree_Cointime_Activity::new( + client.clone(), + format!("{base_path}_activity"), + ), + adjusted: MetricsTree_Cointime_Adjusted::new( + client.clone(), + format!("{base_path}_adjusted"), + ), + cap: MetricsTree_Cointime_Cap::new(client.clone(), format!("{base_path}_cap")), + pricing: MetricsTree_Cointime_Pricing::new( + client.clone(), + format!("{base_path}_pricing"), + ), + supply: MetricsTree_Cointime_Supply::new(client.clone(), format!("{base_path}_supply")), + value: MetricsTree_Cointime_Value::new(client.clone(), format!("{base_path}_value")), } } } -/// Catalog tree node. -pub struct CatalogTree_Cointime_Activity { +/// Metrics tree node. +pub struct MetricsTree_Cointime_Activity { pub activity_to_vaultedness_ratio: MetricPattern1, pub coinblocks_created: BlockCountPattern, pub coinblocks_stored: BlockCountPattern, @@ -4086,37 +4750,55 @@ pub struct CatalogTree_Cointime_Activity { pub vaultedness: MetricPattern1, } -impl CatalogTree_Cointime_Activity { +impl MetricsTree_Cointime_Activity { pub fn new(client: Arc, base_path: String) -> Self { Self { - activity_to_vaultedness_ratio: MetricPattern1::new(client.clone(), "activity_to_vaultedness_ratio".to_string()), - coinblocks_created: BlockCountPattern::new(client.clone(), "coinblocks_created".to_string()), - coinblocks_stored: BlockCountPattern::new(client.clone(), "coinblocks_stored".to_string()), + activity_to_vaultedness_ratio: MetricPattern1::new( + client.clone(), + "activity_to_vaultedness_ratio".to_string(), + ), + coinblocks_created: BlockCountPattern::new( + client.clone(), + "coinblocks_created".to_string(), + ), + coinblocks_stored: BlockCountPattern::new( + client.clone(), + "coinblocks_stored".to_string(), + ), liveliness: MetricPattern1::new(client.clone(), "liveliness".to_string()), vaultedness: MetricPattern1::new(client.clone(), "vaultedness".to_string()), } } } -/// Catalog tree node. -pub struct CatalogTree_Cointime_Adjusted { +/// Metrics tree node. +pub struct MetricsTree_Cointime_Adjusted { pub cointime_adj_inflation_rate: MetricPattern4, pub cointime_adj_tx_btc_velocity: MetricPattern4, pub cointime_adj_tx_usd_velocity: MetricPattern4, } -impl CatalogTree_Cointime_Adjusted { +impl MetricsTree_Cointime_Adjusted { pub fn new(client: Arc, base_path: String) -> Self { Self { - cointime_adj_inflation_rate: MetricPattern4::new(client.clone(), "cointime_adj_inflation_rate".to_string()), - cointime_adj_tx_btc_velocity: MetricPattern4::new(client.clone(), "cointime_adj_tx_btc_velocity".to_string()), - cointime_adj_tx_usd_velocity: MetricPattern4::new(client.clone(), "cointime_adj_tx_usd_velocity".to_string()), + cointime_adj_inflation_rate: MetricPattern4::new( + client.clone(), + "cointime_adj_inflation_rate".to_string(), + ), + cointime_adj_tx_btc_velocity: MetricPattern4::new( + client.clone(), + "cointime_adj_tx_btc_velocity".to_string(), + ), + cointime_adj_tx_usd_velocity: MetricPattern4::new( + client.clone(), + "cointime_adj_tx_usd_velocity".to_string(), + ), } } } -/// Catalog tree node. -pub struct CatalogTree_Cointime_Cap { +/// Metrics tree node. +pub struct MetricsTree_Cointime_Cap { pub active_cap: MetricPattern1, pub cointime_cap: MetricPattern1, pub investor_cap: MetricPattern1, @@ -4124,7 +4806,7 @@ pub struct CatalogTree_Cointime_Cap { pub vaulted_cap: MetricPattern1, } -impl CatalogTree_Cointime_Cap { +impl MetricsTree_Cointime_Cap { pub fn new(client: Arc, base_path: String) -> Self { Self { active_cap: MetricPattern1::new(client.clone(), "active_cap".to_string()), @@ -4136,8 +4818,8 @@ impl CatalogTree_Cointime_Cap { } } -/// Catalog tree node. -pub struct CatalogTree_Cointime_Pricing { +/// Metrics tree node. +pub struct MetricsTree_Cointime_Pricing { pub active_price: MetricPattern1, pub active_price_ratio: ActivePriceRatioPattern, pub cointime_price: MetricPattern1, @@ -4148,28 +4830,40 @@ pub struct CatalogTree_Cointime_Pricing { pub vaulted_price_ratio: ActivePriceRatioPattern, } -impl CatalogTree_Cointime_Pricing { +impl MetricsTree_Cointime_Pricing { pub fn new(client: Arc, base_path: String) -> Self { Self { active_price: MetricPattern1::new(client.clone(), "active_price".to_string()), - active_price_ratio: ActivePriceRatioPattern::new(client.clone(), "active_price_ratio".to_string()), + active_price_ratio: ActivePriceRatioPattern::new( + client.clone(), + "active_price_ratio".to_string(), + ), cointime_price: MetricPattern1::new(client.clone(), "cointime_price".to_string()), - cointime_price_ratio: ActivePriceRatioPattern::new(client.clone(), "cointime_price_ratio".to_string()), + cointime_price_ratio: ActivePriceRatioPattern::new( + client.clone(), + "cointime_price_ratio".to_string(), + ), true_market_mean: MetricPattern1::new(client.clone(), "true_market_mean".to_string()), - true_market_mean_ratio: ActivePriceRatioPattern::new(client.clone(), "true_market_mean_ratio".to_string()), + true_market_mean_ratio: ActivePriceRatioPattern::new( + client.clone(), + "true_market_mean_ratio".to_string(), + ), vaulted_price: MetricPattern1::new(client.clone(), "vaulted_price".to_string()), - vaulted_price_ratio: ActivePriceRatioPattern::new(client.clone(), "vaulted_price_ratio".to_string()), + vaulted_price_ratio: ActivePriceRatioPattern::new( + client.clone(), + "vaulted_price_ratio".to_string(), + ), } } } -/// Catalog tree node. -pub struct CatalogTree_Cointime_Supply { +/// Metrics tree node. +pub struct MetricsTree_Cointime_Supply { pub active_supply: ActiveSupplyPattern, pub vaulted_supply: ActiveSupplyPattern, } -impl CatalogTree_Cointime_Supply { +impl MetricsTree_Cointime_Supply { pub fn new(client: Arc, base_path: String) -> Self { Self { active_supply: ActiveSupplyPattern::new(client.clone(), "active_supply".to_string()), @@ -4178,25 +4872,34 @@ impl CatalogTree_Cointime_Supply { } } -/// Catalog tree node. -pub struct CatalogTree_Cointime_Value { +/// Metrics tree node. +pub struct MetricsTree_Cointime_Value { pub cointime_value_created: BlockCountPattern, pub cointime_value_destroyed: BlockCountPattern, pub cointime_value_stored: BlockCountPattern, } -impl CatalogTree_Cointime_Value { +impl MetricsTree_Cointime_Value { pub fn new(client: Arc, base_path: String) -> Self { Self { - cointime_value_created: BlockCountPattern::new(client.clone(), "cointime_value_created".to_string()), - cointime_value_destroyed: BlockCountPattern::new(client.clone(), "cointime_value_destroyed".to_string()), - cointime_value_stored: BlockCountPattern::new(client.clone(), "cointime_value_stored".to_string()), + cointime_value_created: BlockCountPattern::new( + client.clone(), + "cointime_value_created".to_string(), + ), + cointime_value_destroyed: BlockCountPattern::new( + client.clone(), + "cointime_value_destroyed".to_string(), + ), + cointime_value_stored: BlockCountPattern::new( + client.clone(), + "cointime_value_stored".to_string(), + ), } } } -/// Catalog tree node. -pub struct CatalogTree_Constants { +/// Metrics tree node. +pub struct MetricsTree_Constants { pub constant_0: MetricPattern1, pub constant_1: MetricPattern1, pub constant_100: MetricPattern1, @@ -4217,7 +4920,7 @@ pub struct CatalogTree_Constants { pub constant_minus_4: MetricPattern1, } -impl CatalogTree_Constants { +impl MetricsTree_Constants { pub fn new(client: Arc, base_path: String) -> Self { Self { constant_0: MetricPattern1::new(client.clone(), "constant_0".to_string()), @@ -4242,37 +4945,61 @@ impl CatalogTree_Constants { } } -/// Catalog tree node. -pub struct CatalogTree_Distribution { - pub addr_count: CatalogTree_Distribution_AddrCount, - pub address_cohorts: CatalogTree_Distribution_AddressCohorts, - pub addresses_data: CatalogTree_Distribution_AddressesData, - pub any_address_indexes: CatalogTree_Distribution_AnyAddressIndexes, +/// Metrics tree node. +pub struct MetricsTree_Distribution { + pub addr_count: MetricsTree_Distribution_AddrCount, + pub address_cohorts: MetricsTree_Distribution_AddressCohorts, + pub addresses_data: MetricsTree_Distribution_AddressesData, + pub any_address_indexes: MetricsTree_Distribution_AnyAddressIndexes, pub chain_state: MetricPattern11, - pub empty_addr_count: CatalogTree_Distribution_EmptyAddrCount, + pub empty_addr_count: MetricsTree_Distribution_EmptyAddrCount, pub emptyaddressindex: MetricPattern32, pub loadedaddressindex: MetricPattern31, - pub utxo_cohorts: CatalogTree_Distribution_UtxoCohorts, + pub utxo_cohorts: MetricsTree_Distribution_UtxoCohorts, } -impl CatalogTree_Distribution { +impl MetricsTree_Distribution { pub fn new(client: Arc, base_path: String) -> Self { Self { - addr_count: CatalogTree_Distribution_AddrCount::new(client.clone(), format!("{base_path}_addr_count")), - address_cohorts: CatalogTree_Distribution_AddressCohorts::new(client.clone(), format!("{base_path}_address_cohorts")), - addresses_data: CatalogTree_Distribution_AddressesData::new(client.clone(), format!("{base_path}_addresses_data")), - any_address_indexes: CatalogTree_Distribution_AnyAddressIndexes::new(client.clone(), format!("{base_path}_any_address_indexes")), + addr_count: MetricsTree_Distribution_AddrCount::new( + client.clone(), + format!("{base_path}_addr_count"), + ), + address_cohorts: MetricsTree_Distribution_AddressCohorts::new( + client.clone(), + format!("{base_path}_address_cohorts"), + ), + addresses_data: MetricsTree_Distribution_AddressesData::new( + client.clone(), + format!("{base_path}_addresses_data"), + ), + any_address_indexes: MetricsTree_Distribution_AnyAddressIndexes::new( + client.clone(), + format!("{base_path}_any_address_indexes"), + ), chain_state: MetricPattern11::new(client.clone(), "chain".to_string()), - empty_addr_count: CatalogTree_Distribution_EmptyAddrCount::new(client.clone(), format!("{base_path}_empty_addr_count")), - emptyaddressindex: MetricPattern32::new(client.clone(), "emptyaddressindex".to_string()), - loadedaddressindex: MetricPattern31::new(client.clone(), "loadedaddressindex".to_string()), - utxo_cohorts: CatalogTree_Distribution_UtxoCohorts::new(client.clone(), format!("{base_path}_utxo_cohorts")), + empty_addr_count: MetricsTree_Distribution_EmptyAddrCount::new( + client.clone(), + format!("{base_path}_empty_addr_count"), + ), + emptyaddressindex: MetricPattern32::new( + client.clone(), + "emptyaddressindex".to_string(), + ), + loadedaddressindex: MetricPattern31::new( + client.clone(), + "loadedaddressindex".to_string(), + ), + utxo_cohorts: MetricsTree_Distribution_UtxoCohorts::new( + client.clone(), + format!("{base_path}_utxo_cohorts"), + ), } } } -/// Catalog tree node. -pub struct CatalogTree_Distribution_AddrCount { +/// Metrics tree node. +pub struct MetricsTree_Distribution_AddrCount { pub all: MetricPattern1, pub p2a: MetricPattern1, pub p2pk33: MetricPattern1, @@ -4284,7 +5011,7 @@ pub struct CatalogTree_Distribution_AddrCount { pub p2wsh: MetricPattern1, } -impl CatalogTree_Distribution_AddrCount { +impl MetricsTree_Distribution_AddrCount { pub fn new(client: Arc, base_path: String) -> Self { Self { all: MetricPattern1::new(client.clone(), "addr_count".to_string()), @@ -4300,25 +5027,34 @@ impl CatalogTree_Distribution_AddrCount { } } -/// Catalog tree node. -pub struct CatalogTree_Distribution_AddressCohorts { - pub amount_range: CatalogTree_Distribution_AddressCohorts_AmountRange, - pub ge_amount: CatalogTree_Distribution_AddressCohorts_GeAmount, - pub lt_amount: CatalogTree_Distribution_AddressCohorts_LtAmount, +/// Metrics tree node. +pub struct MetricsTree_Distribution_AddressCohorts { + pub amount_range: MetricsTree_Distribution_AddressCohorts_AmountRange, + pub ge_amount: MetricsTree_Distribution_AddressCohorts_GeAmount, + pub lt_amount: MetricsTree_Distribution_AddressCohorts_LtAmount, } -impl CatalogTree_Distribution_AddressCohorts { +impl MetricsTree_Distribution_AddressCohorts { pub fn new(client: Arc, base_path: String) -> Self { Self { - amount_range: CatalogTree_Distribution_AddressCohorts_AmountRange::new(client.clone(), format!("{base_path}_amount_range")), - ge_amount: CatalogTree_Distribution_AddressCohorts_GeAmount::new(client.clone(), format!("{base_path}_ge_amount")), - lt_amount: CatalogTree_Distribution_AddressCohorts_LtAmount::new(client.clone(), format!("{base_path}_lt_amount")), + amount_range: MetricsTree_Distribution_AddressCohorts_AmountRange::new( + client.clone(), + format!("{base_path}_amount_range"), + ), + ge_amount: MetricsTree_Distribution_AddressCohorts_GeAmount::new( + client.clone(), + format!("{base_path}_ge_amount"), + ), + lt_amount: MetricsTree_Distribution_AddressCohorts_LtAmount::new( + client.clone(), + format!("{base_path}_lt_amount"), + ), } } } -/// Catalog tree node. -pub struct CatalogTree_Distribution_AddressCohorts_AmountRange { +/// Metrics tree node. +pub struct MetricsTree_Distribution_AddressCohorts_AmountRange { pub _0sats: _0satsPattern, pub _100btc_to_1k_btc: _0satsPattern, pub _100k_btc_or_more: _0satsPattern, @@ -4336,30 +5072,72 @@ pub struct CatalogTree_Distribution_AddressCohorts_AmountRange { pub _1sat_to_10sats: _0satsPattern, } -impl CatalogTree_Distribution_AddressCohorts_AmountRange { +impl MetricsTree_Distribution_AddressCohorts_AmountRange { pub fn new(client: Arc, base_path: String) -> Self { Self { _0sats: _0satsPattern::new(client.clone(), "addrs_with_0sats".to_string()), - _100btc_to_1k_btc: _0satsPattern::new(client.clone(), "addrs_above_100btc_under_1k_btc".to_string()), - _100k_btc_or_more: _0satsPattern::new(client.clone(), "addrs_above_100k_btc".to_string()), - _100k_sats_to_1m_sats: _0satsPattern::new(client.clone(), "addrs_above_100k_sats_under_1m_sats".to_string()), - _100sats_to_1k_sats: _0satsPattern::new(client.clone(), "addrs_above_100sats_under_1k_sats".to_string()), - _10btc_to_100btc: _0satsPattern::new(client.clone(), "addrs_above_10btc_under_100btc".to_string()), - _10k_btc_to_100k_btc: _0satsPattern::new(client.clone(), "addrs_above_10k_btc_under_100k_btc".to_string()), - _10k_sats_to_100k_sats: _0satsPattern::new(client.clone(), "addrs_above_10k_sats_under_100k_sats".to_string()), - _10m_sats_to_1btc: _0satsPattern::new(client.clone(), "addrs_above_10m_sats_under_1btc".to_string()), - _10sats_to_100sats: _0satsPattern::new(client.clone(), "addrs_above_10sats_under_100sats".to_string()), - _1btc_to_10btc: _0satsPattern::new(client.clone(), "addrs_above_1btc_under_10btc".to_string()), - _1k_btc_to_10k_btc: _0satsPattern::new(client.clone(), "addrs_above_1k_btc_under_10k_btc".to_string()), - _1k_sats_to_10k_sats: _0satsPattern::new(client.clone(), "addrs_above_1k_sats_under_10k_sats".to_string()), - _1m_sats_to_10m_sats: _0satsPattern::new(client.clone(), "addrs_above_1m_sats_under_10m_sats".to_string()), - _1sat_to_10sats: _0satsPattern::new(client.clone(), "addrs_above_1sat_under_10sats".to_string()), + _100btc_to_1k_btc: _0satsPattern::new( + client.clone(), + "addrs_above_100btc_under_1k_btc".to_string(), + ), + _100k_btc_or_more: _0satsPattern::new( + client.clone(), + "addrs_above_100k_btc".to_string(), + ), + _100k_sats_to_1m_sats: _0satsPattern::new( + client.clone(), + "addrs_above_100k_sats_under_1m_sats".to_string(), + ), + _100sats_to_1k_sats: _0satsPattern::new( + client.clone(), + "addrs_above_100sats_under_1k_sats".to_string(), + ), + _10btc_to_100btc: _0satsPattern::new( + client.clone(), + "addrs_above_10btc_under_100btc".to_string(), + ), + _10k_btc_to_100k_btc: _0satsPattern::new( + client.clone(), + "addrs_above_10k_btc_under_100k_btc".to_string(), + ), + _10k_sats_to_100k_sats: _0satsPattern::new( + client.clone(), + "addrs_above_10k_sats_under_100k_sats".to_string(), + ), + _10m_sats_to_1btc: _0satsPattern::new( + client.clone(), + "addrs_above_10m_sats_under_1btc".to_string(), + ), + _10sats_to_100sats: _0satsPattern::new( + client.clone(), + "addrs_above_10sats_under_100sats".to_string(), + ), + _1btc_to_10btc: _0satsPattern::new( + client.clone(), + "addrs_above_1btc_under_10btc".to_string(), + ), + _1k_btc_to_10k_btc: _0satsPattern::new( + client.clone(), + "addrs_above_1k_btc_under_10k_btc".to_string(), + ), + _1k_sats_to_10k_sats: _0satsPattern::new( + client.clone(), + "addrs_above_1k_sats_under_10k_sats".to_string(), + ), + _1m_sats_to_10m_sats: _0satsPattern::new( + client.clone(), + "addrs_above_1m_sats_under_10m_sats".to_string(), + ), + _1sat_to_10sats: _0satsPattern::new( + client.clone(), + "addrs_above_1sat_under_10sats".to_string(), + ), } } } -/// Catalog tree node. -pub struct CatalogTree_Distribution_AddressCohorts_GeAmount { +/// Metrics tree node. +pub struct MetricsTree_Distribution_AddressCohorts_GeAmount { pub _100btc: _0satsPattern, pub _100k_sats: _0satsPattern, pub _100sats: _0satsPattern, @@ -4375,7 +5153,7 @@ pub struct CatalogTree_Distribution_AddressCohorts_GeAmount { pub _1sat: _0satsPattern, } -impl CatalogTree_Distribution_AddressCohorts_GeAmount { +impl MetricsTree_Distribution_AddressCohorts_GeAmount { pub fn new(client: Arc, base_path: String) -> Self { Self { _100btc: _0satsPattern::new(client.clone(), "addrs_above_100btc".to_string()), @@ -4395,8 +5173,8 @@ impl CatalogTree_Distribution_AddressCohorts_GeAmount { } } -/// Catalog tree node. -pub struct CatalogTree_Distribution_AddressCohorts_LtAmount { +/// Metrics tree node. +pub struct MetricsTree_Distribution_AddressCohorts_LtAmount { pub _100btc: _0satsPattern, pub _100k_btc: _0satsPattern, pub _100k_sats: _0satsPattern, @@ -4412,7 +5190,7 @@ pub struct CatalogTree_Distribution_AddressCohorts_LtAmount { pub _1m_sats: _0satsPattern, } -impl CatalogTree_Distribution_AddressCohorts_LtAmount { +impl MetricsTree_Distribution_AddressCohorts_LtAmount { pub fn new(client: Arc, base_path: String) -> Self { Self { _100btc: _0satsPattern::new(client.clone(), "addrs_under_100btc".to_string()), @@ -4432,13 +5210,13 @@ impl CatalogTree_Distribution_AddressCohorts_LtAmount { } } -/// Catalog tree node. -pub struct CatalogTree_Distribution_AddressesData { +/// Metrics tree node. +pub struct MetricsTree_Distribution_AddressesData { pub empty: MetricPattern32, pub loaded: MetricPattern31, } -impl CatalogTree_Distribution_AddressesData { +impl MetricsTree_Distribution_AddressesData { pub fn new(client: Arc, base_path: String) -> Self { Self { empty: MetricPattern32::new(client.clone(), "emptyaddressdata".to_string()), @@ -4447,8 +5225,8 @@ impl CatalogTree_Distribution_AddressesData { } } -/// Catalog tree node. -pub struct CatalogTree_Distribution_AnyAddressIndexes { +/// Metrics tree node. +pub struct MetricsTree_Distribution_AnyAddressIndexes { pub p2a: MetricPattern16, pub p2pk33: MetricPattern18, pub p2pk65: MetricPattern19, @@ -4459,7 +5237,7 @@ pub struct CatalogTree_Distribution_AnyAddressIndexes { pub p2wsh: MetricPattern24, } -impl CatalogTree_Distribution_AnyAddressIndexes { +impl MetricsTree_Distribution_AnyAddressIndexes { pub fn new(client: Arc, base_path: String) -> Self { Self { p2a: MetricPattern16::new(client.clone(), "anyaddressindex".to_string()), @@ -4474,8 +5252,8 @@ impl CatalogTree_Distribution_AnyAddressIndexes { } } -/// Catalog tree node. -pub struct CatalogTree_Distribution_EmptyAddrCount { +/// Metrics tree node. +pub struct MetricsTree_Distribution_EmptyAddrCount { pub all: MetricPattern1, pub p2a: MetricPattern1, pub p2pk33: MetricPattern1, @@ -4487,7 +5265,7 @@ pub struct CatalogTree_Distribution_EmptyAddrCount { pub p2wsh: MetricPattern1, } -impl CatalogTree_Distribution_EmptyAddrCount { +impl MetricsTree_Distribution_EmptyAddrCount { pub fn new(client: Arc, base_path: String) -> Self { Self { all: MetricPattern1::new(client.clone(), "empty_addr_count".to_string()), @@ -4503,41 +5281,74 @@ impl CatalogTree_Distribution_EmptyAddrCount { } } -/// Catalog tree node. -pub struct CatalogTree_Distribution_UtxoCohorts { - pub age_range: CatalogTree_Distribution_UtxoCohorts_AgeRange, - pub all: CatalogTree_Distribution_UtxoCohorts_All, - pub amount_range: CatalogTree_Distribution_UtxoCohorts_AmountRange, - pub epoch: CatalogTree_Distribution_UtxoCohorts_Epoch, - pub ge_amount: CatalogTree_Distribution_UtxoCohorts_GeAmount, - pub lt_amount: CatalogTree_Distribution_UtxoCohorts_LtAmount, - pub max_age: CatalogTree_Distribution_UtxoCohorts_MaxAge, - pub min_age: CatalogTree_Distribution_UtxoCohorts_MinAge, - pub term: CatalogTree_Distribution_UtxoCohorts_Term, - pub type_: CatalogTree_Distribution_UtxoCohorts_Type, - pub year: CatalogTree_Distribution_UtxoCohorts_Year, +/// Metrics tree node. +pub struct MetricsTree_Distribution_UtxoCohorts { + pub age_range: MetricsTree_Distribution_UtxoCohorts_AgeRange, + pub all: MetricsTree_Distribution_UtxoCohorts_All, + pub amount_range: MetricsTree_Distribution_UtxoCohorts_AmountRange, + pub epoch: MetricsTree_Distribution_UtxoCohorts_Epoch, + pub ge_amount: MetricsTree_Distribution_UtxoCohorts_GeAmount, + pub lt_amount: MetricsTree_Distribution_UtxoCohorts_LtAmount, + pub max_age: MetricsTree_Distribution_UtxoCohorts_MaxAge, + pub min_age: MetricsTree_Distribution_UtxoCohorts_MinAge, + pub term: MetricsTree_Distribution_UtxoCohorts_Term, + pub type_: MetricsTree_Distribution_UtxoCohorts_Type, + pub year: MetricsTree_Distribution_UtxoCohorts_Year, } -impl CatalogTree_Distribution_UtxoCohorts { +impl MetricsTree_Distribution_UtxoCohorts { pub fn new(client: Arc, base_path: String) -> Self { Self { - age_range: CatalogTree_Distribution_UtxoCohorts_AgeRange::new(client.clone(), format!("{base_path}_age_range")), - all: CatalogTree_Distribution_UtxoCohorts_All::new(client.clone(), format!("{base_path}_all")), - amount_range: CatalogTree_Distribution_UtxoCohorts_AmountRange::new(client.clone(), format!("{base_path}_amount_range")), - epoch: CatalogTree_Distribution_UtxoCohorts_Epoch::new(client.clone(), format!("{base_path}_epoch")), - ge_amount: CatalogTree_Distribution_UtxoCohorts_GeAmount::new(client.clone(), format!("{base_path}_ge_amount")), - lt_amount: CatalogTree_Distribution_UtxoCohorts_LtAmount::new(client.clone(), format!("{base_path}_lt_amount")), - max_age: CatalogTree_Distribution_UtxoCohorts_MaxAge::new(client.clone(), format!("{base_path}_max_age")), - min_age: CatalogTree_Distribution_UtxoCohorts_MinAge::new(client.clone(), format!("{base_path}_min_age")), - term: CatalogTree_Distribution_UtxoCohorts_Term::new(client.clone(), format!("{base_path}_term")), - type_: CatalogTree_Distribution_UtxoCohorts_Type::new(client.clone(), format!("{base_path}_type_")), - year: CatalogTree_Distribution_UtxoCohorts_Year::new(client.clone(), format!("{base_path}_year")), + age_range: MetricsTree_Distribution_UtxoCohorts_AgeRange::new( + client.clone(), + format!("{base_path}_age_range"), + ), + all: MetricsTree_Distribution_UtxoCohorts_All::new( + client.clone(), + format!("{base_path}_all"), + ), + amount_range: MetricsTree_Distribution_UtxoCohorts_AmountRange::new( + client.clone(), + format!("{base_path}_amount_range"), + ), + epoch: MetricsTree_Distribution_UtxoCohorts_Epoch::new( + client.clone(), + format!("{base_path}_epoch"), + ), + ge_amount: MetricsTree_Distribution_UtxoCohorts_GeAmount::new( + client.clone(), + format!("{base_path}_ge_amount"), + ), + lt_amount: MetricsTree_Distribution_UtxoCohorts_LtAmount::new( + client.clone(), + format!("{base_path}_lt_amount"), + ), + max_age: MetricsTree_Distribution_UtxoCohorts_MaxAge::new( + client.clone(), + format!("{base_path}_max_age"), + ), + min_age: MetricsTree_Distribution_UtxoCohorts_MinAge::new( + client.clone(), + format!("{base_path}_min_age"), + ), + term: MetricsTree_Distribution_UtxoCohorts_Term::new( + client.clone(), + format!("{base_path}_term"), + ), + type_: MetricsTree_Distribution_UtxoCohorts_Type::new( + client.clone(), + format!("{base_path}_type_"), + ), + year: MetricsTree_Distribution_UtxoCohorts_Year::new( + client.clone(), + format!("{base_path}_year"), + ), } } } -/// Catalog tree node. -pub struct CatalogTree_Distribution_UtxoCohorts_AgeRange { +/// Metrics tree node. +pub struct MetricsTree_Distribution_UtxoCohorts_AgeRange { pub _10y_to_12y: _10yTo12yPattern, pub _12y_to_15y: _10yTo12yPattern, pub _1d_to_1w: _10yTo12yPattern, @@ -4561,67 +5372,130 @@ pub struct CatalogTree_Distribution_UtxoCohorts_AgeRange { pub up_to_1h: _10yTo12yPattern, } -impl CatalogTree_Distribution_UtxoCohorts_AgeRange { +impl MetricsTree_Distribution_UtxoCohorts_AgeRange { pub fn new(client: Arc, base_path: String) -> Self { Self { - _10y_to_12y: _10yTo12yPattern::new(client.clone(), "utxos_at_least_10y_up_to_12y_old".to_string()), - _12y_to_15y: _10yTo12yPattern::new(client.clone(), "utxos_at_least_12y_up_to_15y_old".to_string()), - _1d_to_1w: _10yTo12yPattern::new(client.clone(), "utxos_at_least_1d_up_to_1w_old".to_string()), - _1h_to_1d: _10yTo12yPattern::new(client.clone(), "utxos_at_least_1h_up_to_1d_old".to_string()), - _1m_to_2m: _10yTo12yPattern::new(client.clone(), "utxos_at_least_1m_up_to_2m_old".to_string()), - _1w_to_1m: _10yTo12yPattern::new(client.clone(), "utxos_at_least_1w_up_to_1m_old".to_string()), - _1y_to_2y: _10yTo12yPattern::new(client.clone(), "utxos_at_least_1y_up_to_2y_old".to_string()), - _2m_to_3m: _10yTo12yPattern::new(client.clone(), "utxos_at_least_2m_up_to_3m_old".to_string()), - _2y_to_3y: _10yTo12yPattern::new(client.clone(), "utxos_at_least_2y_up_to_3y_old".to_string()), - _3m_to_4m: _10yTo12yPattern::new(client.clone(), "utxos_at_least_3m_up_to_4m_old".to_string()), - _3y_to_4y: _10yTo12yPattern::new(client.clone(), "utxos_at_least_3y_up_to_4y_old".to_string()), - _4m_to_5m: _10yTo12yPattern::new(client.clone(), "utxos_at_least_4m_up_to_5m_old".to_string()), - _4y_to_5y: _10yTo12yPattern::new(client.clone(), "utxos_at_least_4y_up_to_5y_old".to_string()), - _5m_to_6m: _10yTo12yPattern::new(client.clone(), "utxos_at_least_5m_up_to_6m_old".to_string()), - _5y_to_6y: _10yTo12yPattern::new(client.clone(), "utxos_at_least_5y_up_to_6y_old".to_string()), - _6m_to_1y: _10yTo12yPattern::new(client.clone(), "utxos_at_least_6m_up_to_1y_old".to_string()), - _6y_to_7y: _10yTo12yPattern::new(client.clone(), "utxos_at_least_6y_up_to_7y_old".to_string()), - _7y_to_8y: _10yTo12yPattern::new(client.clone(), "utxos_at_least_7y_up_to_8y_old".to_string()), - _8y_to_10y: _10yTo12yPattern::new(client.clone(), "utxos_at_least_8y_up_to_10y_old".to_string()), + _10y_to_12y: _10yTo12yPattern::new( + client.clone(), + "utxos_at_least_10y_up_to_12y_old".to_string(), + ), + _12y_to_15y: _10yTo12yPattern::new( + client.clone(), + "utxos_at_least_12y_up_to_15y_old".to_string(), + ), + _1d_to_1w: _10yTo12yPattern::new( + client.clone(), + "utxos_at_least_1d_up_to_1w_old".to_string(), + ), + _1h_to_1d: _10yTo12yPattern::new( + client.clone(), + "utxos_at_least_1h_up_to_1d_old".to_string(), + ), + _1m_to_2m: _10yTo12yPattern::new( + client.clone(), + "utxos_at_least_1m_up_to_2m_old".to_string(), + ), + _1w_to_1m: _10yTo12yPattern::new( + client.clone(), + "utxos_at_least_1w_up_to_1m_old".to_string(), + ), + _1y_to_2y: _10yTo12yPattern::new( + client.clone(), + "utxos_at_least_1y_up_to_2y_old".to_string(), + ), + _2m_to_3m: _10yTo12yPattern::new( + client.clone(), + "utxos_at_least_2m_up_to_3m_old".to_string(), + ), + _2y_to_3y: _10yTo12yPattern::new( + client.clone(), + "utxos_at_least_2y_up_to_3y_old".to_string(), + ), + _3m_to_4m: _10yTo12yPattern::new( + client.clone(), + "utxos_at_least_3m_up_to_4m_old".to_string(), + ), + _3y_to_4y: _10yTo12yPattern::new( + client.clone(), + "utxos_at_least_3y_up_to_4y_old".to_string(), + ), + _4m_to_5m: _10yTo12yPattern::new( + client.clone(), + "utxos_at_least_4m_up_to_5m_old".to_string(), + ), + _4y_to_5y: _10yTo12yPattern::new( + client.clone(), + "utxos_at_least_4y_up_to_5y_old".to_string(), + ), + _5m_to_6m: _10yTo12yPattern::new( + client.clone(), + "utxos_at_least_5m_up_to_6m_old".to_string(), + ), + _5y_to_6y: _10yTo12yPattern::new( + client.clone(), + "utxos_at_least_5y_up_to_6y_old".to_string(), + ), + _6m_to_1y: _10yTo12yPattern::new( + client.clone(), + "utxos_at_least_6m_up_to_1y_old".to_string(), + ), + _6y_to_7y: _10yTo12yPattern::new( + client.clone(), + "utxos_at_least_6y_up_to_7y_old".to_string(), + ), + _7y_to_8y: _10yTo12yPattern::new( + client.clone(), + "utxos_at_least_7y_up_to_8y_old".to_string(), + ), + _8y_to_10y: _10yTo12yPattern::new( + client.clone(), + "utxos_at_least_8y_up_to_10y_old".to_string(), + ), from_15y: _10yTo12yPattern::new(client.clone(), "utxos_at_least_15y_old".to_string()), up_to_1h: _10yTo12yPattern::new(client.clone(), "utxos_up_to_1h_old".to_string()), } } } -/// Catalog tree node. -pub struct CatalogTree_Distribution_UtxoCohorts_All { +/// Metrics tree node. +pub struct MetricsTree_Distribution_UtxoCohorts_All { pub activity: ActivityPattern2, - pub cost_basis: CatalogTree_Distribution_UtxoCohorts_All_CostBasis, + pub cost_basis: MetricsTree_Distribution_UtxoCohorts_All_CostBasis, pub outputs: OutputsPattern, pub realized: RealizedPattern3, - pub relative: CatalogTree_Distribution_UtxoCohorts_All_Relative, + pub relative: MetricsTree_Distribution_UtxoCohorts_All_Relative, pub supply: SupplyPattern2, pub unrealized: UnrealizedPattern, } -impl CatalogTree_Distribution_UtxoCohorts_All { +impl MetricsTree_Distribution_UtxoCohorts_All { pub fn new(client: Arc, base_path: String) -> Self { Self { - activity: ActivityPattern2::new(client.clone(), "coinblocks_destroyed_cumulative".to_string()), - cost_basis: CatalogTree_Distribution_UtxoCohorts_All_CostBasis::new(client.clone(), format!("{base_path}_cost_basis")), + activity: ActivityPattern2::new(client.clone(), "coinblocks_destroyed".to_string()), + cost_basis: MetricsTree_Distribution_UtxoCohorts_All_CostBasis::new( + client.clone(), + format!("{base_path}_cost_basis"), + ), outputs: OutputsPattern::new(client.clone(), "utxo_count".to_string()), realized: RealizedPattern3::new(client.clone(), "adjusted_sopr".to_string()), - relative: CatalogTree_Distribution_UtxoCohorts_All_Relative::new(client.clone(), format!("{base_path}_relative")), + relative: MetricsTree_Distribution_UtxoCohorts_All_Relative::new( + client.clone(), + format!("{base_path}_relative"), + ), supply: SupplyPattern2::new(client.clone(), "supply".to_string()), unrealized: UnrealizedPattern::new(client.clone(), "neg_unrealized_loss".to_string()), } } } -/// Catalog tree node. -pub struct CatalogTree_Distribution_UtxoCohorts_All_CostBasis { +/// Metrics tree node. +pub struct MetricsTree_Distribution_UtxoCohorts_All_CostBasis { pub max: MetricPattern1, pub min: MetricPattern1, pub percentiles: PercentilesPattern, } -impl CatalogTree_Distribution_UtxoCohorts_All_CostBasis { +impl MetricsTree_Distribution_UtxoCohorts_All_CostBasis { pub fn new(client: Arc, base_path: String) -> Self { Self { max: MetricPattern1::new(client.clone(), "max_cost_basis".to_string()), @@ -4631,8 +5505,8 @@ impl CatalogTree_Distribution_UtxoCohorts_All_CostBasis { } } -/// Catalog tree node. -pub struct CatalogTree_Distribution_UtxoCohorts_All_Relative { +/// Metrics tree node. +pub struct MetricsTree_Distribution_UtxoCohorts_All_Relative { pub neg_unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1, pub net_unrealized_pnl_rel_to_own_total_unrealized_pnl: MetricPattern1, pub supply_in_loss_rel_to_own_supply: MetricPattern1, @@ -4641,21 +5515,39 @@ pub struct CatalogTree_Distribution_UtxoCohorts_All_Relative { pub unrealized_profit_rel_to_own_total_unrealized_pnl: MetricPattern1, } -impl CatalogTree_Distribution_UtxoCohorts_All_Relative { +impl MetricsTree_Distribution_UtxoCohorts_All_Relative { pub fn new(client: Arc, base_path: String) -> Self { Self { - neg_unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1::new(client.clone(), "neg_unrealized_loss_rel_to_own_total_unrealized_pnl".to_string()), - net_unrealized_pnl_rel_to_own_total_unrealized_pnl: MetricPattern1::new(client.clone(), "net_unrealized_pnl_rel_to_own_total_unrealized_pnl".to_string()), - supply_in_loss_rel_to_own_supply: MetricPattern1::new(client.clone(), "supply_in_loss_rel_to_own_supply".to_string()), - supply_in_profit_rel_to_own_supply: MetricPattern1::new(client.clone(), "supply_in_profit_rel_to_own_supply".to_string()), - unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1::new(client.clone(), "unrealized_loss_rel_to_own_total_unrealized_pnl".to_string()), - unrealized_profit_rel_to_own_total_unrealized_pnl: MetricPattern1::new(client.clone(), "unrealized_profit_rel_to_own_total_unrealized_pnl".to_string()), + neg_unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1::new( + client.clone(), + "neg_unrealized_loss_rel_to_own_total_unrealized_pnl".to_string(), + ), + net_unrealized_pnl_rel_to_own_total_unrealized_pnl: MetricPattern1::new( + client.clone(), + "net_unrealized_pnl_rel_to_own_total_unrealized_pnl".to_string(), + ), + supply_in_loss_rel_to_own_supply: MetricPattern1::new( + client.clone(), + "supply_in_loss_rel_to_own_supply".to_string(), + ), + supply_in_profit_rel_to_own_supply: MetricPattern1::new( + client.clone(), + "supply_in_profit_rel_to_own_supply".to_string(), + ), + unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1::new( + client.clone(), + "unrealized_loss_rel_to_own_total_unrealized_pnl".to_string(), + ), + unrealized_profit_rel_to_own_total_unrealized_pnl: MetricPattern1::new( + client.clone(), + "unrealized_profit_rel_to_own_total_unrealized_pnl".to_string(), + ), } } } -/// Catalog tree node. -pub struct CatalogTree_Distribution_UtxoCohorts_AmountRange { +/// Metrics tree node. +pub struct MetricsTree_Distribution_UtxoCohorts_AmountRange { pub _0sats: _0satsPattern2, pub _100btc_to_1k_btc: _0satsPattern2, pub _100k_btc_or_more: _0satsPattern2, @@ -4673,30 +5565,72 @@ pub struct CatalogTree_Distribution_UtxoCohorts_AmountRange { pub _1sat_to_10sats: _0satsPattern2, } -impl CatalogTree_Distribution_UtxoCohorts_AmountRange { +impl MetricsTree_Distribution_UtxoCohorts_AmountRange { pub fn new(client: Arc, base_path: String) -> Self { Self { _0sats: _0satsPattern2::new(client.clone(), "utxos_with_0sats".to_string()), - _100btc_to_1k_btc: _0satsPattern2::new(client.clone(), "utxos_above_100btc_under_1k_btc".to_string()), - _100k_btc_or_more: _0satsPattern2::new(client.clone(), "utxos_above_100k_btc".to_string()), - _100k_sats_to_1m_sats: _0satsPattern2::new(client.clone(), "utxos_above_100k_sats_under_1m_sats".to_string()), - _100sats_to_1k_sats: _0satsPattern2::new(client.clone(), "utxos_above_100sats_under_1k_sats".to_string()), - _10btc_to_100btc: _0satsPattern2::new(client.clone(), "utxos_above_10btc_under_100btc".to_string()), - _10k_btc_to_100k_btc: _0satsPattern2::new(client.clone(), "utxos_above_10k_btc_under_100k_btc".to_string()), - _10k_sats_to_100k_sats: _0satsPattern2::new(client.clone(), "utxos_above_10k_sats_under_100k_sats".to_string()), - _10m_sats_to_1btc: _0satsPattern2::new(client.clone(), "utxos_above_10m_sats_under_1btc".to_string()), - _10sats_to_100sats: _0satsPattern2::new(client.clone(), "utxos_above_10sats_under_100sats".to_string()), - _1btc_to_10btc: _0satsPattern2::new(client.clone(), "utxos_above_1btc_under_10btc".to_string()), - _1k_btc_to_10k_btc: _0satsPattern2::new(client.clone(), "utxos_above_1k_btc_under_10k_btc".to_string()), - _1k_sats_to_10k_sats: _0satsPattern2::new(client.clone(), "utxos_above_1k_sats_under_10k_sats".to_string()), - _1m_sats_to_10m_sats: _0satsPattern2::new(client.clone(), "utxos_above_1m_sats_under_10m_sats".to_string()), - _1sat_to_10sats: _0satsPattern2::new(client.clone(), "utxos_above_1sat_under_10sats".to_string()), + _100btc_to_1k_btc: _0satsPattern2::new( + client.clone(), + "utxos_above_100btc_under_1k_btc".to_string(), + ), + _100k_btc_or_more: _0satsPattern2::new( + client.clone(), + "utxos_above_100k_btc".to_string(), + ), + _100k_sats_to_1m_sats: _0satsPattern2::new( + client.clone(), + "utxos_above_100k_sats_under_1m_sats".to_string(), + ), + _100sats_to_1k_sats: _0satsPattern2::new( + client.clone(), + "utxos_above_100sats_under_1k_sats".to_string(), + ), + _10btc_to_100btc: _0satsPattern2::new( + client.clone(), + "utxos_above_10btc_under_100btc".to_string(), + ), + _10k_btc_to_100k_btc: _0satsPattern2::new( + client.clone(), + "utxos_above_10k_btc_under_100k_btc".to_string(), + ), + _10k_sats_to_100k_sats: _0satsPattern2::new( + client.clone(), + "utxos_above_10k_sats_under_100k_sats".to_string(), + ), + _10m_sats_to_1btc: _0satsPattern2::new( + client.clone(), + "utxos_above_10m_sats_under_1btc".to_string(), + ), + _10sats_to_100sats: _0satsPattern2::new( + client.clone(), + "utxos_above_10sats_under_100sats".to_string(), + ), + _1btc_to_10btc: _0satsPattern2::new( + client.clone(), + "utxos_above_1btc_under_10btc".to_string(), + ), + _1k_btc_to_10k_btc: _0satsPattern2::new( + client.clone(), + "utxos_above_1k_btc_under_10k_btc".to_string(), + ), + _1k_sats_to_10k_sats: _0satsPattern2::new( + client.clone(), + "utxos_above_1k_sats_under_10k_sats".to_string(), + ), + _1m_sats_to_10m_sats: _0satsPattern2::new( + client.clone(), + "utxos_above_1m_sats_under_10m_sats".to_string(), + ), + _1sat_to_10sats: _0satsPattern2::new( + client.clone(), + "utxos_above_1sat_under_10sats".to_string(), + ), } } } -/// Catalog tree node. -pub struct CatalogTree_Distribution_UtxoCohorts_Epoch { +/// Metrics tree node. +pub struct MetricsTree_Distribution_UtxoCohorts_Epoch { pub _0: _0satsPattern2, pub _1: _0satsPattern2, pub _2: _0satsPattern2, @@ -4704,7 +5638,7 @@ pub struct CatalogTree_Distribution_UtxoCohorts_Epoch { pub _4: _0satsPattern2, } -impl CatalogTree_Distribution_UtxoCohorts_Epoch { +impl MetricsTree_Distribution_UtxoCohorts_Epoch { pub fn new(client: Arc, base_path: String) -> Self { Self { _0: _0satsPattern2::new(client.clone(), "epoch_0".to_string()), @@ -4716,8 +5650,8 @@ impl CatalogTree_Distribution_UtxoCohorts_Epoch { } } -/// Catalog tree node. -pub struct CatalogTree_Distribution_UtxoCohorts_GeAmount { +/// Metrics tree node. +pub struct MetricsTree_Distribution_UtxoCohorts_GeAmount { pub _100btc: _100btcPattern, pub _100k_sats: _100btcPattern, pub _100sats: _100btcPattern, @@ -4733,7 +5667,7 @@ pub struct CatalogTree_Distribution_UtxoCohorts_GeAmount { pub _1sat: _100btcPattern, } -impl CatalogTree_Distribution_UtxoCohorts_GeAmount { +impl MetricsTree_Distribution_UtxoCohorts_GeAmount { pub fn new(client: Arc, base_path: String) -> Self { Self { _100btc: _100btcPattern::new(client.clone(), "utxos_above_100btc".to_string()), @@ -4753,8 +5687,8 @@ impl CatalogTree_Distribution_UtxoCohorts_GeAmount { } } -/// Catalog tree node. -pub struct CatalogTree_Distribution_UtxoCohorts_LtAmount { +/// Metrics tree node. +pub struct MetricsTree_Distribution_UtxoCohorts_LtAmount { pub _100btc: _100btcPattern, pub _100k_btc: _100btcPattern, pub _100k_sats: _100btcPattern, @@ -4770,7 +5704,7 @@ pub struct CatalogTree_Distribution_UtxoCohorts_LtAmount { pub _1m_sats: _100btcPattern, } -impl CatalogTree_Distribution_UtxoCohorts_LtAmount { +impl MetricsTree_Distribution_UtxoCohorts_LtAmount { pub fn new(client: Arc, base_path: String) -> Self { Self { _100btc: _100btcPattern::new(client.clone(), "utxos_under_100btc".to_string()), @@ -4790,8 +5724,8 @@ impl CatalogTree_Distribution_UtxoCohorts_LtAmount { } } -/// Catalog tree node. -pub struct CatalogTree_Distribution_UtxoCohorts_MaxAge { +/// Metrics tree node. +pub struct MetricsTree_Distribution_UtxoCohorts_MaxAge { pub _10y: _10yPattern, pub _12y: _10yPattern, pub _15y: _10yPattern, @@ -4812,7 +5746,7 @@ pub struct CatalogTree_Distribution_UtxoCohorts_MaxAge { pub _8y: _10yPattern, } -impl CatalogTree_Distribution_UtxoCohorts_MaxAge { +impl MetricsTree_Distribution_UtxoCohorts_MaxAge { pub fn new(client: Arc, base_path: String) -> Self { Self { _10y: _10yPattern::new(client.clone(), "utxos_up_to_10y_old".to_string()), @@ -4837,8 +5771,8 @@ impl CatalogTree_Distribution_UtxoCohorts_MaxAge { } } -/// Catalog tree node. -pub struct CatalogTree_Distribution_UtxoCohorts_MinAge { +/// Metrics tree node. +pub struct MetricsTree_Distribution_UtxoCohorts_MinAge { pub _10y: _100btcPattern, pub _12y: _100btcPattern, pub _1d: _100btcPattern, @@ -4859,7 +5793,7 @@ pub struct CatalogTree_Distribution_UtxoCohorts_MinAge { pub _8y: _100btcPattern, } -impl CatalogTree_Distribution_UtxoCohorts_MinAge { +impl MetricsTree_Distribution_UtxoCohorts_MinAge { pub fn new(client: Arc, base_path: String) -> Self { Self { _10y: _100btcPattern::new(client.clone(), "utxos_at_least_10y_old".to_string()), @@ -4884,25 +5818,31 @@ impl CatalogTree_Distribution_UtxoCohorts_MinAge { } } -/// Catalog tree node. -pub struct CatalogTree_Distribution_UtxoCohorts_Term { - pub long: CatalogTree_Distribution_UtxoCohorts_Term_Long, - pub short: CatalogTree_Distribution_UtxoCohorts_Term_Short, +/// Metrics tree node. +pub struct MetricsTree_Distribution_UtxoCohorts_Term { + pub long: MetricsTree_Distribution_UtxoCohorts_Term_Long, + pub short: MetricsTree_Distribution_UtxoCohorts_Term_Short, } -impl CatalogTree_Distribution_UtxoCohorts_Term { +impl MetricsTree_Distribution_UtxoCohorts_Term { pub fn new(client: Arc, base_path: String) -> Self { Self { - long: CatalogTree_Distribution_UtxoCohorts_Term_Long::new(client.clone(), format!("{base_path}_long")), - short: CatalogTree_Distribution_UtxoCohorts_Term_Short::new(client.clone(), format!("{base_path}_short")), + long: MetricsTree_Distribution_UtxoCohorts_Term_Long::new( + client.clone(), + format!("{base_path}_long"), + ), + short: MetricsTree_Distribution_UtxoCohorts_Term_Short::new( + client.clone(), + format!("{base_path}_short"), + ), } } } -/// Catalog tree node. -pub struct CatalogTree_Distribution_UtxoCohorts_Term_Long { +/// Metrics tree node. +pub struct MetricsTree_Distribution_UtxoCohorts_Term_Long { pub activity: ActivityPattern2, - pub cost_basis: CatalogTree_Distribution_UtxoCohorts_Term_Long_CostBasis, + pub cost_basis: MetricsTree_Distribution_UtxoCohorts_Term_Long_CostBasis, pub outputs: OutputsPattern, pub realized: RealizedPattern2, pub relative: RelativePattern5, @@ -4910,11 +5850,14 @@ pub struct CatalogTree_Distribution_UtxoCohorts_Term_Long { pub unrealized: UnrealizedPattern, } -impl CatalogTree_Distribution_UtxoCohorts_Term_Long { +impl MetricsTree_Distribution_UtxoCohorts_Term_Long { pub fn new(client: Arc, base_path: String) -> Self { Self { activity: ActivityPattern2::new(client.clone(), "lth".to_string()), - cost_basis: CatalogTree_Distribution_UtxoCohorts_Term_Long_CostBasis::new(client.clone(), format!("{base_path}_cost_basis")), + cost_basis: MetricsTree_Distribution_UtxoCohorts_Term_Long_CostBasis::new( + client.clone(), + format!("{base_path}_cost_basis"), + ), outputs: OutputsPattern::new(client.clone(), "lth".to_string()), realized: RealizedPattern2::new(client.clone(), "lth".to_string()), relative: RelativePattern5::new(client.clone(), "lth".to_string()), @@ -4924,14 +5867,14 @@ impl CatalogTree_Distribution_UtxoCohorts_Term_Long { } } -/// Catalog tree node. -pub struct CatalogTree_Distribution_UtxoCohorts_Term_Long_CostBasis { +/// Metrics tree node. +pub struct MetricsTree_Distribution_UtxoCohorts_Term_Long_CostBasis { pub max: MetricPattern1, pub min: MetricPattern1, pub percentiles: PercentilesPattern, } -impl CatalogTree_Distribution_UtxoCohorts_Term_Long_CostBasis { +impl MetricsTree_Distribution_UtxoCohorts_Term_Long_CostBasis { pub fn new(client: Arc, base_path: String) -> Self { Self { max: MetricPattern1::new(client.clone(), "lth_max_cost_basis".to_string()), @@ -4941,10 +5884,10 @@ impl CatalogTree_Distribution_UtxoCohorts_Term_Long_CostBasis { } } -/// Catalog tree node. -pub struct CatalogTree_Distribution_UtxoCohorts_Term_Short { +/// Metrics tree node. +pub struct MetricsTree_Distribution_UtxoCohorts_Term_Short { pub activity: ActivityPattern2, - pub cost_basis: CatalogTree_Distribution_UtxoCohorts_Term_Short_CostBasis, + pub cost_basis: MetricsTree_Distribution_UtxoCohorts_Term_Short_CostBasis, pub outputs: OutputsPattern, pub realized: RealizedPattern3, pub relative: RelativePattern5, @@ -4952,11 +5895,14 @@ pub struct CatalogTree_Distribution_UtxoCohorts_Term_Short { pub unrealized: UnrealizedPattern, } -impl CatalogTree_Distribution_UtxoCohorts_Term_Short { +impl MetricsTree_Distribution_UtxoCohorts_Term_Short { pub fn new(client: Arc, base_path: String) -> Self { Self { activity: ActivityPattern2::new(client.clone(), "sth".to_string()), - cost_basis: CatalogTree_Distribution_UtxoCohorts_Term_Short_CostBasis::new(client.clone(), format!("{base_path}_cost_basis")), + cost_basis: MetricsTree_Distribution_UtxoCohorts_Term_Short_CostBasis::new( + client.clone(), + format!("{base_path}_cost_basis"), + ), outputs: OutputsPattern::new(client.clone(), "sth".to_string()), realized: RealizedPattern3::new(client.clone(), "sth".to_string()), relative: RelativePattern5::new(client.clone(), "sth".to_string()), @@ -4966,14 +5912,14 @@ impl CatalogTree_Distribution_UtxoCohorts_Term_Short { } } -/// Catalog tree node. -pub struct CatalogTree_Distribution_UtxoCohorts_Term_Short_CostBasis { +/// Metrics tree node. +pub struct MetricsTree_Distribution_UtxoCohorts_Term_Short_CostBasis { pub max: MetricPattern1, pub min: MetricPattern1, pub percentiles: PercentilesPattern, } -impl CatalogTree_Distribution_UtxoCohorts_Term_Short_CostBasis { +impl MetricsTree_Distribution_UtxoCohorts_Term_Short_CostBasis { pub fn new(client: Arc, base_path: String) -> Self { Self { max: MetricPattern1::new(client.clone(), "sth_max_cost_basis".to_string()), @@ -4983,8 +5929,8 @@ impl CatalogTree_Distribution_UtxoCohorts_Term_Short_CostBasis { } } -/// Catalog tree node. -pub struct CatalogTree_Distribution_UtxoCohorts_Type { +/// Metrics tree node. +pub struct MetricsTree_Distribution_UtxoCohorts_Type { pub empty: _0satsPattern2, pub p2a: _0satsPattern2, pub p2ms: _0satsPattern2, @@ -4998,7 +5944,7 @@ pub struct CatalogTree_Distribution_UtxoCohorts_Type { pub unknown: _0satsPattern2, } -impl CatalogTree_Distribution_UtxoCohorts_Type { +impl MetricsTree_Distribution_UtxoCohorts_Type { pub fn new(client: Arc, base_path: String) -> Self { Self { empty: _0satsPattern2::new(client.clone(), "empty_outputs".to_string()), @@ -5016,8 +5962,8 @@ impl CatalogTree_Distribution_UtxoCohorts_Type { } } -/// Catalog tree node. -pub struct CatalogTree_Distribution_UtxoCohorts_Year { +/// Metrics tree node. +pub struct MetricsTree_Distribution_UtxoCohorts_Year { pub _2009: _0satsPattern2, pub _2010: _0satsPattern2, pub _2011: _0satsPattern2, @@ -5038,7 +5984,7 @@ pub struct CatalogTree_Distribution_UtxoCohorts_Year { pub _2026: _0satsPattern2, } -impl CatalogTree_Distribution_UtxoCohorts_Year { +impl MetricsTree_Distribution_UtxoCohorts_Year { pub fn new(client: Arc, base_path: String) -> Self { Self { _2009: _0satsPattern2::new(client.clone(), "year_2009".to_string()), @@ -5063,86 +6009,158 @@ impl CatalogTree_Distribution_UtxoCohorts_Year { } } -/// Catalog tree node. -pub struct CatalogTree_Indexes { - pub address: CatalogTree_Indexes_Address, - pub dateindex: CatalogTree_Indexes_Dateindex, - pub decadeindex: CatalogTree_Indexes_Decadeindex, - pub difficultyepoch: CatalogTree_Indexes_Difficultyepoch, - pub halvingepoch: CatalogTree_Indexes_Halvingepoch, - pub height: CatalogTree_Indexes_Height, - pub monthindex: CatalogTree_Indexes_Monthindex, - pub quarterindex: CatalogTree_Indexes_Quarterindex, - pub semesterindex: CatalogTree_Indexes_Semesterindex, - pub txindex: CatalogTree_Indexes_Txindex, - pub txinindex: CatalogTree_Indexes_Txinindex, - pub txoutindex: CatalogTree_Indexes_Txoutindex, - pub weekindex: CatalogTree_Indexes_Weekindex, - pub yearindex: CatalogTree_Indexes_Yearindex, +/// Metrics tree node. +pub struct MetricsTree_Indexes { + pub address: MetricsTree_Indexes_Address, + pub dateindex: MetricsTree_Indexes_Dateindex, + pub decadeindex: MetricsTree_Indexes_Decadeindex, + pub difficultyepoch: MetricsTree_Indexes_Difficultyepoch, + pub halvingepoch: MetricsTree_Indexes_Halvingepoch, + pub height: MetricsTree_Indexes_Height, + pub monthindex: MetricsTree_Indexes_Monthindex, + pub quarterindex: MetricsTree_Indexes_Quarterindex, + pub semesterindex: MetricsTree_Indexes_Semesterindex, + pub txindex: MetricsTree_Indexes_Txindex, + pub txinindex: MetricsTree_Indexes_Txinindex, + pub txoutindex: MetricsTree_Indexes_Txoutindex, + pub weekindex: MetricsTree_Indexes_Weekindex, + pub yearindex: MetricsTree_Indexes_Yearindex, } -impl CatalogTree_Indexes { +impl MetricsTree_Indexes { pub fn new(client: Arc, base_path: String) -> Self { Self { - address: CatalogTree_Indexes_Address::new(client.clone(), format!("{base_path}_address")), - dateindex: CatalogTree_Indexes_Dateindex::new(client.clone(), format!("{base_path}_dateindex")), - decadeindex: CatalogTree_Indexes_Decadeindex::new(client.clone(), format!("{base_path}_decadeindex")), - difficultyepoch: CatalogTree_Indexes_Difficultyepoch::new(client.clone(), format!("{base_path}_difficultyepoch")), - halvingepoch: CatalogTree_Indexes_Halvingepoch::new(client.clone(), format!("{base_path}_halvingepoch")), - height: CatalogTree_Indexes_Height::new(client.clone(), format!("{base_path}_height")), - monthindex: CatalogTree_Indexes_Monthindex::new(client.clone(), format!("{base_path}_monthindex")), - quarterindex: CatalogTree_Indexes_Quarterindex::new(client.clone(), format!("{base_path}_quarterindex")), - semesterindex: CatalogTree_Indexes_Semesterindex::new(client.clone(), format!("{base_path}_semesterindex")), - txindex: CatalogTree_Indexes_Txindex::new(client.clone(), format!("{base_path}_txindex")), - txinindex: CatalogTree_Indexes_Txinindex::new(client.clone(), format!("{base_path}_txinindex")), - txoutindex: CatalogTree_Indexes_Txoutindex::new(client.clone(), format!("{base_path}_txoutindex")), - weekindex: CatalogTree_Indexes_Weekindex::new(client.clone(), format!("{base_path}_weekindex")), - yearindex: CatalogTree_Indexes_Yearindex::new(client.clone(), format!("{base_path}_yearindex")), + address: MetricsTree_Indexes_Address::new( + client.clone(), + format!("{base_path}_address"), + ), + dateindex: MetricsTree_Indexes_Dateindex::new( + client.clone(), + format!("{base_path}_dateindex"), + ), + decadeindex: MetricsTree_Indexes_Decadeindex::new( + client.clone(), + format!("{base_path}_decadeindex"), + ), + difficultyepoch: MetricsTree_Indexes_Difficultyepoch::new( + client.clone(), + format!("{base_path}_difficultyepoch"), + ), + halvingepoch: MetricsTree_Indexes_Halvingepoch::new( + client.clone(), + format!("{base_path}_halvingepoch"), + ), + height: MetricsTree_Indexes_Height::new(client.clone(), format!("{base_path}_height")), + monthindex: MetricsTree_Indexes_Monthindex::new( + client.clone(), + format!("{base_path}_monthindex"), + ), + quarterindex: MetricsTree_Indexes_Quarterindex::new( + client.clone(), + format!("{base_path}_quarterindex"), + ), + semesterindex: MetricsTree_Indexes_Semesterindex::new( + client.clone(), + format!("{base_path}_semesterindex"), + ), + txindex: MetricsTree_Indexes_Txindex::new( + client.clone(), + format!("{base_path}_txindex"), + ), + txinindex: MetricsTree_Indexes_Txinindex::new( + client.clone(), + format!("{base_path}_txinindex"), + ), + txoutindex: MetricsTree_Indexes_Txoutindex::new( + client.clone(), + format!("{base_path}_txoutindex"), + ), + weekindex: MetricsTree_Indexes_Weekindex::new( + client.clone(), + format!("{base_path}_weekindex"), + ), + yearindex: MetricsTree_Indexes_Yearindex::new( + client.clone(), + format!("{base_path}_yearindex"), + ), } } } -/// Catalog tree node. -pub struct CatalogTree_Indexes_Address { - pub empty: CatalogTree_Indexes_Address_Empty, - pub opreturn: CatalogTree_Indexes_Address_Opreturn, - pub p2a: CatalogTree_Indexes_Address_P2a, - pub p2ms: CatalogTree_Indexes_Address_P2ms, - pub p2pk33: CatalogTree_Indexes_Address_P2pk33, - pub p2pk65: CatalogTree_Indexes_Address_P2pk65, - pub p2pkh: CatalogTree_Indexes_Address_P2pkh, - pub p2sh: CatalogTree_Indexes_Address_P2sh, - pub p2tr: CatalogTree_Indexes_Address_P2tr, - pub p2wpkh: CatalogTree_Indexes_Address_P2wpkh, - pub p2wsh: CatalogTree_Indexes_Address_P2wsh, - pub unknown: CatalogTree_Indexes_Address_Unknown, +/// Metrics tree node. +pub struct MetricsTree_Indexes_Address { + pub empty: MetricsTree_Indexes_Address_Empty, + pub opreturn: MetricsTree_Indexes_Address_Opreturn, + pub p2a: MetricsTree_Indexes_Address_P2a, + pub p2ms: MetricsTree_Indexes_Address_P2ms, + pub p2pk33: MetricsTree_Indexes_Address_P2pk33, + pub p2pk65: MetricsTree_Indexes_Address_P2pk65, + pub p2pkh: MetricsTree_Indexes_Address_P2pkh, + pub p2sh: MetricsTree_Indexes_Address_P2sh, + pub p2tr: MetricsTree_Indexes_Address_P2tr, + pub p2wpkh: MetricsTree_Indexes_Address_P2wpkh, + pub p2wsh: MetricsTree_Indexes_Address_P2wsh, + pub unknown: MetricsTree_Indexes_Address_Unknown, } -impl CatalogTree_Indexes_Address { +impl MetricsTree_Indexes_Address { pub fn new(client: Arc, base_path: String) -> Self { Self { - empty: CatalogTree_Indexes_Address_Empty::new(client.clone(), format!("{base_path}_empty")), - opreturn: CatalogTree_Indexes_Address_Opreturn::new(client.clone(), format!("{base_path}_opreturn")), - p2a: CatalogTree_Indexes_Address_P2a::new(client.clone(), format!("{base_path}_p2a")), - p2ms: CatalogTree_Indexes_Address_P2ms::new(client.clone(), format!("{base_path}_p2ms")), - p2pk33: CatalogTree_Indexes_Address_P2pk33::new(client.clone(), format!("{base_path}_p2pk33")), - p2pk65: CatalogTree_Indexes_Address_P2pk65::new(client.clone(), format!("{base_path}_p2pk65")), - p2pkh: CatalogTree_Indexes_Address_P2pkh::new(client.clone(), format!("{base_path}_p2pkh")), - p2sh: CatalogTree_Indexes_Address_P2sh::new(client.clone(), format!("{base_path}_p2sh")), - p2tr: CatalogTree_Indexes_Address_P2tr::new(client.clone(), format!("{base_path}_p2tr")), - p2wpkh: CatalogTree_Indexes_Address_P2wpkh::new(client.clone(), format!("{base_path}_p2wpkh")), - p2wsh: CatalogTree_Indexes_Address_P2wsh::new(client.clone(), format!("{base_path}_p2wsh")), - unknown: CatalogTree_Indexes_Address_Unknown::new(client.clone(), format!("{base_path}_unknown")), + empty: MetricsTree_Indexes_Address_Empty::new( + client.clone(), + format!("{base_path}_empty"), + ), + opreturn: MetricsTree_Indexes_Address_Opreturn::new( + client.clone(), + format!("{base_path}_opreturn"), + ), + p2a: MetricsTree_Indexes_Address_P2a::new(client.clone(), format!("{base_path}_p2a")), + p2ms: MetricsTree_Indexes_Address_P2ms::new( + client.clone(), + format!("{base_path}_p2ms"), + ), + p2pk33: MetricsTree_Indexes_Address_P2pk33::new( + client.clone(), + format!("{base_path}_p2pk33"), + ), + p2pk65: MetricsTree_Indexes_Address_P2pk65::new( + client.clone(), + format!("{base_path}_p2pk65"), + ), + p2pkh: MetricsTree_Indexes_Address_P2pkh::new( + client.clone(), + format!("{base_path}_p2pkh"), + ), + p2sh: MetricsTree_Indexes_Address_P2sh::new( + client.clone(), + format!("{base_path}_p2sh"), + ), + p2tr: MetricsTree_Indexes_Address_P2tr::new( + client.clone(), + format!("{base_path}_p2tr"), + ), + p2wpkh: MetricsTree_Indexes_Address_P2wpkh::new( + client.clone(), + format!("{base_path}_p2wpkh"), + ), + p2wsh: MetricsTree_Indexes_Address_P2wsh::new( + client.clone(), + format!("{base_path}_p2wsh"), + ), + unknown: MetricsTree_Indexes_Address_Unknown::new( + client.clone(), + format!("{base_path}_unknown"), + ), } } } -/// Catalog tree node. -pub struct CatalogTree_Indexes_Address_Empty { +/// Metrics tree node. +pub struct MetricsTree_Indexes_Address_Empty { pub identity: MetricPattern9, } -impl CatalogTree_Indexes_Address_Empty { +impl MetricsTree_Indexes_Address_Empty { pub fn new(client: Arc, base_path: String) -> Self { Self { identity: MetricPattern9::new(client.clone(), "emptyoutputindex".to_string()), @@ -5150,12 +6168,12 @@ impl CatalogTree_Indexes_Address_Empty { } } -/// Catalog tree node. -pub struct CatalogTree_Indexes_Address_Opreturn { +/// Metrics tree node. +pub struct MetricsTree_Indexes_Address_Opreturn { pub identity: MetricPattern14, } -impl CatalogTree_Indexes_Address_Opreturn { +impl MetricsTree_Indexes_Address_Opreturn { pub fn new(client: Arc, base_path: String) -> Self { Self { identity: MetricPattern14::new(client.clone(), "opreturnindex".to_string()), @@ -5163,12 +6181,12 @@ impl CatalogTree_Indexes_Address_Opreturn { } } -/// Catalog tree node. -pub struct CatalogTree_Indexes_Address_P2a { +/// Metrics tree node. +pub struct MetricsTree_Indexes_Address_P2a { pub identity: MetricPattern16, } -impl CatalogTree_Indexes_Address_P2a { +impl MetricsTree_Indexes_Address_P2a { pub fn new(client: Arc, base_path: String) -> Self { Self { identity: MetricPattern16::new(client.clone(), "p2aaddressindex".to_string()), @@ -5176,12 +6194,12 @@ impl CatalogTree_Indexes_Address_P2a { } } -/// Catalog tree node. -pub struct CatalogTree_Indexes_Address_P2ms { +/// Metrics tree node. +pub struct MetricsTree_Indexes_Address_P2ms { pub identity: MetricPattern17, } -impl CatalogTree_Indexes_Address_P2ms { +impl MetricsTree_Indexes_Address_P2ms { pub fn new(client: Arc, base_path: String) -> Self { Self { identity: MetricPattern17::new(client.clone(), "p2msoutputindex".to_string()), @@ -5189,12 +6207,12 @@ impl CatalogTree_Indexes_Address_P2ms { } } -/// Catalog tree node. -pub struct CatalogTree_Indexes_Address_P2pk33 { +/// Metrics tree node. +pub struct MetricsTree_Indexes_Address_P2pk33 { pub identity: MetricPattern18, } -impl CatalogTree_Indexes_Address_P2pk33 { +impl MetricsTree_Indexes_Address_P2pk33 { pub fn new(client: Arc, base_path: String) -> Self { Self { identity: MetricPattern18::new(client.clone(), "p2pk33addressindex".to_string()), @@ -5202,12 +6220,12 @@ impl CatalogTree_Indexes_Address_P2pk33 { } } -/// Catalog tree node. -pub struct CatalogTree_Indexes_Address_P2pk65 { +/// Metrics tree node. +pub struct MetricsTree_Indexes_Address_P2pk65 { pub identity: MetricPattern19, } -impl CatalogTree_Indexes_Address_P2pk65 { +impl MetricsTree_Indexes_Address_P2pk65 { pub fn new(client: Arc, base_path: String) -> Self { Self { identity: MetricPattern19::new(client.clone(), "p2pk65addressindex".to_string()), @@ -5215,12 +6233,12 @@ impl CatalogTree_Indexes_Address_P2pk65 { } } -/// Catalog tree node. -pub struct CatalogTree_Indexes_Address_P2pkh { +/// Metrics tree node. +pub struct MetricsTree_Indexes_Address_P2pkh { pub identity: MetricPattern20, } -impl CatalogTree_Indexes_Address_P2pkh { +impl MetricsTree_Indexes_Address_P2pkh { pub fn new(client: Arc, base_path: String) -> Self { Self { identity: MetricPattern20::new(client.clone(), "p2pkhaddressindex".to_string()), @@ -5228,12 +6246,12 @@ impl CatalogTree_Indexes_Address_P2pkh { } } -/// Catalog tree node. -pub struct CatalogTree_Indexes_Address_P2sh { +/// Metrics tree node. +pub struct MetricsTree_Indexes_Address_P2sh { pub identity: MetricPattern21, } -impl CatalogTree_Indexes_Address_P2sh { +impl MetricsTree_Indexes_Address_P2sh { pub fn new(client: Arc, base_path: String) -> Self { Self { identity: MetricPattern21::new(client.clone(), "p2shaddressindex".to_string()), @@ -5241,12 +6259,12 @@ impl CatalogTree_Indexes_Address_P2sh { } } -/// Catalog tree node. -pub struct CatalogTree_Indexes_Address_P2tr { +/// Metrics tree node. +pub struct MetricsTree_Indexes_Address_P2tr { pub identity: MetricPattern22, } -impl CatalogTree_Indexes_Address_P2tr { +impl MetricsTree_Indexes_Address_P2tr { pub fn new(client: Arc, base_path: String) -> Self { Self { identity: MetricPattern22::new(client.clone(), "p2traddressindex".to_string()), @@ -5254,12 +6272,12 @@ impl CatalogTree_Indexes_Address_P2tr { } } -/// Catalog tree node. -pub struct CatalogTree_Indexes_Address_P2wpkh { +/// Metrics tree node. +pub struct MetricsTree_Indexes_Address_P2wpkh { pub identity: MetricPattern23, } -impl CatalogTree_Indexes_Address_P2wpkh { +impl MetricsTree_Indexes_Address_P2wpkh { pub fn new(client: Arc, base_path: String) -> Self { Self { identity: MetricPattern23::new(client.clone(), "p2wpkhaddressindex".to_string()), @@ -5267,12 +6285,12 @@ impl CatalogTree_Indexes_Address_P2wpkh { } } -/// Catalog tree node. -pub struct CatalogTree_Indexes_Address_P2wsh { +/// Metrics tree node. +pub struct MetricsTree_Indexes_Address_P2wsh { pub identity: MetricPattern24, } -impl CatalogTree_Indexes_Address_P2wsh { +impl MetricsTree_Indexes_Address_P2wsh { pub fn new(client: Arc, base_path: String) -> Self { Self { identity: MetricPattern24::new(client.clone(), "p2wshaddressindex".to_string()), @@ -5280,12 +6298,12 @@ impl CatalogTree_Indexes_Address_P2wsh { } } -/// Catalog tree node. -pub struct CatalogTree_Indexes_Address_Unknown { +/// Metrics tree node. +pub struct MetricsTree_Indexes_Address_Unknown { pub identity: MetricPattern28, } -impl CatalogTree_Indexes_Address_Unknown { +impl MetricsTree_Indexes_Address_Unknown { pub fn new(client: Arc, base_path: String) -> Self { Self { identity: MetricPattern28::new(client.clone(), "unknownoutputindex".to_string()), @@ -5293,8 +6311,8 @@ impl CatalogTree_Indexes_Address_Unknown { } } -/// Catalog tree node. -pub struct CatalogTree_Indexes_Dateindex { +/// Metrics tree node. +pub struct MetricsTree_Indexes_Dateindex { pub date: MetricPattern6, pub first_height: MetricPattern6, pub height_count: MetricPattern6, @@ -5303,7 +6321,7 @@ pub struct CatalogTree_Indexes_Dateindex { pub weekindex: MetricPattern6, } -impl CatalogTree_Indexes_Dateindex { +impl MetricsTree_Indexes_Dateindex { pub fn new(client: Arc, base_path: String) -> Self { Self { date: MetricPattern6::new(client.clone(), "dateindex_date".to_string()), @@ -5316,57 +6334,72 @@ impl CatalogTree_Indexes_Dateindex { } } -/// Catalog tree node. -pub struct CatalogTree_Indexes_Decadeindex { +/// Metrics tree node. +pub struct MetricsTree_Indexes_Decadeindex { pub first_yearindex: MetricPattern7, pub identity: MetricPattern7, pub yearindex_count: MetricPattern7, } -impl CatalogTree_Indexes_Decadeindex { +impl MetricsTree_Indexes_Decadeindex { pub fn new(client: Arc, base_path: String) -> Self { Self { - first_yearindex: MetricPattern7::new(client.clone(), "decadeindex_first_yearindex".to_string()), + first_yearindex: MetricPattern7::new( + client.clone(), + "decadeindex_first_yearindex".to_string(), + ), identity: MetricPattern7::new(client.clone(), "decadeindex".to_string()), - yearindex_count: MetricPattern7::new(client.clone(), "decadeindex_yearindex_count".to_string()), + yearindex_count: MetricPattern7::new( + client.clone(), + "decadeindex_yearindex_count".to_string(), + ), } } } -/// Catalog tree node. -pub struct CatalogTree_Indexes_Difficultyepoch { +/// Metrics tree node. +pub struct MetricsTree_Indexes_Difficultyepoch { pub first_height: MetricPattern8, pub height_count: MetricPattern8, pub identity: MetricPattern8, } -impl CatalogTree_Indexes_Difficultyepoch { +impl MetricsTree_Indexes_Difficultyepoch { pub fn new(client: Arc, base_path: String) -> Self { Self { - first_height: MetricPattern8::new(client.clone(), "difficultyepoch_first_height".to_string()), - height_count: MetricPattern8::new(client.clone(), "difficultyepoch_height_count".to_string()), + first_height: MetricPattern8::new( + client.clone(), + "difficultyepoch_first_height".to_string(), + ), + height_count: MetricPattern8::new( + client.clone(), + "difficultyepoch_height_count".to_string(), + ), identity: MetricPattern8::new(client.clone(), "difficultyepoch".to_string()), } } } -/// Catalog tree node. -pub struct CatalogTree_Indexes_Halvingepoch { +/// Metrics tree node. +pub struct MetricsTree_Indexes_Halvingepoch { pub first_height: MetricPattern10, pub identity: MetricPattern10, } -impl CatalogTree_Indexes_Halvingepoch { +impl MetricsTree_Indexes_Halvingepoch { pub fn new(client: Arc, base_path: String) -> Self { Self { - first_height: MetricPattern10::new(client.clone(), "halvingepoch_first_height".to_string()), + first_height: MetricPattern10::new( + client.clone(), + "halvingepoch_first_height".to_string(), + ), identity: MetricPattern10::new(client.clone(), "halvingepoch".to_string()), } } } -/// Catalog tree node. -pub struct CatalogTree_Indexes_Height { +/// Metrics tree node. +pub struct MetricsTree_Indexes_Height { pub dateindex: MetricPattern11, pub difficultyepoch: MetricPattern11, pub halvingepoch: MetricPattern11, @@ -5374,11 +6407,14 @@ pub struct CatalogTree_Indexes_Height { pub txindex_count: MetricPattern11, } -impl CatalogTree_Indexes_Height { +impl MetricsTree_Indexes_Height { pub fn new(client: Arc, base_path: String) -> Self { Self { dateindex: MetricPattern11::new(client.clone(), "height_dateindex".to_string()), - difficultyepoch: MetricPattern11::new(client.clone(), "height_difficultyepoch".to_string()), + difficultyepoch: MetricPattern11::new( + client.clone(), + "height_difficultyepoch".to_string(), + ), halvingepoch: MetricPattern11::new(client.clone(), "height_halvingepoch".to_string()), identity: MetricPattern11::new(client.clone(), "height".to_string()), txindex_count: MetricPattern11::new(client.clone(), "height_txindex_count".to_string()), @@ -5386,8 +6422,8 @@ impl CatalogTree_Indexes_Height { } } -/// Catalog tree node. -pub struct CatalogTree_Indexes_Monthindex { +/// Metrics tree node. +pub struct MetricsTree_Indexes_Monthindex { pub dateindex_count: MetricPattern13, pub first_dateindex: MetricPattern13, pub identity: MetricPattern13, @@ -5396,61 +6432,85 @@ pub struct CatalogTree_Indexes_Monthindex { pub yearindex: MetricPattern13, } -impl CatalogTree_Indexes_Monthindex { +impl MetricsTree_Indexes_Monthindex { pub fn new(client: Arc, base_path: String) -> Self { Self { - dateindex_count: MetricPattern13::new(client.clone(), "monthindex_dateindex_count".to_string()), - first_dateindex: MetricPattern13::new(client.clone(), "monthindex_first_dateindex".to_string()), + dateindex_count: MetricPattern13::new( + client.clone(), + "monthindex_dateindex_count".to_string(), + ), + first_dateindex: MetricPattern13::new( + client.clone(), + "monthindex_first_dateindex".to_string(), + ), identity: MetricPattern13::new(client.clone(), "monthindex".to_string()), - quarterindex: MetricPattern13::new(client.clone(), "monthindex_quarterindex".to_string()), - semesterindex: MetricPattern13::new(client.clone(), "monthindex_semesterindex".to_string()), + quarterindex: MetricPattern13::new( + client.clone(), + "monthindex_quarterindex".to_string(), + ), + semesterindex: MetricPattern13::new( + client.clone(), + "monthindex_semesterindex".to_string(), + ), yearindex: MetricPattern13::new(client.clone(), "monthindex_yearindex".to_string()), } } } -/// Catalog tree node. -pub struct CatalogTree_Indexes_Quarterindex { +/// Metrics tree node. +pub struct MetricsTree_Indexes_Quarterindex { pub first_monthindex: MetricPattern25, pub identity: MetricPattern25, pub monthindex_count: MetricPattern25, } -impl CatalogTree_Indexes_Quarterindex { +impl MetricsTree_Indexes_Quarterindex { pub fn new(client: Arc, base_path: String) -> Self { Self { - first_monthindex: MetricPattern25::new(client.clone(), "quarterindex_first_monthindex".to_string()), + first_monthindex: MetricPattern25::new( + client.clone(), + "quarterindex_first_monthindex".to_string(), + ), identity: MetricPattern25::new(client.clone(), "quarterindex".to_string()), - monthindex_count: MetricPattern25::new(client.clone(), "quarterindex_monthindex_count".to_string()), + monthindex_count: MetricPattern25::new( + client.clone(), + "quarterindex_monthindex_count".to_string(), + ), } } } -/// Catalog tree node. -pub struct CatalogTree_Indexes_Semesterindex { +/// Metrics tree node. +pub struct MetricsTree_Indexes_Semesterindex { pub first_monthindex: MetricPattern26, pub identity: MetricPattern26, pub monthindex_count: MetricPattern26, } -impl CatalogTree_Indexes_Semesterindex { +impl MetricsTree_Indexes_Semesterindex { pub fn new(client: Arc, base_path: String) -> Self { Self { - first_monthindex: MetricPattern26::new(client.clone(), "semesterindex_first_monthindex".to_string()), + first_monthindex: MetricPattern26::new( + client.clone(), + "semesterindex_first_monthindex".to_string(), + ), identity: MetricPattern26::new(client.clone(), "semesterindex".to_string()), - monthindex_count: MetricPattern26::new(client.clone(), "semesterindex_monthindex_count".to_string()), + monthindex_count: MetricPattern26::new( + client.clone(), + "semesterindex_monthindex_count".to_string(), + ), } } } -/// Catalog tree node. -pub struct CatalogTree_Indexes_Txindex { +/// Metrics tree node. +pub struct MetricsTree_Indexes_Txindex { pub identity: MetricPattern27, pub input_count: MetricPattern27, pub output_count: MetricPattern27, } -impl CatalogTree_Indexes_Txindex { +impl MetricsTree_Indexes_Txindex { pub fn new(client: Arc, base_path: String) -> Self { Self { identity: MetricPattern27::new(client.clone(), "txindex".to_string()), @@ -5460,12 +6520,12 @@ impl CatalogTree_Indexes_Txindex { } } -/// Catalog tree node. -pub struct CatalogTree_Indexes_Txinindex { +/// Metrics tree node. +pub struct MetricsTree_Indexes_Txinindex { pub identity: MetricPattern12, } -impl CatalogTree_Indexes_Txinindex { +impl MetricsTree_Indexes_Txinindex { pub fn new(client: Arc, base_path: String) -> Self { Self { identity: MetricPattern12::new(client.clone(), "txinindex".to_string()), @@ -5473,12 +6533,12 @@ impl CatalogTree_Indexes_Txinindex { } } -/// Catalog tree node. -pub struct CatalogTree_Indexes_Txoutindex { +/// Metrics tree node. +pub struct MetricsTree_Indexes_Txoutindex { pub identity: MetricPattern15, } -impl CatalogTree_Indexes_Txoutindex { +impl MetricsTree_Indexes_Txoutindex { pub fn new(client: Arc, base_path: String) -> Self { Self { identity: MetricPattern15::new(client.clone(), "txoutindex".to_string()), @@ -5486,62 +6546,74 @@ impl CatalogTree_Indexes_Txoutindex { } } -/// Catalog tree node. -pub struct CatalogTree_Indexes_Weekindex { +/// Metrics tree node. +pub struct MetricsTree_Indexes_Weekindex { pub dateindex_count: MetricPattern29, pub first_dateindex: MetricPattern29, pub identity: MetricPattern29, } -impl CatalogTree_Indexes_Weekindex { +impl MetricsTree_Indexes_Weekindex { pub fn new(client: Arc, base_path: String) -> Self { Self { - dateindex_count: MetricPattern29::new(client.clone(), "weekindex_dateindex_count".to_string()), - first_dateindex: MetricPattern29::new(client.clone(), "weekindex_first_dateindex".to_string()), + dateindex_count: MetricPattern29::new( + client.clone(), + "weekindex_dateindex_count".to_string(), + ), + first_dateindex: MetricPattern29::new( + client.clone(), + "weekindex_first_dateindex".to_string(), + ), identity: MetricPattern29::new(client.clone(), "weekindex".to_string()), } } } -/// Catalog tree node. -pub struct CatalogTree_Indexes_Yearindex { +/// Metrics tree node. +pub struct MetricsTree_Indexes_Yearindex { pub decadeindex: MetricPattern30, pub first_monthindex: MetricPattern30, pub identity: MetricPattern30, pub monthindex_count: MetricPattern30, } -impl CatalogTree_Indexes_Yearindex { +impl MetricsTree_Indexes_Yearindex { pub fn new(client: Arc, base_path: String) -> Self { Self { decadeindex: MetricPattern30::new(client.clone(), "yearindex_decadeindex".to_string()), - first_monthindex: MetricPattern30::new(client.clone(), "yearindex_first_monthindex".to_string()), + first_monthindex: MetricPattern30::new( + client.clone(), + "yearindex_first_monthindex".to_string(), + ), identity: MetricPattern30::new(client.clone(), "yearindex".to_string()), - monthindex_count: MetricPattern30::new(client.clone(), "yearindex_monthindex_count".to_string()), + monthindex_count: MetricPattern30::new( + client.clone(), + "yearindex_monthindex_count".to_string(), + ), } } } -/// Catalog tree node. -pub struct CatalogTree_Inputs { +/// Metrics tree node. +pub struct MetricsTree_Inputs { pub count: CountPattern2, pub first_txinindex: MetricPattern11, pub outpoint: MetricPattern12, pub outputtype: MetricPattern12, - pub spent: CatalogTree_Inputs_Spent, + pub spent: MetricsTree_Inputs_Spent, pub txindex: MetricPattern12, pub typeindex: MetricPattern12, pub witness_size: MetricPattern12, } -impl CatalogTree_Inputs { +impl MetricsTree_Inputs { pub fn new(client: Arc, base_path: String) -> Self { Self { count: CountPattern2::new(client.clone(), "input_count".to_string()), first_txinindex: MetricPattern11::new(client.clone(), "first_txinindex".to_string()), outpoint: MetricPattern12::new(client.clone(), "outpoint".to_string()), outputtype: MetricPattern12::new(client.clone(), "outputtype".to_string()), - spent: CatalogTree_Inputs_Spent::new(client.clone(), format!("{base_path}_spent")), + spent: MetricsTree_Inputs_Spent::new(client.clone(), format!("{base_path}_spent")), txindex: MetricPattern12::new(client.clone(), "txindex".to_string()), typeindex: MetricPattern12::new(client.clone(), "typeindex".to_string()), witness_size: MetricPattern12::new(client.clone(), "witness_size".to_string()), @@ -5549,13 +6621,13 @@ impl CatalogTree_Inputs { } } -/// Catalog tree node. -pub struct CatalogTree_Inputs_Spent { +/// Metrics tree node. +pub struct MetricsTree_Inputs_Spent { pub txoutindex: MetricPattern12, pub value: MetricPattern12, } -impl CatalogTree_Inputs_Spent { +impl MetricsTree_Inputs_Spent { pub fn new(client: Arc, base_path: String) -> Self { Self { txoutindex: MetricPattern12::new(client.clone(), "txoutindex".to_string()), @@ -5564,35 +6636,50 @@ impl CatalogTree_Inputs_Spent { } } -/// Catalog tree node. -pub struct CatalogTree_Market { - pub ath: CatalogTree_Market_Ath, - pub dca: CatalogTree_Market_Dca, - pub indicators: CatalogTree_Market_Indicators, - pub lookback: CatalogTree_Market_Lookback, - pub moving_average: CatalogTree_Market_MovingAverage, - pub range: CatalogTree_Market_Range, - pub returns: CatalogTree_Market_Returns, - pub volatility: CatalogTree_Market_Volatility, +/// Metrics tree node. +pub struct MetricsTree_Market { + pub ath: MetricsTree_Market_Ath, + pub dca: MetricsTree_Market_Dca, + pub indicators: MetricsTree_Market_Indicators, + pub lookback: MetricsTree_Market_Lookback, + pub moving_average: MetricsTree_Market_MovingAverage, + pub range: MetricsTree_Market_Range, + pub returns: MetricsTree_Market_Returns, + pub volatility: MetricsTree_Market_Volatility, } -impl CatalogTree_Market { +impl MetricsTree_Market { pub fn new(client: Arc, base_path: String) -> Self { Self { - ath: CatalogTree_Market_Ath::new(client.clone(), format!("{base_path}_ath")), - dca: CatalogTree_Market_Dca::new(client.clone(), format!("{base_path}_dca")), - indicators: CatalogTree_Market_Indicators::new(client.clone(), format!("{base_path}_indicators")), - lookback: CatalogTree_Market_Lookback::new(client.clone(), format!("{base_path}_lookback")), - moving_average: CatalogTree_Market_MovingAverage::new(client.clone(), format!("{base_path}_moving_average")), - range: CatalogTree_Market_Range::new(client.clone(), format!("{base_path}_range")), - returns: CatalogTree_Market_Returns::new(client.clone(), format!("{base_path}_returns")), - volatility: CatalogTree_Market_Volatility::new(client.clone(), format!("{base_path}_volatility")), + ath: MetricsTree_Market_Ath::new(client.clone(), format!("{base_path}_ath")), + dca: MetricsTree_Market_Dca::new(client.clone(), format!("{base_path}_dca")), + indicators: MetricsTree_Market_Indicators::new( + client.clone(), + format!("{base_path}_indicators"), + ), + lookback: MetricsTree_Market_Lookback::new( + client.clone(), + format!("{base_path}_lookback"), + ), + moving_average: MetricsTree_Market_MovingAverage::new( + client.clone(), + format!("{base_path}_moving_average"), + ), + range: MetricsTree_Market_Range::new(client.clone(), format!("{base_path}_range")), + returns: MetricsTree_Market_Returns::new( + client.clone(), + format!("{base_path}_returns"), + ), + volatility: MetricsTree_Market_Volatility::new( + client.clone(), + format!("{base_path}_volatility"), + ), } } } -/// Catalog tree node. -pub struct CatalogTree_Market_Ath { +/// Metrics tree node. +pub struct MetricsTree_Market_Ath { pub days_since_price_ath: MetricPattern4, pub max_days_between_price_aths: MetricPattern4, pub max_years_between_price_aths: MetricPattern4, @@ -5601,24 +6688,36 @@ pub struct CatalogTree_Market_Ath { pub years_since_price_ath: MetricPattern4, } -impl CatalogTree_Market_Ath { +impl MetricsTree_Market_Ath { pub fn new(client: Arc, base_path: String) -> Self { Self { - days_since_price_ath: MetricPattern4::new(client.clone(), "days_since_price_ath".to_string()), - max_days_between_price_aths: MetricPattern4::new(client.clone(), "max_days_between_price_aths".to_string()), - max_years_between_price_aths: MetricPattern4::new(client.clone(), "max_years_between_price_aths".to_string()), + days_since_price_ath: MetricPattern4::new( + client.clone(), + "days_since_price_ath".to_string(), + ), + max_days_between_price_aths: MetricPattern4::new( + client.clone(), + "max_days_between_price_aths".to_string(), + ), + max_years_between_price_aths: MetricPattern4::new( + client.clone(), + "max_years_between_price_aths".to_string(), + ), price_ath: MetricPattern1::new(client.clone(), "price_ath".to_string()), price_drawdown: MetricPattern3::new(client.clone(), "price_drawdown".to_string()), - years_since_price_ath: MetricPattern4::new(client.clone(), "years_since_price_ath".to_string()), + years_since_price_ath: MetricPattern4::new( + client.clone(), + "years_since_price_ath".to_string(), + ), } } } -/// Catalog tree node. -pub struct CatalogTree_Market_Dca { - pub class_average_price: CatalogTree_Market_Dca_ClassAveragePrice, - pub class_returns: CatalogTree_Market_Dca_ClassReturns, - pub class_stack: CatalogTree_Market_Dca_ClassStack, +/// Metrics tree node. +pub struct MetricsTree_Market_Dca { + pub class_average_price: MetricsTree_Market_Dca_ClassAveragePrice, + pub class_returns: MetricsTree_Market_Dca_ClassReturns, + pub class_stack: MetricsTree_Market_Dca_ClassStack, pub period_average_price: PeriodAveragePricePattern, pub period_cagr: PeriodCagrPattern, pub period_lump_sum_stack: PeriodLumpSumStackPattern, @@ -5626,23 +6725,41 @@ pub struct CatalogTree_Market_Dca { pub period_stack: PeriodLumpSumStackPattern, } -impl CatalogTree_Market_Dca { +impl MetricsTree_Market_Dca { pub fn new(client: Arc, base_path: String) -> Self { Self { - class_average_price: CatalogTree_Market_Dca_ClassAveragePrice::new(client.clone(), format!("{base_path}_class_average_price")), - class_returns: CatalogTree_Market_Dca_ClassReturns::new(client.clone(), format!("{base_path}_class_returns")), - class_stack: CatalogTree_Market_Dca_ClassStack::new(client.clone(), format!("{base_path}_class_stack")), - period_average_price: PeriodAveragePricePattern::new(client.clone(), "dca_average_price".to_string()), + class_average_price: MetricsTree_Market_Dca_ClassAveragePrice::new( + client.clone(), + format!("{base_path}_class_average_price"), + ), + class_returns: MetricsTree_Market_Dca_ClassReturns::new( + client.clone(), + format!("{base_path}_class_returns"), + ), + class_stack: MetricsTree_Market_Dca_ClassStack::new( + client.clone(), + format!("{base_path}_class_stack"), + ), + period_average_price: PeriodAveragePricePattern::new( + client.clone(), + "dca_average_price".to_string(), + ), period_cagr: PeriodCagrPattern::new(client.clone(), "dca_cagr".to_string()), - period_lump_sum_stack: PeriodLumpSumStackPattern::new(client.clone(), "lump_sum_stack_btc".to_string()), - period_returns: PeriodAveragePricePattern::new(client.clone(), "dca_returns".to_string()), - period_stack: PeriodLumpSumStackPattern::new(client.clone(), "dca_stack_btc".to_string()), + period_lump_sum_stack: PeriodLumpSumStackPattern::new( + client.clone(), + "lump_sum_stack".to_string(), + ), + period_returns: PeriodAveragePricePattern::new( + client.clone(), + "dca_returns".to_string(), + ), + period_stack: PeriodLumpSumStackPattern::new(client.clone(), "dca_stack".to_string()), } } } -/// Catalog tree node. -pub struct CatalogTree_Market_Dca_ClassAveragePrice { +/// Metrics tree node. +pub struct MetricsTree_Market_Dca_ClassAveragePrice { pub _2015: MetricPattern4, pub _2016: MetricPattern4, pub _2017: MetricPattern4, @@ -5656,7 +6773,7 @@ pub struct CatalogTree_Market_Dca_ClassAveragePrice { pub _2025: MetricPattern4, } -impl CatalogTree_Market_Dca_ClassAveragePrice { +impl MetricsTree_Market_Dca_ClassAveragePrice { pub fn new(client: Arc, base_path: String) -> Self { Self { _2015: MetricPattern4::new(client.clone(), "dca_class_2015_average_price".to_string()), @@ -5674,8 +6791,8 @@ impl CatalogTree_Market_Dca_ClassAveragePrice { } } -/// Catalog tree node. -pub struct CatalogTree_Market_Dca_ClassReturns { +/// Metrics tree node. +pub struct MetricsTree_Market_Dca_ClassReturns { pub _2015: MetricPattern4, pub _2016: MetricPattern4, pub _2017: MetricPattern4, @@ -5689,7 +6806,7 @@ pub struct CatalogTree_Market_Dca_ClassReturns { pub _2025: MetricPattern4, } -impl CatalogTree_Market_Dca_ClassReturns { +impl MetricsTree_Market_Dca_ClassReturns { pub fn new(client: Arc, base_path: String) -> Self { Self { _2015: MetricPattern4::new(client.clone(), "dca_class_2015_returns".to_string()), @@ -5707,8 +6824,8 @@ impl CatalogTree_Market_Dca_ClassReturns { } } -/// Catalog tree node. -pub struct CatalogTree_Market_Dca_ClassStack { +/// Metrics tree node. +pub struct MetricsTree_Market_Dca_ClassStack { pub _2015: _2015Pattern, pub _2016: _2015Pattern, pub _2017: _2015Pattern, @@ -5722,7 +6839,7 @@ pub struct CatalogTree_Market_Dca_ClassStack { pub _2025: _2015Pattern, } -impl CatalogTree_Market_Dca_ClassStack { +impl MetricsTree_Market_Dca_ClassStack { pub fn new(client: Arc, base_path: String) -> Self { Self { _2015: _2015Pattern::new(client.clone(), "dca_class_2015_stack".to_string()), @@ -5740,8 +6857,8 @@ impl CatalogTree_Market_Dca_ClassStack { } } -/// Catalog tree node. -pub struct CatalogTree_Market_Indicators { +/// Metrics tree node. +pub struct MetricsTree_Market_Indicators { pub gini: MetricPattern6, pub macd_histogram: MetricPattern6, pub macd_line: MetricPattern6, @@ -5763,7 +6880,7 @@ pub struct CatalogTree_Market_Indicators { pub stoch_rsi_k: MetricPattern6, } -impl CatalogTree_Market_Indicators { +impl MetricsTree_Market_Indicators { pub fn new(client: Arc, base_path: String) -> Self { Self { gini: MetricPattern6::new(client.clone(), "gini".to_string()), @@ -5776,8 +6893,14 @@ impl CatalogTree_Market_Indicators { rsi_14d: MetricPattern6::new(client.clone(), "rsi_14d".to_string()), rsi_14d_max: MetricPattern6::new(client.clone(), "rsi_14d_max".to_string()), rsi_14d_min: MetricPattern6::new(client.clone(), "rsi_14d_min".to_string()), - rsi_average_gain_14d: MetricPattern6::new(client.clone(), "rsi_average_gain_14d".to_string()), - rsi_average_loss_14d: MetricPattern6::new(client.clone(), "rsi_average_loss_14d".to_string()), + rsi_average_gain_14d: MetricPattern6::new( + client.clone(), + "rsi_average_gain_14d".to_string(), + ), + rsi_average_loss_14d: MetricPattern6::new( + client.clone(), + "rsi_average_loss_14d".to_string(), + ), rsi_gains: MetricPattern6::new(client.clone(), "rsi_gains".to_string()), rsi_losses: MetricPattern6::new(client.clone(), "rsi_losses".to_string()), stoch_d: MetricPattern6::new(client.clone(), "stoch_d".to_string()), @@ -5789,21 +6912,24 @@ impl CatalogTree_Market_Indicators { } } -/// Catalog tree node. -pub struct CatalogTree_Market_Lookback { - pub price_ago: CatalogTree_Market_Lookback_PriceAgo, +/// Metrics tree node. +pub struct MetricsTree_Market_Lookback { + pub price_ago: MetricsTree_Market_Lookback_PriceAgo, } -impl CatalogTree_Market_Lookback { +impl MetricsTree_Market_Lookback { pub fn new(client: Arc, base_path: String) -> Self { Self { - price_ago: CatalogTree_Market_Lookback_PriceAgo::new(client.clone(), format!("{base_path}_price_ago")), + price_ago: MetricsTree_Market_Lookback_PriceAgo::new( + client.clone(), + format!("{base_path}_price_ago"), + ), } } } -/// Catalog tree node. -pub struct CatalogTree_Market_Lookback_PriceAgo { +/// Metrics tree node. +pub struct MetricsTree_Market_Lookback_PriceAgo { pub _10y: MetricPattern4, pub _1d: MetricPattern4, pub _1m: MetricPattern4, @@ -5819,7 +6945,7 @@ pub struct CatalogTree_Market_Lookback_PriceAgo { pub _8y: MetricPattern4, } -impl CatalogTree_Market_Lookback_PriceAgo { +impl MetricsTree_Market_Lookback_PriceAgo { pub fn new(client: Arc, base_path: String) -> Self { Self { _10y: MetricPattern4::new(client.clone(), "price_10y_ago".to_string()), @@ -5839,8 +6965,8 @@ impl CatalogTree_Market_Lookback_PriceAgo { } } -/// Catalog tree node. -pub struct CatalogTree_Market_MovingAverage { +/// Metrics tree node. +pub struct MetricsTree_Market_MovingAverage { pub price_111d_sma: Price111dSmaPattern, pub price_12d_ema: Price111dSmaPattern, pub price_13d_ema: Price111dSmaPattern, @@ -5878,7 +7004,7 @@ pub struct CatalogTree_Market_MovingAverage { pub price_8d_sma: Price111dSmaPattern, } -impl CatalogTree_Market_MovingAverage { +impl MetricsTree_Market_MovingAverage { pub fn new(client: Arc, base_path: String) -> Self { Self { price_111d_sma: Price111dSmaPattern::new(client.clone(), "price_111d_sma".to_string()), @@ -5895,8 +7021,14 @@ impl CatalogTree_Market_MovingAverage { price_1y_sma: Price111dSmaPattern::new(client.clone(), "price_1y_sma".to_string()), price_200d_ema: Price111dSmaPattern::new(client.clone(), "price_200d_ema".to_string()), price_200d_sma: Price111dSmaPattern::new(client.clone(), "price_200d_sma".to_string()), - price_200d_sma_x0_8: MetricPattern4::new(client.clone(), "price_200d_sma_x0_8".to_string()), - price_200d_sma_x2_4: MetricPattern4::new(client.clone(), "price_200d_sma_x2_4".to_string()), + price_200d_sma_x0_8: MetricPattern4::new( + client.clone(), + "price_200d_sma_x0_8".to_string(), + ), + price_200d_sma_x2_4: MetricPattern4::new( + client.clone(), + "price_200d_sma_x2_4".to_string(), + ), price_200w_ema: Price111dSmaPattern::new(client.clone(), "price_200w_ema".to_string()), price_200w_sma: Price111dSmaPattern::new(client.clone(), "price_200w_sma".to_string()), price_21d_ema: Price111dSmaPattern::new(client.clone(), "price_21d_ema".to_string()), @@ -5920,8 +7052,8 @@ impl CatalogTree_Market_MovingAverage { } } -/// Catalog tree node. -pub struct CatalogTree_Market_Range { +/// Metrics tree node. +pub struct MetricsTree_Market_Range { pub price_1m_max: MetricPattern4, pub price_1m_min: MetricPattern4, pub price_1w_max: MetricPattern4, @@ -5935,7 +7067,7 @@ pub struct CatalogTree_Market_Range { pub price_true_range_2w_sum: MetricPattern6, } -impl CatalogTree_Market_Range { +impl MetricsTree_Market_Range { pub fn new(client: Arc, base_path: String) -> Self { Self { price_1m_max: MetricPattern4::new(client.clone(), "price_1m_max".to_string()), @@ -5944,17 +7076,23 @@ impl CatalogTree_Market_Range { price_1w_min: MetricPattern4::new(client.clone(), "price_1w_min".to_string()), price_1y_max: MetricPattern4::new(client.clone(), "price_1y_max".to_string()), price_1y_min: MetricPattern4::new(client.clone(), "price_1y_min".to_string()), - price_2w_choppiness_index: MetricPattern4::new(client.clone(), "price_2w_choppiness_index".to_string()), + price_2w_choppiness_index: MetricPattern4::new( + client.clone(), + "price_2w_choppiness_index".to_string(), + ), price_2w_max: MetricPattern4::new(client.clone(), "price_2w_max".to_string()), price_2w_min: MetricPattern4::new(client.clone(), "price_2w_min".to_string()), price_true_range: MetricPattern6::new(client.clone(), "price_true_range".to_string()), - price_true_range_2w_sum: MetricPattern6::new(client.clone(), "price_true_range_2w_sum".to_string()), + price_true_range_2w_sum: MetricPattern6::new( + client.clone(), + "price_true_range_2w_sum".to_string(), + ), } } } -/// Catalog tree node. -pub struct CatalogTree_Market_Returns { +/// Metrics tree node. +pub struct MetricsTree_Market_Returns { pub _1d_returns_1m_sd: _1dReturns1mSdPattern, pub _1d_returns_1w_sd: _1dReturns1mSdPattern, pub _1d_returns_1y_sd: _1dReturns1mSdPattern, @@ -5963,27 +7101,48 @@ pub struct CatalogTree_Market_Returns { pub downside_1w_sd: _1dReturns1mSdPattern, pub downside_1y_sd: _1dReturns1mSdPattern, pub downside_returns: MetricPattern6, - pub price_returns: CatalogTree_Market_Returns_PriceReturns, + pub price_returns: MetricsTree_Market_Returns_PriceReturns, } -impl CatalogTree_Market_Returns { +impl MetricsTree_Market_Returns { pub fn new(client: Arc, base_path: String) -> Self { Self { - _1d_returns_1m_sd: _1dReturns1mSdPattern::new(client.clone(), "1d_returns_1m_sd".to_string()), - _1d_returns_1w_sd: _1dReturns1mSdPattern::new(client.clone(), "1d_returns_1w_sd".to_string()), - _1d_returns_1y_sd: _1dReturns1mSdPattern::new(client.clone(), "1d_returns_1y_sd".to_string()), + _1d_returns_1m_sd: _1dReturns1mSdPattern::new( + client.clone(), + "1d_returns_1m_sd".to_string(), + ), + _1d_returns_1w_sd: _1dReturns1mSdPattern::new( + client.clone(), + "1d_returns_1w_sd".to_string(), + ), + _1d_returns_1y_sd: _1dReturns1mSdPattern::new( + client.clone(), + "1d_returns_1y_sd".to_string(), + ), cagr: PeriodCagrPattern::new(client.clone(), "cagr".to_string()), - downside_1m_sd: _1dReturns1mSdPattern::new(client.clone(), "downside_1m_sd".to_string()), - downside_1w_sd: _1dReturns1mSdPattern::new(client.clone(), "downside_1w_sd".to_string()), - downside_1y_sd: _1dReturns1mSdPattern::new(client.clone(), "downside_1y_sd".to_string()), + downside_1m_sd: _1dReturns1mSdPattern::new( + client.clone(), + "downside_1m_sd".to_string(), + ), + downside_1w_sd: _1dReturns1mSdPattern::new( + client.clone(), + "downside_1w_sd".to_string(), + ), + downside_1y_sd: _1dReturns1mSdPattern::new( + client.clone(), + "downside_1y_sd".to_string(), + ), downside_returns: MetricPattern6::new(client.clone(), "downside_returns".to_string()), - price_returns: CatalogTree_Market_Returns_PriceReturns::new(client.clone(), format!("{base_path}_price_returns")), + price_returns: MetricsTree_Market_Returns_PriceReturns::new( + client.clone(), + format!("{base_path}_price_returns"), + ), } } } -/// Catalog tree node. -pub struct CatalogTree_Market_Returns_PriceReturns { +/// Metrics tree node. +pub struct MetricsTree_Market_Returns_PriceReturns { pub _10y: MetricPattern4, pub _1d: MetricPattern4, pub _1m: MetricPattern4, @@ -5999,7 +7158,7 @@ pub struct CatalogTree_Market_Returns_PriceReturns { pub _8y: MetricPattern4, } -impl CatalogTree_Market_Returns_PriceReturns { +impl MetricsTree_Market_Returns_PriceReturns { pub fn new(client: Arc, base_path: String) -> Self { Self { _10y: MetricPattern4::new(client.clone(), "10y_price_returns".to_string()), @@ -6019,8 +7178,8 @@ impl CatalogTree_Market_Returns_PriceReturns { } } -/// Catalog tree node. -pub struct CatalogTree_Market_Volatility { +/// Metrics tree node. +pub struct MetricsTree_Market_Volatility { pub price_1m_volatility: MetricPattern4, pub price_1w_volatility: MetricPattern4, pub price_1y_volatility: MetricPattern4, @@ -6032,12 +7191,21 @@ pub struct CatalogTree_Market_Volatility { pub sortino_1y: MetricPattern6, } -impl CatalogTree_Market_Volatility { +impl MetricsTree_Market_Volatility { pub fn new(client: Arc, base_path: String) -> Self { Self { - price_1m_volatility: MetricPattern4::new(client.clone(), "price_1m_volatility".to_string()), - price_1w_volatility: MetricPattern4::new(client.clone(), "price_1w_volatility".to_string()), - price_1y_volatility: MetricPattern4::new(client.clone(), "price_1y_volatility".to_string()), + price_1m_volatility: MetricPattern4::new( + client.clone(), + "price_1m_volatility".to_string(), + ), + price_1w_volatility: MetricPattern4::new( + client.clone(), + "price_1w_volatility".to_string(), + ), + price_1y_volatility: MetricPattern4::new( + client.clone(), + "price_1y_volatility".to_string(), + ), sharpe_1m: MetricPattern6::new(client.clone(), "sharpe_1m".to_string()), sharpe_1w: MetricPattern6::new(client.clone(), "sharpe_1w".to_string()), sharpe_1y: MetricPattern6::new(client.clone(), "sharpe_1y".to_string()), @@ -6048,24 +7216,24 @@ impl CatalogTree_Market_Volatility { } } -/// Catalog tree node. -pub struct CatalogTree_Outputs { - pub count: CatalogTree_Outputs_Count, +/// Metrics tree node. +pub struct MetricsTree_Outputs { + pub count: MetricsTree_Outputs_Count, pub first_txoutindex: MetricPattern11, pub outputtype: MetricPattern15, - pub spent: CatalogTree_Outputs_Spent, + pub spent: MetricsTree_Outputs_Spent, pub txindex: MetricPattern15, pub typeindex: MetricPattern15, pub value: MetricPattern15, } -impl CatalogTree_Outputs { +impl MetricsTree_Outputs { pub fn new(client: Arc, base_path: String) -> Self { Self { - count: CatalogTree_Outputs_Count::new(client.clone(), format!("{base_path}_count")), + count: MetricsTree_Outputs_Count::new(client.clone(), format!("{base_path}_count")), first_txoutindex: MetricPattern11::new(client.clone(), "first_txoutindex".to_string()), outputtype: MetricPattern15::new(client.clone(), "outputtype".to_string()), - spent: CatalogTree_Outputs_Spent::new(client.clone(), format!("{base_path}_spent")), + spent: MetricsTree_Outputs_Spent::new(client.clone(), format!("{base_path}_spent")), txindex: MetricPattern15::new(client.clone(), "txindex".to_string()), typeindex: MetricPattern15::new(client.clone(), "typeindex".to_string()), value: MetricPattern15::new(client.clone(), "value".to_string()), @@ -6073,13 +7241,13 @@ impl CatalogTree_Outputs { } } -/// Catalog tree node. -pub struct CatalogTree_Outputs_Count { +/// Metrics tree node. +pub struct MetricsTree_Outputs_Count { pub total_count: CountPattern2, pub utxo_count: MetricPattern1, } -impl CatalogTree_Outputs_Count { +impl MetricsTree_Outputs_Count { pub fn new(client: Arc, base_path: String) -> Self { Self { total_count: CountPattern2::new(client.clone(), "output_count".to_string()), @@ -6088,12 +7256,12 @@ impl CatalogTree_Outputs_Count { } } -/// Catalog tree node. -pub struct CatalogTree_Outputs_Spent { +/// Metrics tree node. +pub struct MetricsTree_Outputs_Spent { pub txinindex: MetricPattern15, } -impl CatalogTree_Outputs_Spent { +impl MetricsTree_Outputs_Spent { pub fn new(client: Arc, base_path: String) -> Self { Self { txinindex: MetricPattern15::new(client.clone(), "txinindex".to_string()), @@ -6101,23 +7269,23 @@ impl CatalogTree_Outputs_Spent { } } -/// Catalog tree node. -pub struct CatalogTree_Pools { +/// Metrics tree node. +pub struct MetricsTree_Pools { pub height_to_pool: MetricPattern11, - pub vecs: CatalogTree_Pools_Vecs, + pub vecs: MetricsTree_Pools_Vecs, } -impl CatalogTree_Pools { +impl MetricsTree_Pools { pub fn new(client: Arc, base_path: String) -> Self { Self { height_to_pool: MetricPattern11::new(client.clone(), "pool".to_string()), - vecs: CatalogTree_Pools_Vecs::new(client.clone(), format!("{base_path}_vecs")), + vecs: MetricsTree_Pools_Vecs::new(client.clone(), format!("{base_path}_vecs")), } } } -/// Catalog tree node. -pub struct CatalogTree_Pools_Vecs { +/// Metrics tree node. +pub struct MetricsTree_Pools_Vecs { pub aaopool: AaopoolPattern, pub antpool: AaopoolPattern, pub arkpool: AaopoolPattern, @@ -6278,7 +7446,7 @@ pub struct CatalogTree_Pools_Vecs { pub zulupool: AaopoolPattern, } -impl CatalogTree_Pools_Vecs { +impl MetricsTree_Pools_Vecs { pub fn new(client: Arc, base_path: String) -> Self { Self { aaopool: AaopoolPattern::new(client.clone(), "aaopool".to_string()), @@ -6292,7 +7460,10 @@ impl CatalogTree_Pools_Vecs { binancepool: AaopoolPattern::new(client.clone(), "binancepool".to_string()), bitalo: AaopoolPattern::new(client.clone(), "bitalo".to_string()), bitclub: AaopoolPattern::new(client.clone(), "bitclub".to_string()), - bitcoinaffiliatenetwork: AaopoolPattern::new(client.clone(), "bitcoinaffiliatenetwork".to_string()), + bitcoinaffiliatenetwork: AaopoolPattern::new( + client.clone(), + "bitcoinaffiliatenetwork".to_string(), + ), bitcoincom: AaopoolPattern::new(client.clone(), "bitcoincom".to_string()), bitcoinindia: AaopoolPattern::new(client.clone(), "bitcoinindia".to_string()), bitcoinrussia: AaopoolPattern::new(client.clone(), "bitcoinrussia".to_string()), @@ -6338,13 +7509,19 @@ impl CatalogTree_Pools_Vecs { ekanembtc: AaopoolPattern::new(client.clone(), "ekanembtc".to_string()), eligius: AaopoolPattern::new(client.clone(), "eligius".to_string()), emcdpool: AaopoolPattern::new(client.clone(), "emcdpool".to_string()), - entrustcharitypool: AaopoolPattern::new(client.clone(), "entrustcharitypool".to_string()), + entrustcharitypool: AaopoolPattern::new( + client.clone(), + "entrustcharitypool".to_string(), + ), eobot: AaopoolPattern::new(client.clone(), "eobot".to_string()), exxbw: AaopoolPattern::new(client.clone(), "exxbw".to_string()), f2pool: AaopoolPattern::new(client.clone(), "f2pool".to_string()), fiftyeightcoin: AaopoolPattern::new(client.clone(), "fiftyeightcoin".to_string()), foundryusa: AaopoolPattern::new(client.clone(), "foundryusa".to_string()), - futurebitapollosolo: AaopoolPattern::new(client.clone(), "futurebitapollosolo".to_string()), + futurebitapollosolo: AaopoolPattern::new( + client.clone(), + "futurebitapollosolo".to_string(), + ), gbminers: AaopoolPattern::new(client.clone(), "gbminers".to_string()), ghashio: AaopoolPattern::new(client.clone(), "ghashio".to_string()), givemecoins: AaopoolPattern::new(client.clone(), "givemecoins".to_string()), @@ -6425,7 +7602,10 @@ impl CatalogTree_Pools_Vecs { tiger: AaopoolPattern::new(client.clone(), "tiger".to_string()), tigerpoolnet: AaopoolPattern::new(client.clone(), "tigerpoolnet".to_string()), titan: AaopoolPattern::new(client.clone(), "titan".to_string()), - transactioncoinmining: AaopoolPattern::new(client.clone(), "transactioncoinmining".to_string()), + transactioncoinmining: AaopoolPattern::new( + client.clone(), + "transactioncoinmining".to_string(), + ), trickysbtcpool: AaopoolPattern::new(client.clone(), "trickysbtcpool".to_string()), triplemining: AaopoolPattern::new(client.clone(), "triplemining".to_string()), twentyoneinc: AaopoolPattern::new(client.clone(), "twentyoneinc".to_string()), @@ -6443,13 +7623,13 @@ impl CatalogTree_Pools_Vecs { } } -/// Catalog tree node. -pub struct CatalogTree_Positions { +/// Metrics tree node. +pub struct MetricsTree_Positions { pub block_position: MetricPattern11, pub tx_position: MetricPattern27, } -impl CatalogTree_Positions { +impl MetricsTree_Positions { pub fn new(client: Arc, base_path: String) -> Self { Self { block_position: MetricPattern11::new(client.clone(), "position".to_string()), @@ -6458,47 +7638,47 @@ impl CatalogTree_Positions { } } -/// Catalog tree node. -pub struct CatalogTree_Price { - pub cents: CatalogTree_Price_Cents, - pub sats: CatalogTree_Price_Sats, - pub usd: CatalogTree_Price_Usd, +/// Metrics tree node. +pub struct MetricsTree_Price { + pub cents: MetricsTree_Price_Cents, + pub sats: MetricsTree_Price_Sats, + pub usd: MetricsTree_Price_Usd, } -impl CatalogTree_Price { +impl MetricsTree_Price { pub fn new(client: Arc, base_path: String) -> Self { Self { - cents: CatalogTree_Price_Cents::new(client.clone(), format!("{base_path}_cents")), - sats: CatalogTree_Price_Sats::new(client.clone(), format!("{base_path}_sats")), - usd: CatalogTree_Price_Usd::new(client.clone(), format!("{base_path}_usd")), + cents: MetricsTree_Price_Cents::new(client.clone(), format!("{base_path}_cents")), + sats: MetricsTree_Price_Sats::new(client.clone(), format!("{base_path}_sats")), + usd: MetricsTree_Price_Usd::new(client.clone(), format!("{base_path}_usd")), } } } -/// Catalog tree node. -pub struct CatalogTree_Price_Cents { +/// Metrics tree node. +pub struct MetricsTree_Price_Cents { pub ohlc: MetricPattern5, - pub split: CatalogTree_Price_Cents_Split, + pub split: MetricsTree_Price_Cents_Split, } -impl CatalogTree_Price_Cents { +impl MetricsTree_Price_Cents { pub fn new(client: Arc, base_path: String) -> Self { Self { ohlc: MetricPattern5::new(client.clone(), "ohlc_cents".to_string()), - split: CatalogTree_Price_Cents_Split::new(client.clone(), format!("{base_path}_split")), + split: MetricsTree_Price_Cents_Split::new(client.clone(), format!("{base_path}_split")), } } } -/// Catalog tree node. -pub struct CatalogTree_Price_Cents_Split { +/// Metrics tree node. +pub struct MetricsTree_Price_Cents_Split { pub close: MetricPattern5, pub high: MetricPattern5, pub low: MetricPattern5, pub open: MetricPattern5, } -impl CatalogTree_Price_Cents_Split { +impl MetricsTree_Price_Cents_Split { pub fn new(client: Arc, base_path: String) -> Self { Self { close: MetricPattern5::new(client.clone(), "price_close_cents".to_string()), @@ -6509,13 +7689,13 @@ impl CatalogTree_Price_Cents_Split { } } -/// Catalog tree node. -pub struct CatalogTree_Price_Sats { +/// Metrics tree node. +pub struct MetricsTree_Price_Sats { pub ohlc: MetricPattern1, pub split: SplitPattern2, } -impl CatalogTree_Price_Sats { +impl MetricsTree_Price_Sats { pub fn new(client: Arc, base_path: String) -> Self { Self { ohlc: MetricPattern1::new(client.clone(), "price_ohlc_sats".to_string()), @@ -6524,13 +7704,13 @@ impl CatalogTree_Price_Sats { } } -/// Catalog tree node. -pub struct CatalogTree_Price_Usd { +/// Metrics tree node. +pub struct MetricsTree_Price_Usd { pub ohlc: MetricPattern1, pub split: SplitPattern2, } -impl CatalogTree_Price_Usd { +impl MetricsTree_Price_Usd { pub fn new(client: Arc, base_path: String) -> Self { Self { ohlc: MetricPattern1::new(client.clone(), "price_ohlc".to_string()), @@ -6539,9 +7719,9 @@ impl CatalogTree_Price_Usd { } } -/// Catalog tree node. -pub struct CatalogTree_Scripts { - pub count: CatalogTree_Scripts_Count, +/// Metrics tree node. +pub struct MetricsTree_Scripts { + pub count: MetricsTree_Scripts_Count, pub empty_to_txindex: MetricPattern9, pub first_emptyoutputindex: MetricPattern11, pub first_opreturnindex: MetricPattern11, @@ -6550,28 +7730,40 @@ pub struct CatalogTree_Scripts { pub opreturn_to_txindex: MetricPattern14, pub p2ms_to_txindex: MetricPattern17, pub unknown_to_txindex: MetricPattern28, - pub value: CatalogTree_Scripts_Value, + pub value: MetricsTree_Scripts_Value, } -impl CatalogTree_Scripts { +impl MetricsTree_Scripts { pub fn new(client: Arc, base_path: String) -> Self { Self { - count: CatalogTree_Scripts_Count::new(client.clone(), format!("{base_path}_count")), + count: MetricsTree_Scripts_Count::new(client.clone(), format!("{base_path}_count")), empty_to_txindex: MetricPattern9::new(client.clone(), "txindex".to_string()), - first_emptyoutputindex: MetricPattern11::new(client.clone(), "first_emptyoutputindex".to_string()), - first_opreturnindex: MetricPattern11::new(client.clone(), "first_opreturnindex".to_string()), - first_p2msoutputindex: MetricPattern11::new(client.clone(), "first_p2msoutputindex".to_string()), - first_unknownoutputindex: MetricPattern11::new(client.clone(), "first_unknownoutputindex".to_string()), + first_emptyoutputindex: MetricPattern11::new( + client.clone(), + "first_emptyoutputindex".to_string(), + ), + first_opreturnindex: MetricPattern11::new( + client.clone(), + "first_opreturnindex".to_string(), + ), + first_p2msoutputindex: MetricPattern11::new( + client.clone(), + "first_p2msoutputindex".to_string(), + ), + first_unknownoutputindex: MetricPattern11::new( + client.clone(), + "first_unknownoutputindex".to_string(), + ), opreturn_to_txindex: MetricPattern14::new(client.clone(), "txindex".to_string()), p2ms_to_txindex: MetricPattern17::new(client.clone(), "txindex".to_string()), unknown_to_txindex: MetricPattern28::new(client.clone(), "txindex".to_string()), - value: CatalogTree_Scripts_Value::new(client.clone(), format!("{base_path}_value")), + value: MetricsTree_Scripts_Value::new(client.clone(), format!("{base_path}_value")), } } } -/// Catalog tree node. -pub struct CatalogTree_Scripts_Count { +/// Metrics tree node. +pub struct MetricsTree_Scripts_Count { pub emptyoutput: DollarsPattern, pub opreturn: DollarsPattern, pub p2a: DollarsPattern, @@ -6589,7 +7781,7 @@ pub struct CatalogTree_Scripts_Count { pub unknownoutput: DollarsPattern, } -impl CatalogTree_Scripts_Count { +impl MetricsTree_Scripts_Count { pub fn new(client: Arc, base_path: String) -> Self { Self { emptyoutput: DollarsPattern::new(client.clone(), "emptyoutput_count".to_string()), @@ -6604,19 +7796,25 @@ impl CatalogTree_Scripts_Count { p2wpkh: DollarsPattern::new(client.clone(), "p2wpkh_count".to_string()), p2wsh: DollarsPattern::new(client.clone(), "p2wsh_count".to_string()), segwit: DollarsPattern::new(client.clone(), "segwit_count".to_string()), - segwit_adoption: SegwitAdoptionPattern::new(client.clone(), "segwit_adoption".to_string()), - taproot_adoption: SegwitAdoptionPattern::new(client.clone(), "taproot_adoption".to_string()), + segwit_adoption: SegwitAdoptionPattern::new( + client.clone(), + "segwit_adoption".to_string(), + ), + taproot_adoption: SegwitAdoptionPattern::new( + client.clone(), + "taproot_adoption".to_string(), + ), unknownoutput: DollarsPattern::new(client.clone(), "unknownoutput_count".to_string()), } } } -/// Catalog tree node. -pub struct CatalogTree_Scripts_Value { +/// Metrics tree node. +pub struct MetricsTree_Scripts_Value { pub opreturn: CoinbasePattern, } -impl CatalogTree_Scripts_Value { +impl MetricsTree_Scripts_Value { pub fn new(client: Arc, base_path: String) -> Self { Self { opreturn: CoinbasePattern::new(client.clone(), "opreturn_value".to_string()), @@ -6624,50 +7822,59 @@ impl CatalogTree_Scripts_Value { } } -/// Catalog tree node. -pub struct CatalogTree_Supply { - pub burned: CatalogTree_Supply_Burned, - pub circulating: CatalogTree_Supply_Circulating, +/// Metrics tree node. +pub struct MetricsTree_Supply { + pub burned: MetricsTree_Supply_Burned, + pub circulating: MetricsTree_Supply_Circulating, pub inflation: MetricPattern4, pub market_cap: MetricPattern1, - pub velocity: CatalogTree_Supply_Velocity, + pub velocity: MetricsTree_Supply_Velocity, } -impl CatalogTree_Supply { +impl MetricsTree_Supply { pub fn new(client: Arc, base_path: String) -> Self { Self { - burned: CatalogTree_Supply_Burned::new(client.clone(), format!("{base_path}_burned")), - circulating: CatalogTree_Supply_Circulating::new(client.clone(), format!("{base_path}_circulating")), + burned: MetricsTree_Supply_Burned::new(client.clone(), format!("{base_path}_burned")), + circulating: MetricsTree_Supply_Circulating::new( + client.clone(), + format!("{base_path}_circulating"), + ), inflation: MetricPattern4::new(client.clone(), "inflation_rate".to_string()), market_cap: MetricPattern1::new(client.clone(), "market_cap".to_string()), - velocity: CatalogTree_Supply_Velocity::new(client.clone(), format!("{base_path}_velocity")), + velocity: MetricsTree_Supply_Velocity::new( + client.clone(), + format!("{base_path}_velocity"), + ), } } } -/// Catalog tree node. -pub struct CatalogTree_Supply_Burned { +/// Metrics tree node. +pub struct MetricsTree_Supply_Burned { pub opreturn: UnclaimedRewardsPattern, pub unspendable: UnclaimedRewardsPattern, } -impl CatalogTree_Supply_Burned { +impl MetricsTree_Supply_Burned { pub fn new(client: Arc, base_path: String) -> Self { Self { opreturn: UnclaimedRewardsPattern::new(client.clone(), "opreturn_supply".to_string()), - unspendable: UnclaimedRewardsPattern::new(client.clone(), "unspendable_supply".to_string()), + unspendable: UnclaimedRewardsPattern::new( + client.clone(), + "unspendable_supply".to_string(), + ), } } } -/// Catalog tree node. -pub struct CatalogTree_Supply_Circulating { +/// Metrics tree node. +pub struct MetricsTree_Supply_Circulating { pub bitcoin: MetricPattern3, pub dollars: MetricPattern3, pub sats: MetricPattern3, } -impl CatalogTree_Supply_Circulating { +impl MetricsTree_Supply_Circulating { pub fn new(client: Arc, base_path: String) -> Self { Self { bitcoin: MetricPattern3::new(client.clone(), "circulating_supply_btc".to_string()), @@ -6677,13 +7884,13 @@ impl CatalogTree_Supply_Circulating { } } -/// Catalog tree node. -pub struct CatalogTree_Supply_Velocity { +/// Metrics tree node. +pub struct MetricsTree_Supply_Velocity { pub btc: MetricPattern4, pub usd: MetricPattern4, } -impl CatalogTree_Supply_Velocity { +impl MetricsTree_Supply_Velocity { pub fn new(client: Arc, base_path: String) -> Self { Self { btc: MetricPattern4::new(client.clone(), "btc_velocity".to_string()), @@ -6692,54 +7899,66 @@ impl CatalogTree_Supply_Velocity { } } -/// Catalog tree node. -pub struct CatalogTree_Transactions { +/// Metrics tree node. +pub struct MetricsTree_Transactions { pub base_size: MetricPattern27, - pub count: CatalogTree_Transactions_Count, - pub fees: CatalogTree_Transactions_Fees, + pub count: MetricsTree_Transactions_Count, + pub fees: MetricsTree_Transactions_Fees, pub first_txindex: MetricPattern11, pub first_txinindex: MetricPattern27, pub first_txoutindex: MetricPattern27, pub height: MetricPattern27, pub is_explicitly_rbf: MetricPattern27, pub rawlocktime: MetricPattern27, - pub size: CatalogTree_Transactions_Size, + pub size: MetricsTree_Transactions_Size, pub total_size: MetricPattern27, pub txid: MetricPattern27, pub txversion: MetricPattern27, - pub versions: CatalogTree_Transactions_Versions, - pub volume: CatalogTree_Transactions_Volume, + pub versions: MetricsTree_Transactions_Versions, + pub volume: MetricsTree_Transactions_Volume, } -impl CatalogTree_Transactions { +impl MetricsTree_Transactions { pub fn new(client: Arc, base_path: String) -> Self { Self { base_size: MetricPattern27::new(client.clone(), "base_size".to_string()), - count: CatalogTree_Transactions_Count::new(client.clone(), format!("{base_path}_count")), - fees: CatalogTree_Transactions_Fees::new(client.clone(), format!("{base_path}_fees")), + count: MetricsTree_Transactions_Count::new( + client.clone(), + format!("{base_path}_count"), + ), + fees: MetricsTree_Transactions_Fees::new(client.clone(), format!("{base_path}_fees")), first_txindex: MetricPattern11::new(client.clone(), "first_txindex".to_string()), first_txinindex: MetricPattern27::new(client.clone(), "first_txinindex".to_string()), first_txoutindex: MetricPattern27::new(client.clone(), "first_txoutindex".to_string()), height: MetricPattern27::new(client.clone(), "height".to_string()), - is_explicitly_rbf: MetricPattern27::new(client.clone(), "is_explicitly_rbf".to_string()), + is_explicitly_rbf: MetricPattern27::new( + client.clone(), + "is_explicitly_rbf".to_string(), + ), rawlocktime: MetricPattern27::new(client.clone(), "rawlocktime".to_string()), - size: CatalogTree_Transactions_Size::new(client.clone(), format!("{base_path}_size")), + size: MetricsTree_Transactions_Size::new(client.clone(), format!("{base_path}_size")), total_size: MetricPattern27::new(client.clone(), "total_size".to_string()), txid: MetricPattern27::new(client.clone(), "txid".to_string()), txversion: MetricPattern27::new(client.clone(), "txversion".to_string()), - versions: CatalogTree_Transactions_Versions::new(client.clone(), format!("{base_path}_versions")), - volume: CatalogTree_Transactions_Volume::new(client.clone(), format!("{base_path}_volume")), + versions: MetricsTree_Transactions_Versions::new( + client.clone(), + format!("{base_path}_versions"), + ), + volume: MetricsTree_Transactions_Volume::new( + client.clone(), + format!("{base_path}_volume"), + ), } } } -/// Catalog tree node. -pub struct CatalogTree_Transactions_Count { +/// Metrics tree node. +pub struct MetricsTree_Transactions_Count { pub is_coinbase: MetricPattern27, pub tx_count: DollarsPattern, } -impl CatalogTree_Transactions_Count { +impl MetricsTree_Transactions_Count { pub fn new(client: Arc, base_path: String) -> Self { Self { is_coinbase: MetricPattern27::new(client.clone(), "is_coinbase".to_string()), @@ -6748,18 +7967,18 @@ impl CatalogTree_Transactions_Count { } } -/// Catalog tree node. -pub struct CatalogTree_Transactions_Fees { - pub fee: CatalogTree_Transactions_Fees_Fee, +/// Metrics tree node. +pub struct MetricsTree_Transactions_Fees { + pub fee: MetricsTree_Transactions_Fees_Fee, pub fee_rate: FeeRatePattern, pub input_value: MetricPattern27, pub output_value: MetricPattern27, } -impl CatalogTree_Transactions_Fees { +impl MetricsTree_Transactions_Fees { pub fn new(client: Arc, base_path: String) -> Self { Self { - fee: CatalogTree_Transactions_Fees_Fee::new(client.clone(), format!("{base_path}_fee")), + fee: MetricsTree_Transactions_Fees_Fee::new(client.clone(), format!("{base_path}_fee")), fee_rate: FeeRatePattern::new(client.clone(), "fee_rate".to_string()), input_value: MetricPattern27::new(client.clone(), "input_value".to_string()), output_value: MetricPattern27::new(client.clone(), "output_value".to_string()), @@ -6767,27 +7986,30 @@ impl CatalogTree_Transactions_Fees { } } -/// Catalog tree node. -pub struct CatalogTree_Transactions_Fees_Fee { +/// Metrics tree node. +pub struct MetricsTree_Transactions_Fees_Fee { pub bitcoin: CountPattern2, - pub dollars: CatalogTree_Transactions_Fees_Fee_Dollars, + pub dollars: MetricsTree_Transactions_Fees_Fee_Dollars, pub sats: CountPattern2, pub txindex: MetricPattern27, } -impl CatalogTree_Transactions_Fees_Fee { +impl MetricsTree_Transactions_Fees_Fee { pub fn new(client: Arc, base_path: String) -> Self { Self { bitcoin: CountPattern2::new(client.clone(), "fee_btc".to_string()), - dollars: CatalogTree_Transactions_Fees_Fee_Dollars::new(client.clone(), format!("{base_path}_dollars")), + dollars: MetricsTree_Transactions_Fees_Fee_Dollars::new( + client.clone(), + format!("{base_path}_dollars"), + ), sats: CountPattern2::new(client.clone(), "fee".to_string()), txindex: MetricPattern27::new(client.clone(), "fee".to_string()), } } } -/// Catalog tree node. -pub struct CatalogTree_Transactions_Fees_Fee_Dollars { +/// Metrics tree node. +pub struct MetricsTree_Transactions_Fees_Fee_Dollars { pub average: MetricPattern1, pub cumulative: MetricPattern2, pub height_cumulative: MetricPattern11, @@ -6801,12 +8023,15 @@ pub struct CatalogTree_Transactions_Fees_Fee_Dollars { pub sum: MetricPattern1, } -impl CatalogTree_Transactions_Fees_Fee_Dollars { +impl MetricsTree_Transactions_Fees_Fee_Dollars { pub fn new(client: Arc, base_path: String) -> Self { Self { average: MetricPattern1::new(client.clone(), "fee_usd_average".to_string()), cumulative: MetricPattern2::new(client.clone(), "fee_usd_cumulative".to_string()), - height_cumulative: MetricPattern11::new(client.clone(), "fee_usd_cumulative".to_string()), + height_cumulative: MetricPattern11::new( + client.clone(), + "fee_usd_cumulative".to_string(), + ), max: MetricPattern1::new(client.clone(), "fee_usd_max".to_string()), median: MetricPattern11::new(client.clone(), "fee_usd_median".to_string()), min: MetricPattern1::new(client.clone(), "fee_usd_min".to_string()), @@ -6819,13 +8044,13 @@ impl CatalogTree_Transactions_Fees_Fee_Dollars { } } -/// Catalog tree node. -pub struct CatalogTree_Transactions_Size { +/// Metrics tree node. +pub struct MetricsTree_Transactions_Size { pub vsize: FeeRatePattern, pub weight: FeeRatePattern, } -impl CatalogTree_Transactions_Size { +impl MetricsTree_Transactions_Size { pub fn new(client: Arc, base_path: String) -> Self { Self { vsize: FeeRatePattern::new(client.clone(), "tx_vsize_average".to_string()), @@ -6834,14 +8059,14 @@ impl CatalogTree_Transactions_Size { } } -/// Catalog tree node. -pub struct CatalogTree_Transactions_Versions { +/// Metrics tree node. +pub struct MetricsTree_Transactions_Versions { pub v1: BlockCountPattern, pub v2: BlockCountPattern, pub v3: BlockCountPattern, } -impl CatalogTree_Transactions_Versions { +impl MetricsTree_Transactions_Versions { pub fn new(client: Arc, base_path: String) -> Self { Self { v1: BlockCountPattern::new(client.clone(), "tx_v1".to_string()), @@ -6851,8 +8076,8 @@ impl CatalogTree_Transactions_Versions { } } -/// Catalog tree node. -pub struct CatalogTree_Transactions_Volume { +/// Metrics tree node. +pub struct MetricsTree_Transactions_Volume { pub annualized_volume: _2015Pattern, pub inputs_per_sec: MetricPattern4, pub outputs_per_sec: MetricPattern4, @@ -6860,7 +8085,7 @@ pub struct CatalogTree_Transactions_Volume { pub tx_per_sec: MetricPattern4, } -impl CatalogTree_Transactions_Volume { +impl MetricsTree_Transactions_Volume { pub fn new(client: Arc, base_path: String) -> Self { Self { annualized_volume: _2015Pattern::new(client.clone(), "annualized_volume".to_string()), @@ -6872,10 +8097,10 @@ impl CatalogTree_Transactions_Volume { } } -/// Main BRK client with catalog tree and API methods. +/// Main BRK client with metrics tree and API methods. pub struct BrkClient { base: Arc, - tree: CatalogTree, + metrics: MetricsTree, } impl BrkClient { @@ -6885,377 +8110,518 @@ impl BrkClient { /// Create a new client with the given base URL. pub fn new(base_url: impl Into) -> Self { let base = Arc::new(BrkClientBase::new(base_url)); - let tree = CatalogTree::new(base.clone(), String::new()); - Self { base, tree } + let metrics = MetricsTree::new(base.clone(), String::new()); + Self { base, metrics } } /// Create a new client with options. pub fn with_options(options: BrkClientOptions) -> Self { let base = Arc::new(BrkClientBase::with_options(options)); - let tree = CatalogTree::new(base.clone(), String::new()); - Self { base, tree } + let metrics = MetricsTree::new(base.clone(), String::new()); + Self { base, metrics } } - /// Get the catalog tree for navigating metrics. - pub fn tree(&self) -> &CatalogTree { - &self.tree + /// Get the metrics tree for navigating metrics. + pub fn metrics(&self) -> &MetricsTree { + &self.metrics } /// 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.). - pub fn get_address(&self, address: &str) -> Result { - self.base.get(&format!("/api/address/{address}")) + pub fn get_address(&self, address: Address) -> Result { + self.base.get_json(&format!("/api/address/{address}")) } /// Address transaction IDs /// /// Get transaction IDs for an address, newest first. Use after_txid for pagination. - pub fn get_address_txs(&self, address: &str, after_txid: Option<&str>, limit: Option<&str>) -> Result> { + pub fn get_address_txs( + &self, + address: Address, + after_txid: Option<&str>, + limit: Option, + ) -> Result> { let mut query = Vec::new(); - if let Some(v) = after_txid { query.push(format!("after_txid={}", v)); } - if let Some(v) = limit { query.push(format!("limit={}", v)); } - let query_str = if query.is_empty() { String::new() } else { format!("?{}", query.join("&")) }; - self.base.get(&format!("/api/address/{address}/txs{}", query_str)) + if let Some(v) = after_txid { + query.push(format!("after_txid={}", v)); + } + if let Some(v) = limit { + query.push(format!("limit={}", v)); + } + let query_str = if query.is_empty() { + String::new() + } else { + format!("?{}", query.join("&")) + }; + let path = format!("/api/address/{address}/txs{}", query_str); + self.base.get_json(&path) } /// Address confirmed transactions /// /// Get confirmed transaction IDs for an address, 25 per page. Use ?after_txid= for pagination. - pub fn get_address_txs_chain(&self, address: &str, after_txid: Option<&str>, limit: Option<&str>) -> Result> { + pub fn get_address_txs_chain( + &self, + address: Address, + after_txid: Option<&str>, + limit: Option, + ) -> Result> { let mut query = Vec::new(); - if let Some(v) = after_txid { query.push(format!("after_txid={}", v)); } - if let Some(v) = limit { query.push(format!("limit={}", v)); } - let query_str = if query.is_empty() { String::new() } else { format!("?{}", query.join("&")) }; - self.base.get(&format!("/api/address/{address}/txs/chain{}", query_str)) + if let Some(v) = after_txid { + query.push(format!("after_txid={}", v)); + } + if let Some(v) = limit { + query.push(format!("limit={}", v)); + } + let query_str = if query.is_empty() { + String::new() + } else { + format!("?{}", query.join("&")) + }; + let path = format!("/api/address/{address}/txs/chain{}", query_str); + self.base.get_json(&path) } /// Address mempool transactions /// /// Get unconfirmed transaction IDs for an address from the mempool (up to 50). - pub fn get_address_txs_mempool(&self, address: &str) -> Result> { - self.base.get(&format!("/api/address/{address}/txs/mempool")) + pub fn get_address_txs_mempool(&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: &str) -> Result> { - self.base.get(&format!("/api/address/{address}/utxo")) + pub fn get_address_utxo(&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: &str) -> Result { - self.base.get(&format!("/api/block-height/{height}")) + pub fn get_block_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: &str) -> Result { - self.base.get(&format!("/api/block/{hash}")) + pub fn get_block_by_hash(&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: &str) -> Result> { - self.base.get(&format!("/api/block/{hash}/raw")) + pub fn get_block_by_hash_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: &str) -> Result { - self.base.get(&format!("/api/block/{hash}/status")) + pub fn get_block_by_hash_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: &str, index: &str) -> Result { - self.base.get(&format!("/api/block/{hash}/txid/{index}")) + pub fn get_block_by_hash_txid_by_index(&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: &str) -> Result> { - self.base.get(&format!("/api/block/{hash}/txids")) + pub fn get_block_by_hash_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: &str, start_index: &str) -> Result> { - self.base.get(&format!("/api/block/{hash}/txs/{start_index}")) + pub fn get_block_by_hash_txs_by_start_index( + &self, + hash: BlockHash, + start_index: TxIndex, + ) -> Result> { + self.base + .get_json(&format!("/api/block/{hash}/txs/{start_index}")) } /// Recent blocks /// /// Retrieve the last 10 blocks. Returns block metadata for each block. pub fn get_blocks(&self) -> Result> { - self.base.get(&format!("/api/blocks")) + self.base.get_json(&format!("/api/blocks")) } /// 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: &str) -> Result> { - self.base.get(&format!("/api/blocks/{height}")) + pub fn get_blocks_by_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 { - self.base.get(&format!("/api/mempool/info")) + self.base.get_json(&format!("/api/mempool/info")) } /// Mempool transaction IDs /// /// Get all transaction IDs currently in the mempool. pub fn get_mempool_txids(&self) -> Result> { - self.base.get(&format!("/api/mempool/txids")) + 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: &str) -> Result> { - self.base.get(&format!("/api/metric/{metric}")) + pub fn get_metric(&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(&self, index: &str, metric: &str, count: Option<&str>, format: Option<&str>, from: Option<&str>, to: Option<&str>) -> Result { + pub fn get_metric_by_index( + &self, + metric: Metric, + index: Index, + start: Option, + end: Option, + count: Option, + format: Option, + ) -> Result> { let mut query = Vec::new(); - if let Some(v) = count { query.push(format!("count={}", v)); } - if let Some(v) = format { query.push(format!("format={}", v)); } - if let Some(v) = from { query.push(format!("from={}", v)); } - if let Some(v) = to { query.push(format!("to={}", v)); } - let query_str = if query.is_empty() { String::new() } else { format!("?{}", query.join("&")) }; - self.base.get(&format!("/api/metric/{metric}/{index}{}", query_str)) - } - - /// 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(&self, count: Option<&str>, format: Option<&str>, from: Option<&str>, index: &str, metrics: &str, to: Option<&str>) -> Result> { - let mut query = Vec::new(); - if let Some(v) = count { query.push(format!("count={}", v)); } - if let Some(v) = format { query.push(format!("format={}", v)); } - if let Some(v) = from { query.push(format!("from={}", v)); } - query.push(format!("index={}", index)); - query.push(format!("metrics={}", metrics)); - if let Some(v) = to { query.push(format!("to={}", v)); } - let query_str = if query.is_empty() { String::new() } else { format!("?{}", query.join("&")) }; - self.base.get(&format!("/api/metrics/bulk{}", query_str)) + if let Some(v) = start { + query.push(format!("start={}", v)); + } + if let Some(v) = end { + query.push(format!("end={}", v)); + } + if let Some(v) = count { + query.push(format!("count={}", v)); + } + if let Some(v) = format { + query.push(format!("format={}", v)); + } + let query_str = if query.is_empty() { + String::new() + } else { + format!("?{}", query.join("&")) + }; + let path = format!( + "/api/metric/{metric}/{}{}", + index.serialize_long(), + query_str + ); + if format == Some(Format::CSV) { + self.base.get_text(&path).map(FormatResponse::Csv) + } else { + self.base.get_json(&path).map(FormatResponse::Json) + } } /// 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_catalog(&self) -> Result { - self.base.get(&format!("/api/metrics/catalog")) + pub fn get_metrics(&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( + &self, + metrics: Metrics, + index: Index, + start: Option, + end: Option, + count: Option, + format: Option, + ) -> Result>> { + let mut query = Vec::new(); + query.push(format!("metrics={}", metrics)); + query.push(format!("index={}", index)); + if let Some(v) = start { + query.push(format!("start={}", v)); + } + if let Some(v) = end { + query.push(format!("end={}", v)); + } + if let Some(v) = count { + query.push(format!("count={}", v)); + } + if let Some(v) = format { + query.push(format!("format={}", v)); + } + let query_str = if query.is_empty() { + String::new() + } else { + format!("?{}", query.join("&")) + }; + let path = format!("/api/metrics/bulk{}", query_str); + if format == Some(Format::CSV) { + self.base.get_text(&path).map(FormatResponse::Csv) + } else { + self.base.get_json(&path).map(FormatResponse::Json) + } } /// Metric count /// /// Current metric count pub fn get_metrics_count(&self) -> Result> { - self.base.get(&format!("/api/metrics/count")) + self.base.get_json(&format!("/api/metrics/count")) } /// 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> { - self.base.get(&format!("/api/metrics/indexes")) + self.base.get_json(&format!("/api/metrics/indexes")) } /// Metrics list /// /// Paginated list of available metrics - pub fn get_metrics_list(&self, page: Option<&str>) -> Result { + pub fn get_metrics_list(&self, page: Option) -> Result { let mut query = Vec::new(); - if let Some(v) = page { query.push(format!("page={}", v)); } - let query_str = if query.is_empty() { String::new() } else { format!("?{}", query.join("&")) }; - self.base.get(&format!("/api/metrics/list{}", query_str)) + if let Some(v) = page { + query.push(format!("page={}", v)); + } + let query_str = if query.is_empty() { + String::new() + } else { + format!("?{}", query.join("&")) + }; + let path = format!("/api/metrics/list{}", query_str); + self.base.get_json(&path) } /// Search metrics /// /// Fuzzy search for metrics by name. Supports partial matches and typos. - pub fn get_metrics_search_by_metric(&self, metric: &str, limit: Option<&str>) -> Result> { + pub fn get_metrics_search_by_metric( + &self, + metric: Metric, + limit: Option, + ) -> Result> { let mut query = Vec::new(); - if let Some(v) = limit { query.push(format!("limit={}", v)); } - let query_str = if query.is_empty() { String::new() } else { format!("?{}", query.join("&")) }; - self.base.get(&format!("/api/metrics/search/{metric}{}", query_str)) + if let Some(v) = limit { + query.push(format!("limit={}", v)); + } + let query_str = if query.is_empty() { + String::new() + } else { + format!("?{}", query.join("&")) + }; + let path = format!("/api/metrics/search/{metric}{}", query_str); + self.base.get_json(&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. - pub fn get_tx_by_txid(&self, txid: &str) -> Result { - self.base.get(&format!("/api/tx/{txid}")) + pub fn get_tx_by_txid(&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: &str) -> Result { - self.base.get(&format!("/api/tx/{txid}/hex")) + pub fn get_tx_by_txid_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: &str, vout: &str) -> Result { - self.base.get(&format!("/api/tx/{txid}/outspend/{vout}")) + pub fn get_tx_by_txid_outspend_by_vout(&self, txid: Txid, vout: Vout) -> Result { + self.base + .get_json(&format!("/api/tx/{txid}/outspend/{vout}")) } /// 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: &str) -> Result> { - self.base.get(&format!("/api/tx/{txid}/outspends")) + pub fn get_tx_by_txid_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: &str) -> Result { - self.base.get(&format!("/api/tx/{txid}/status")) + pub fn get_tx_by_txid_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 { - self.base.get(&format!("/api/v1/difficulty-adjustment")) + self.base + .get_json(&format!("/api/v1/difficulty-adjustment")) } /// 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> { - self.base.get(&format!("/api/v1/fees/mempool-blocks")) + 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 { - self.base.get(&format!("/api/v1/fees/recommended")) + self.base.get_json(&format!("/api/v1/fees/recommended")) } /// 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: &str) -> Result> { - self.base.get(&format!("/api/v1/mining/blocks/fees/{time_period}")) + pub fn get_v1_mining_blocks_fees_by_time_period( + &self, + time_period: TimePeriod, + ) -> Result> { + self.base + .get_json(&format!("/api/v1/mining/blocks/fees/{time_period}")) } /// 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: &str) -> Result> { - self.base.get(&format!("/api/v1/mining/blocks/rewards/{time_period}")) + pub fn get_v1_mining_blocks_rewards_by_time_period( + &self, + time_period: TimePeriod, + ) -> Result> { + self.base + .get_json(&format!("/api/v1/mining/blocks/rewards/{time_period}")) } /// 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: &str) -> Result { - self.base.get(&format!("/api/v1/mining/blocks/sizes-weights/{time_period}")) + pub fn get_v1_mining_blocks_sizes_weights_by_time_period( + &self, + time_period: TimePeriod, + ) -> Result { + self.base.get_json(&format!( + "/api/v1/mining/blocks/sizes-weights/{time_period}" + )) } /// Block by timestamp /// /// Find the block closest to a given UNIX timestamp. - pub fn get_v1_mining_blocks_timestamp(&self, timestamp: &str) -> Result { - self.base.get(&format!("/api/v1/mining/blocks/timestamp/{timestamp}")) + pub fn get_v1_mining_blocks_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> { - self.base.get(&format!("/api/v1/mining/difficulty-adjustments")) + 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(&self, time_period: &str) -> Result> { - self.base.get(&format!("/api/v1/mining/difficulty-adjustments/{time_period}")) + pub fn get_v1_mining_difficulty_adjustments_by_time_period( + &self, + time_period: TimePeriod, + ) -> Result> { + self.base.get_json(&format!( + "/api/v1/mining/difficulty-adjustments/{time_period}" + )) } /// Network hashrate (all time) /// /// Get network hashrate and difficulty data for all time. pub fn get_v1_mining_hashrate(&self) -> Result { - self.base.get(&format!("/api/v1/mining/hashrate")) + 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: &str) -> Result { - self.base.get(&format!("/api/v1/mining/hashrate/{time_period}")) + pub fn get_v1_mining_hashrate_by_time_period( + &self, + time_period: TimePeriod, + ) -> Result { + self.base + .get_json(&format!("/api/v1/mining/hashrate/{time_period}")) } /// 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: &str) -> Result { - self.base.get(&format!("/api/v1/mining/pool/{slug}")) + pub fn get_v1_mining_pool_by_slug(&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> { - self.base.get(&format!("/api/v1/mining/pools")) + 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: &str) -> Result { - self.base.get(&format!("/api/v1/mining/pools/{time_period}")) + pub fn get_v1_mining_pools_by_time_period( + &self, + time_period: TimePeriod, + ) -> Result { + self.base + .get_json(&format!("/api/v1/mining/pools/{time_period}")) } /// 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: &str) -> Result { - self.base.get(&format!("/api/v1/mining/reward-stats/{block_count}")) + pub fn get_v1_mining_reward_stats_by_block_count( + &self, + block_count: i64, + ) -> Result { + self.base + .get_json(&format!("/api/v1/mining/reward-stats/{block_count}")) } /// Validate address /// /// Validate a Bitcoin address and get information about its type and scriptPubKey. pub fn get_v1_validate_address(&self, address: &str) -> Result { - self.base.get(&format!("/api/v1/validate-address/{address}")) + self.base + .get_json(&format!("/api/v1/validate-address/{address}")) } /// Health check /// /// Returns the health status of the API server pub fn get_health(&self) -> Result { - self.base.get(&format!("/health")) + self.base.get_json(&format!("/health")) } /// API version /// /// Returns the current version of the API server pub fn get_version(&self) -> Result { - self.base.get(&format!("/version")) + self.base.get_json(&format!("/version")) } - } diff --git a/crates/brk_query/src/impl/metrics.rs b/crates/brk_query/src/impl/metrics.rs index 99c830c3e..894b8494f 100644 --- a/crates/brk_query/src/impl/metrics.rs +++ b/crates/brk_query/src/impl/metrics.rs @@ -86,8 +86,8 @@ impl Query { params: &DataRangeFormat, ) -> Result { let len = metric.len(); - let from = params.from().map(|from| metric.i64_to_usize(from)); - let to = params.to_for_len(len).map(|to| metric.i64_to_usize(to)); + let from = params.start().map(|start| metric.i64_to_usize(start)); + let to = params.end_for_len(len).map(|end| metric.i64_to_usize(end)); Ok(match params.format() { Format::CSV => Output::CSV(Self::columns_to_csv( @@ -112,18 +112,18 @@ impl Query { // Use min length across metrics for consistent count resolution let min_len = metrics.iter().map(|v| v.len()).min().unwrap_or(0); - let from = params.from().map(|from| { + let from = params.start().map(|start| { metrics .iter() - .map(|v| v.i64_to_usize(from)) + .map(|v| v.i64_to_usize(start)) .min() .unwrap_or_default() }); - let to = params.to_for_len(min_len).map(|to| { + let to = params.end_for_len(min_len).map(|end| { metrics .iter() - .map(|v| v.i64_to_usize(to)) + .map(|v| v.i64_to_usize(end)) .min() .unwrap_or_default() }); @@ -200,7 +200,7 @@ impl Query { let metric = vecs.first().expect("search guarantees non-empty on success"); - let weight = Self::weight(&vecs, params.from(), params.to_for_len(metric.len())); + let weight = Self::weight(&vecs, params.start(), params.end_for_len(metric.len())); if weight > max_weight { return Err(Error::WeightExceeded { requested: weight, @@ -225,7 +225,7 @@ impl Query { let vecs = self.search(¶ms)?; let min_len = vecs.iter().map(|v| v.len()).min().expect("search guarantees non-empty"); - let weight = Self::weight(&vecs, params.from(), params.to_for_len(min_len)); + let weight = Self::weight(&vecs, params.start(), params.end_for_len(min_len)); if weight > max_weight { return Err(Error::WeightExceeded { requested: weight, diff --git a/crates/brk_query/src/impl/metrics_legacy.rs b/crates/brk_query/src/impl/metrics_legacy.rs index 79f15e472..6c8886861 100644 --- a/crates/brk_query/src/impl/metrics_legacy.rs +++ b/crates/brk_query/src/impl/metrics_legacy.rs @@ -10,12 +10,12 @@ impl Query { let min_len = metrics.iter().map(|v| v.len()).min().unwrap_or(0); let from = params - .from() - .map(|from| metrics.iter().map(|v| v.i64_to_usize(from)).min().unwrap_or_default()); + .start() + .map(|start| metrics.iter().map(|v| v.i64_to_usize(start)).min().unwrap_or_default()); let to = params - .to_for_len(min_len) - .map(|to| metrics.iter().map(|v| v.i64_to_usize(to)).min().unwrap_or_default()); + .end_for_len(min_len) + .map(|end| metrics.iter().map(|v| v.i64_to_usize(end)).min().unwrap_or_default()); let format = params.format(); @@ -60,7 +60,7 @@ impl Query { let vecs = self.search(¶ms)?; let min_len = vecs.iter().map(|v| v.len()).min().expect("search guarantees non-empty"); - let weight = Self::weight(&vecs, params.from(), params.to_for_len(min_len)); + let weight = Self::weight(&vecs, params.start(), params.end_for_len(min_len)); if weight > max_weight { return Err(Error::WeightExceeded { requested: weight, diff --git a/crates/brk_server/src/api/metrics/mod.rs b/crates/brk_server/src/api/metrics/mod.rs index 29009e484..765bd6e35 100644 --- a/crates/brk_server/src/api/metrics/mod.rs +++ b/crates/brk_server/src/api/metrics/mod.rs @@ -2,8 +2,7 @@ use aide::axum::{ApiRouter, routing::get_with}; use axum::{ extract::{Path, Query, State}, http::{HeaderMap, Uri}, - response::{IntoResponse, Redirect, Response}, - routing::get, + response::{IntoResponse, Response}, }; use brk_query::{ DataRangeFormat, MetricSelection, MetricSelectionLegacy, PaginatedMetrics, Pagination, @@ -31,10 +30,23 @@ pub trait ApiMetricsRoutes { impl ApiMetricsRoutes for ApiRouter { fn add_metrics_routes(self) -> Self { - self - .route("/api/metric", get(Redirect::temporary("/api/metrics"))) - .route("/api/metrics", get(Redirect::temporary("/api#tag/metrics"))) - .api_route( + self.api_route( + "/api/metrics", + get_with( + async |headers: HeaderMap, State(state): State| { + state.cached_json(&headers, CacheStrategy::Static, |q| Ok(q.metrics_catalog().clone())).await + }, + |op| op + .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." + ) + .ok_response::() + .not_modified(), + ), + ) + .api_route( "/api/metrics/count", get_with( async | @@ -88,22 +100,6 @@ impl ApiMetricsRoutes for ApiRouter { .not_modified(), ), ) - .api_route( - "/api/metrics/catalog", - get_with( - async |headers: HeaderMap, State(state): State| { - state.cached_json(&headers, CacheStrategy::Static, |q| Ok(q.metrics_catalog().clone())).await - }, - |op| op - .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." - ) - .ok_response::() - .not_modified(), - ), - ) .api_route( "/api/metrics/search/{metric}", get_with( @@ -177,6 +173,7 @@ impl ApiMetricsRoutes for ApiRouter { Use query parameters to filter by date range and format (json/csv)." ) .ok_response::() + .csv_response() .not_modified() .not_found(), ), @@ -193,6 +190,7 @@ impl ApiMetricsRoutes for ApiRouter { Returns an array of MetricData objects." ) .ok_response::>() + .csv_response() .not_modified(), ), ) diff --git a/crates/brk_server/src/extended/transform_operation.rs b/crates/brk_server/src/extended/transform_operation.rs index cbf094409..1d168c52e 100644 --- a/crates/brk_server/src/extended/transform_operation.rs +++ b/crates/brk_server/src/extended/transform_operation.rs @@ -1,3 +1,4 @@ +use aide::openapi::{MediaType, ReferenceOr, StatusCode}; use aide::transform::{TransformOperation, TransformResponse}; use axum::Json; use schemars::JsonSchema; @@ -23,6 +24,8 @@ pub trait TransformResponseExtended<'t> { where R: JsonSchema, F: FnOnce(TransformResponse<'_, R>) -> TransformResponse<'_, R>; + /// 200 with text/csv content type (adds CSV as alternative response format) + fn csv_response(self) -> Self; /// 400 fn bad_request(self) -> Self; /// 404 @@ -82,6 +85,19 @@ impl<'t> TransformResponseExtended<'t> for TransformOperation<'t> { self.response_with::<200, Json, _>(|res| f(res.description("Successful response"))) } + fn csv_response(mut self) -> Self { + // Add text/csv content type to existing 200 response + if let Some(responses) = &mut self.inner_mut().responses + && let Some(ReferenceOr::Item(response)) = + responses.responses.get_mut(&StatusCode::Code(200)) + { + response + .content + .insert("text/csv".into(), MediaType::default()); + } + self + } + fn bad_request(self) -> Self { self.response_with::<400, Json, _>(|res| { res.description("Invalid request parameters") diff --git a/crates/brk_types/src/datarange.rs b/crates/brk_types/src/datarange.rs index f61bd0782..69f2e35a4 100644 --- a/crates/brk_types/src/datarange.rs +++ b/crates/brk_types/src/datarange.rs @@ -7,29 +7,29 @@ use crate::{de_unquote_i64, de_unquote_usize}; #[derive(Default, Debug, Deserialize, JsonSchema)] pub struct DataRange { /// Inclusive starting index, if negative counts from end - #[serde(default, alias = "f", deserialize_with = "de_unquote_i64")] + #[serde(default, alias = "s", alias = "from", alias = "f", deserialize_with = "de_unquote_i64")] #[schemars(example = 0, example = -1, example = -10, example = -1000)] - from: Option, + start: Option, /// Exclusive ending index, if negative counts from end - #[serde(default, alias = "t", deserialize_with = "de_unquote_i64")] + #[serde(default, alias = "e", alias = "to", alias = "t", deserialize_with = "de_unquote_i64")] #[schemars(example = 1000)] - to: Option, + end: Option, - /// Number of values to return (ignored if `to` is set) + /// Number of values to return (ignored if `end` is set) #[serde(default, alias = "c", deserialize_with = "de_unquote_usize")] #[schemars(example = 1, example = 10, example = 100)] count: Option, } impl DataRange { - pub fn set_from(mut self, from: i64) -> Self { - self.from.replace(from); + pub fn set_start(mut self, start: i64) -> Self { + self.start.replace(start); self } - pub fn set_to(mut self, to: i64) -> Self { - self.to.replace(to); + pub fn set_end(mut self, end: i64) -> Self { + self.end.replace(end); self } @@ -38,27 +38,27 @@ impl DataRange { self } - /// Get the raw `from` value - pub fn from(&self) -> Option { - self.from + /// Get the raw `start` value + pub fn start(&self) -> Option { + self.start } - /// Get `to` value, computing it from `from + count` if `to` is unset but `count` is set. - /// Requires the vec length to resolve negative `from` indices before adding count. - pub fn to_for_len(&self, len: usize) -> Option { - if self.to.is_some() { - return self.to; + /// Get `end` value, computing it from `start + count` if `end` is unset but `count` is set. + /// Requires the vec length to resolve negative `start` indices before adding count. + pub fn end_for_len(&self, len: usize) -> Option { + if self.end.is_some() { + return self.end; } self.count.map(|count| { - let resolved_from = self.resolve_index(self.from, len, 0); - (resolved_from + count).min(len) as i64 + let resolved_start = self.resolve_index(self.start, len, 0); + (resolved_start + count).min(len) as i64 }) } /// Returns a string for etag/cache key generation that captures all range parameters pub fn etag_suffix(&self) -> String { - format!("{:?}{:?}{:?}", self.from, self.to, self.count) + format!("{:?}{:?}{:?}", self.start, self.end, self.count) } fn resolve_index(&self, idx: Option, len: usize, default: usize) -> usize { diff --git a/crates/brk_types/src/datarangeformat.rs b/crates/brk_types/src/datarangeformat.rs index 4d3ff5e9e..716938cae 100644 --- a/crates/brk_types/src/datarangeformat.rs +++ b/crates/brk_types/src/datarangeformat.rs @@ -21,13 +21,13 @@ impl DataRangeFormat { self.format } - pub fn set_from(mut self, from: i64) -> Self { - self.range = self.range.set_from(from); + pub fn set_start(mut self, start: i64) -> Self { + self.range = self.range.set_start(start); self } - pub fn set_to(mut self, to: i64) -> Self { - self.range = self.range.set_to(to); + pub fn set_end(mut self, end: i64) -> Self { + self.range = self.range.set_end(end); self } diff --git a/crates/brk_types/src/deser.rs b/crates/brk_types/src/deser.rs index 5c6d807a2..dcea920d0 100644 --- a/crates/brk_types/src/deser.rs +++ b/crates/brk_types/src/deser.rs @@ -17,6 +17,9 @@ where if s.starts_with('"') && s.ends_with('"') && s.len() >= 2 { s = s[1..s.len() - 1].to_string(); } + if s == "null" || s.is_empty() { + return Ok(None); + } s.parse::().map(Some).map_err(serde::de::Error::custom) } else if let Some(n) = value.as_i64() { Ok(Some(n)) @@ -41,6 +44,9 @@ where if s.starts_with('"') && s.ends_with('"') && s.len() >= 2 { s = s[1..s.len() - 1].to_string(); } + if s == "null" || s.is_empty() { + return Ok(None); + } s.parse::() .map(Some) .map_err(serde::de::Error::custom) diff --git a/crates/brk_types/src/format.rs b/crates/brk_types/src/format.rs index 58bb5ce70..a898a7281 100644 --- a/crates/brk_types/src/format.rs +++ b/crates/brk_types/src/format.rs @@ -1,3 +1,5 @@ +use std::fmt; + use schemars::JsonSchema; use serde::Deserialize; @@ -13,6 +15,15 @@ pub enum Format { CSV, } +impl fmt::Display for Format { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + Format::JSON => write!(f, "json"), + Format::CSV => write!(f, "csv"), + } + } +} + impl From> for Format { #[inline] fn from(value: Option) -> Self { diff --git a/crates/brk_types/src/formatresponse.rs b/crates/brk_types/src/formatresponse.rs new file mode 100644 index 000000000..18757d01d --- /dev/null +++ b/crates/brk_types/src/formatresponse.rs @@ -0,0 +1,36 @@ +/// Response type for endpoints that support multiple formats (JSON/CSV). +#[derive(Debug, Clone)] +pub enum FormatResponse { + /// JSON response, deserialized to T. + Json(T), + /// CSV response as raw string. + Csv(String), +} + +impl FormatResponse { + /// Unwrap the JSON variant, panicking if this is CSV. + pub fn json(self) -> T { + match self { + FormatResponse::Json(v) => v, + FormatResponse::Csv(_) => panic!("expected JSON response, got CSV"), + } + } + + /// Unwrap the CSV variant, panicking if this is JSON. + pub fn csv(self) -> String { + match self { + FormatResponse::Csv(s) => s, + FormatResponse::Json(_) => panic!("expected CSV response, got JSON"), + } + } + + /// Returns true if this is a JSON response. + pub fn is_json(&self) -> bool { + matches!(self, FormatResponse::Json(_)) + } + + /// Returns true if this is a CSV response. + pub fn is_csv(&self) -> bool { + matches!(self, FormatResponse::Csv(_)) + } +} diff --git a/crates/brk_types/src/lib.rs b/crates/brk_types/src/lib.rs index 7e5e342f6..925c65a34 100644 --- a/crates/brk_types/src/lib.rs +++ b/crates/brk_types/src/lib.rs @@ -54,6 +54,7 @@ mod emptyoutputindex; mod feerate; mod feeratepercentiles; mod format; +mod formatresponse; mod halvingepoch; mod hashrateentry; mod hashratesummary; @@ -215,6 +216,7 @@ pub use emptyoutputindex::*; pub use feerate::*; pub use feeratepercentiles::*; pub use format::*; +pub use formatresponse::*; pub use halvingepoch::*; pub use hashrateentry::*; pub use hashratesummary::*; diff --git a/crates/brk_types/src/limit.rs b/crates/brk_types/src/limit.rs index 289edb015..c2c3e57d4 100644 --- a/crates/brk_types/src/limit.rs +++ b/crates/brk_types/src/limit.rs @@ -1,3 +1,5 @@ +use std::fmt; + use derive_more::Deref; use schemars::JsonSchema; use serde::Deserialize; @@ -19,3 +21,9 @@ impl Default for Limit { Self::DEFAULT } } + +impl fmt::Display for Limit { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "{}", self.0) + } +} diff --git a/crates/brk_types/src/metricdata.rs b/crates/brk_types/src/metricdata.rs index 6bae745db..e72af3b8d 100644 --- a/crates/brk_types/src/metricdata.rs +++ b/crates/brk_types/src/metricdata.rs @@ -14,30 +14,30 @@ pub struct MetricData { /// Total number of data points in the metric pub total: usize, /// Start index (inclusive) of the returned range - pub from: usize, + pub start: usize, /// End index (exclusive) of the returned range - pub to: usize, + pub end: usize, /// The metric data pub data: Vec, } impl MetricData { - /// Write metric data as JSON to buffer: `{"total":N,"from":N,"to":N,"data":[...]}` + /// Write metric data as JSON to buffer: `{"total":N,"start":N,"end":N,"data":[...]}` pub fn serialize( vec: &dyn AnySerializableVec, - from: Option, - to: Option, + start: Option, + end: Option, buf: &mut Vec, ) -> vecdb::Result<()> { let total = vec.len(); - let from_idx = from.unwrap_or(0); - let to_idx = to.unwrap_or(total).min(total); + let start_idx = start.unwrap_or(0); + let end_idx = end.unwrap_or(total).min(total); write!( buf, - r#"{{"total":{total},"from":{from_idx},"to":{to_idx},"data":"# + r#"{{"total":{total},"start":{start_idx},"end":{end_idx},"data":"# )?; - vec.write_json(from, to, buf)?; + vec.write_json(start, end, buf)?; buf.push(b'}'); Ok(()) } diff --git a/crates/brk_types/src/timeperiod.rs b/crates/brk_types/src/timeperiod.rs index fbf0ffee9..7039a57b5 100644 --- a/crates/brk_types/src/timeperiod.rs +++ b/crates/brk_types/src/timeperiod.rs @@ -1,3 +1,5 @@ +use std::fmt; + use schemars::JsonSchema; use serde::{Deserialize, Serialize}; @@ -60,3 +62,19 @@ impl TimePeriod { } } } + +impl fmt::Display for TimePeriod { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + TimePeriod::Day => write!(f, "24h"), + TimePeriod::ThreeDays => write!(f, "3d"), + TimePeriod::Week => write!(f, "1w"), + TimePeriod::Month => write!(f, "1m"), + TimePeriod::ThreeMonths => write!(f, "3m"), + TimePeriod::SixMonths => write!(f, "6m"), + TimePeriod::Year => write!(f, "1y"), + TimePeriod::TwoYears => write!(f, "2y"), + TimePeriod::ThreeYears => write!(f, "3y"), + } + } +} diff --git a/modules/brk-client/index.js b/modules/brk-client/index.js index 08bc3491e..85e4475b6 100644 --- a/modules/brk-client/index.js +++ b/modules/brk-client/index.js @@ -54,13 +54,13 @@ * Address validation result * * @typedef {Object} AddressValidation - * @property {?string=} address - The validated address - * @property {?boolean=} isscript - Whether this is a script address (P2SH) * @property {boolean} isvalid - Whether the address is valid - * @property {?boolean=} iswitness - Whether this is a witness address + * @property {?string=} address - The validated address * @property {?string=} scriptPubKey - The scriptPubKey in hex - * @property {?string=} witnessProgram - Witness program in hex + * @property {?boolean=} isscript - Whether this is a script address (P2SH) + * @property {?boolean=} iswitness - Whether this is a witness address * @property {?number=} witnessVersion - Witness version (0 for P2WPKH/P2WSH, 1 for P2TR) + * @property {?string=} witnessProgram - Witness program in hex */ /** * Unified index for any address type (loaded or empty) @@ -85,9 +85,9 @@ * A single block fees data point. * * @typedef {Object} BlockFeesEntry - * @property {Sats} avgFees * @property {Height} avgHeight * @property {Timestamp} timestamp + * @property {Sats} avgFees */ /** * Block hash @@ -112,29 +112,29 @@ * Block information returned by the API * * @typedef {Object} BlockInfo - * @property {number} difficulty - Block difficulty as a floating point number - * @property {Height} height - Block height * @property {BlockHash} id - Block hash - * @property {number} size - Block size in bytes - * @property {Timestamp} timestamp - Block timestamp (Unix time) + * @property {Height} height - Block height * @property {number} txCount - Number of transactions in the block + * @property {number} size - Block size in bytes * @property {Weight} weight - Block weight in weight units + * @property {Timestamp} timestamp - Block timestamp (Unix time) + * @property {number} difficulty - Block difficulty as a floating point number */ /** * A single block rewards data point. * * @typedef {Object} BlockRewardsEntry * @property {number} avgHeight - * @property {number} avgRewards * @property {number} timestamp + * @property {number} avgRewards */ /** * A single block size data point. * * @typedef {Object} BlockSizeEntry * @property {number} avgHeight - * @property {number} avgSize * @property {number} timestamp + * @property {number} avgSize */ /** * Combined block sizes and weights response. @@ -147,16 +147,16 @@ * Block status indicating whether block is in the best chain * * @typedef {Object} BlockStatus - * @property {(Height|null)=} height - Block height (only if in best chain) * @property {boolean} inBestChain - Whether this block is in the best chain + * @property {(Height|null)=} height - Block height (only if in best chain) * @property {(BlockHash|null)=} nextBest - Hash of the next block in the best chain (only if in best chain and not tip) */ /** * Block information returned for timestamp queries * * @typedef {Object} BlockTimestamp - * @property {BlockHash} hash - Block hash * @property {Height} height - Block height + * @property {BlockHash} hash - Block hash * @property {string} timestamp - Block timestamp in ISO 8601 format */ /** @@ -164,8 +164,8 @@ * * @typedef {Object} BlockWeightEntry * @property {number} avgHeight - * @property {number} avgWeight * @property {number} timestamp + * @property {number} avgWeight */ /** @typedef {number} Cents */ /** @@ -177,10 +177,10 @@ * Data range with output format for API query parameters * * @typedef {Object} DataRangeFormat - * @property {?number=} count - Number of values to return (ignored if `to` is set) + * @property {?number=} start - Inclusive starting index, if negative counts from end + * @property {?number=} end - Exclusive ending index, if negative counts from end + * @property {?number=} count - Number of values to return (ignored if `end` is set) * @property {Format=} format - Format of the output - * @property {?number=} from - Inclusive starting index, if negative counts from end - * @property {?number=} to - Exclusive ending index, if negative counts from end */ /** * Date in YYYYMMDD format stored as u32 @@ -193,15 +193,15 @@ * Difficulty adjustment information. * * @typedef {Object} DifficultyAdjustment - * @property {number} adjustedTimeAvg - Time-adjusted average (accounting for timestamp manipulation) + * @property {number} progressPercent - Progress through current difficulty epoch (0-100%) * @property {number} difficultyChange - Estimated difficulty change at next retarget (%) * @property {number} estimatedRetargetDate - Estimated Unix timestamp of next retarget - * @property {Height} nextRetargetHeight - Height of next retarget - * @property {number} previousRetarget - Previous difficulty adjustment (%) - * @property {number} progressPercent - Progress through current difficulty epoch (0-100%) * @property {number} remainingBlocks - Blocks remaining until retarget * @property {number} remainingTime - Estimated seconds until retarget + * @property {number} previousRetarget - Previous difficulty adjustment (%) + * @property {Height} nextRetargetHeight - Height of next retarget * @property {number} timeAvg - Average block time in current epoch (seconds) + * @property {number} adjustedTimeAvg - Time-adjusted average (accounting for timestamp manipulation) * @property {number} timeOffset - Time offset from expected schedule (seconds) */ /** @@ -209,18 +209,18 @@ * Serializes as array: [timestamp, height, difficulty, change_percent] * * @typedef {Object} DifficultyAdjustmentEntry - * @property {number} changePercent - * @property {number} difficulty - * @property {Height} height * @property {Timestamp} timestamp + * @property {Height} height + * @property {number} difficulty + * @property {number} changePercent */ /** * A single difficulty data point. * * @typedef {Object} DifficultyEntry + * @property {Timestamp} timestamp - Unix timestamp of the difficulty adjustment. * @property {number} difficulty - Difficulty value. * @property {Height} height - Block height of the adjustment. - * @property {Timestamp} timestamp - Unix timestamp of the difficulty adjustment. */ /** @typedef {number} DifficultyEpoch */ /** @@ -232,9 +232,9 @@ * Data of an empty address * * @typedef {Object} EmptyAddressData + * @property {number} txCount - Total transaction count * @property {number} fundedTxoCount - Total funded/spent transaction output count (equal since address is empty) * @property {Sats} transfered - Total satoshis transferred - * @property {number} txCount - Total transaction count */ /** @typedef {TypeIndex} EmptyAddressIndex */ /** @typedef {TypeIndex} EmptyOutputIndex */ @@ -253,24 +253,24 @@ * A single hashrate data point. * * @typedef {Object} HashrateEntry - * @property {number} avgHashrate - Average hashrate (H/s). * @property {Timestamp} timestamp - Unix timestamp. + * @property {number} avgHashrate - Average hashrate (H/s). */ /** * Summary of network hashrate and difficulty data. * * @typedef {Object} HashrateSummary - * @property {number} currentDifficulty - Current network difficulty. - * @property {number} currentHashrate - Current network hashrate (H/s). - * @property {DifficultyEntry[]} difficulty - Historical difficulty adjustments. * @property {HashrateEntry[]} hashrates - Historical hashrate data points. + * @property {DifficultyEntry[]} difficulty - Historical difficulty adjustments. + * @property {number} currentHashrate - Current network hashrate (H/s). + * @property {number} currentDifficulty - Current network difficulty. */ /** * Server health status * * @typedef {Object} Health - * @property {string} service * @property {string} status + * @property {string} service * @property {string} timestamp */ /** @@ -302,8 +302,8 @@ * Information about an available index and its query aliases * * @typedef {Object} IndexInfo - * @property {string[]} aliases - All Accepted query aliases * @property {Index} index - The canonical index name + * @property {string[]} aliases - All Accepted query aliases */ /** * Maximum number of results to return. Defaults to 100 if not specified. @@ -318,12 +318,12 @@ * Data for a loaded (non-empty) address with current balance * * @typedef {Object} LoadedAddressData + * @property {number} txCount - Total transaction count * @property {number} fundedTxoCount - Number of transaction outputs funded to this address - * @property {Dollars} realizedCap - The realized capitalization of this address + * @property {number} spentTxoCount - Number of transaction outputs spent by this address * @property {Sats} received - Satoshis received by this address * @property {Sats} sent - Satoshis sent by this address - * @property {number} spentTxoCount - Number of transaction outputs spent by this address - * @property {number} txCount - Total transaction count + * @property {Dollars} realizedCap - The realized capitalization of this address */ /** @typedef {TypeIndex} LoadedAddressIndex */ /** @@ -337,18 +337,18 @@ * @typedef {Object} MempoolBlock * @property {number} blockSize - Total block size in weight units * @property {number} blockVSize - Total block virtual size in vbytes - * @property {FeeRate[]} feeRange - Fee rate range: [min, 10%, 25%, 50%, 75%, 90%, max] - * @property {FeeRate} medianFee - Median fee rate in sat/vB * @property {number} nTx - Number of transactions in the projected block * @property {Sats} totalFees - Total fees in satoshis + * @property {FeeRate} medianFee - Median fee rate in sat/vB + * @property {FeeRate[]} feeRange - Fee rate range: [min, 10%, 25%, 50%, 75%, 90%, max] */ /** * Mempool statistics * * @typedef {Object} MempoolInfo * @property {number} count - Number of transactions in the mempool - * @property {Sats} totalFee - Total fees of all transactions in the mempool (satoshis) * @property {VSize} vsize - Total virtual size of all transactions in the mempool (vbytes) + * @property {Sats} totalFee - Total fees of all transactions in the mempool (satoshis) */ /** * Metric name @@ -360,17 +360,17 @@ * * @typedef {Object} MetricCount * @property {number} distinctMetrics - Number of unique metrics available (e.g., realized_price, market_cap) + * @property {number} totalEndpoints - Total number of metric-index combinations across all timeframes * @property {number} lazyEndpoints - Number of lazy (computed on-the-fly) metric-index combinations * @property {number} storedEndpoints - Number of eager (stored on disk) metric-index combinations - * @property {number} totalEndpoints - Total number of metric-index combinations across all timeframes */ /** * MetricLeaf with JSON Schema for client generation * * @typedef {Object} MetricLeafWithSchema - * @property {Index[]} indexes - Available indexes for this metric - * @property {string} kind - The Rust type (e.g., "Sats", "StoredF64") * @property {string} name - The metric name/identifier + * @property {string} kind - The Rust type (e.g., "Sats", "StoredF64") + * @property {Index[]} indexes - Available indexes for this metric * @property {string} type - JSON Schema type (e.g., "integer", "number", "string", "boolean", "array", "object") */ /** @@ -381,28 +381,28 @@ * Selection of metrics to query * * @typedef {Object} MetricSelection - * @property {?number=} count - Number of values to return (ignored if `to` is set) - * @property {Format=} format - Format of the output - * @property {?number=} from - Inclusive starting index, if negative counts from end - * @property {Index} index - Index to query * @property {Metrics} metrics - Requested metrics - * @property {?number=} to - Exclusive ending index, if negative counts from end + * @property {Index} index - Index to query + * @property {?number=} start - Inclusive starting index, if negative counts from end + * @property {?number=} end - Exclusive ending index, if negative counts from end + * @property {?number=} count - Number of values to return (ignored if `end` is set) + * @property {Format=} format - Format of the output */ /** * Legacy metric selection parameters (deprecated) * * @typedef {Object} MetricSelectionLegacy - * @property {?number=} count - Number of values to return (ignored if `to` is set) - * @property {Format=} format - Format of the output - * @property {?number=} from - Inclusive starting index, if negative counts from end - * @property {Metrics} ids * @property {Index} index - * @property {?number=} to - Exclusive ending index, if negative counts from end + * @property {Metrics} ids + * @property {?number=} start - Inclusive starting index, if negative counts from end + * @property {?number=} end - Exclusive ending index, if negative counts from end + * @property {?number=} count - Number of values to return (ignored if `end` is set) + * @property {Format=} format - Format of the output */ /** * @typedef {Object} MetricWithIndex - * @property {Index} index - Aggregation index * @property {Metric} metric - Metric name + * @property {Index} index - Aggregation index */ /** * Comma-separated list of metric names @@ -414,28 +414,28 @@ * OHLC (Open, High, Low, Close) data in cents * * @typedef {Object} OHLCCents - * @property {Close} close + * @property {Open} open * @property {High} high * @property {Low} low - * @property {Open} open + * @property {Close} close */ /** * OHLC (Open, High, Low, Close) data in dollars * * @typedef {Object} OHLCDollars - * @property {Close} close + * @property {Open} open * @property {High} high * @property {Low} low - * @property {Open} open + * @property {Close} close */ /** * OHLC (Open, High, Low, Close) data in satoshis * * @typedef {Object} OHLCSats - * @property {Close} close + * @property {Open} open * @property {High} high * @property {Low} low - * @property {Open} open + * @property {Close} close */ /** @typedef {TypeIndex} OpReturnIndex */ /** @@ -484,36 +484,36 @@ * Block counts for different time periods * * @typedef {Object} PoolBlockCounts - * @property {number} _1w - Blocks mined in last week - * @property {number} _24h - Blocks mined in last 24 hours * @property {number} all - Total blocks mined (all time) + * @property {number} _24h - Blocks mined in last 24 hours + * @property {number} _1w - Blocks mined in last week */ /** * Pool's share of total blocks for different time periods * * @typedef {Object} PoolBlockShares - * @property {number} _1w - Share of blocks in last week - * @property {number} _24h - Share of blocks in last 24 hours * @property {number} all - Share of all blocks (0.0 - 1.0) + * @property {number} _24h - Share of blocks in last 24 hours + * @property {number} _1w - Share of blocks in last week */ /** * Detailed pool information with statistics across time periods * * @typedef {Object} PoolDetail + * @property {PoolDetailInfo} pool - Pool information * @property {PoolBlockCounts} blockCount - Block counts for different time periods * @property {PoolBlockShares} blockShare - Pool's share of total blocks for different time periods * @property {number} estimatedHashrate - Estimated hashrate based on blocks mined - * @property {PoolDetailInfo} pool - Pool information * @property {?number=} reportedHashrate - Self-reported hashrate (if available) */ /** * Pool information for detail view * * @typedef {Object} PoolDetailInfo - * @property {string[]} addresses - Known payout addresses * @property {number} id - Unique pool identifier - * @property {string} link - Pool website URL * @property {string} name - Pool name + * @property {string} link - Pool website URL + * @property {string[]} addresses - Known payout addresses * @property {string[]} regexes - Coinbase tag patterns (regexes) * @property {PoolSlug} slug - URL-friendly pool identifier */ @@ -534,22 +534,22 @@ * Mining pool with block statistics for a time period * * @typedef {Object} PoolStats - * @property {number} blockCount - Number of blocks mined in the time period - * @property {number} emptyBlocks - Number of empty blocks mined - * @property {string} link - Pool website URL - * @property {string} name - Pool name * @property {number} poolId - Unique pool identifier + * @property {string} name - Pool name + * @property {string} link - Pool website URL + * @property {number} blockCount - Number of blocks mined in the time period * @property {number} rank - Pool ranking by block count (1 = most blocks) - * @property {number} share - Pool's share of total blocks (0.0 - 1.0) + * @property {number} emptyBlocks - Number of empty blocks mined * @property {PoolSlug} slug - URL-friendly pool identifier + * @property {number} share - Pool's share of total blocks (0.0 - 1.0) */ /** * Mining pools response for a time period * * @typedef {Object} PoolsSummary + * @property {PoolStats[]} pools - List of pools sorted by block count descending * @property {number} blockCount - Total blocks in the time period * @property {number} lastEstimatedHashrate - Estimated network hashrate (hashes per second) - * @property {PoolStats[]} pools - List of pools sorted by block count descending */ /** @typedef {number} QuarterIndex */ /** @@ -561,20 +561,20 @@ * Recommended fee rates in sat/vB * * @typedef {Object} RecommendedFees - * @property {FeeRate} economyFee - Fee rate for economical confirmation * @property {FeeRate} fastestFee - Fee rate for fastest confirmation (next block) * @property {FeeRate} halfHourFee - Fee rate for confirmation within ~30 minutes (3 blocks) * @property {FeeRate} hourFee - Fee rate for confirmation within ~1 hour (6 blocks) + * @property {FeeRate} economyFee - Fee rate for economical confirmation * @property {FeeRate} minimumFee - Minimum relay fee rate */ /** * Block reward statistics over a range of blocks * * @typedef {Object} RewardStats - * @property {Height} endBlock - Last block in the range * @property {Height} startBlock - First block in the range - * @property {Sats} totalFee + * @property {Height} endBlock - Last block in the range * @property {Sats} totalReward + * @property {Sats} totalFee * @property {number} totalTx */ /** @@ -642,17 +642,17 @@ * Transaction information compatible with mempool.space API format * * @typedef {Object} Transaction - * @property {Sats} fee - Transaction fee in satoshis * @property {(TxIndex|null)=} index - * @property {RawLockTime} locktime - * @property {number} sigops - Number of signature operations - * @property {number} size - Transaction size in bytes - * @property {TxStatus} status * @property {Txid} txid * @property {TxVersion} version + * @property {RawLockTime} locktime + * @property {number} size - Transaction size in bytes + * @property {Weight} weight - Transaction weight + * @property {number} sigops - Number of signature operations + * @property {Sats} fee - Transaction fee in satoshis * @property {TxIn[]} vin - Transaction inputs * @property {TxOut[]} vout - Transaction outputs - * @property {Weight} weight - Transaction weight + * @property {TxStatus} status */ /** * Hierarchical tree node for organizing metrics into categories @@ -663,14 +663,14 @@ * Transaction input * * @typedef {Object} TxIn - * @property {?string=} innerRedeemscriptAsm - Inner redeemscript in assembly format (for P2SH-wrapped SegWit) - * @property {boolean} isCoinbase - Whether this input is a coinbase (block reward) input + * @property {Txid} txid - Transaction ID of the output being spent + * @property {Vout} vout * @property {(TxOut|null)=} prevout - Information about the previous output being spent * @property {string} scriptsig - Signature script (for non-SegWit inputs) * @property {string} scriptsigAsm - Signature script in assembly format + * @property {boolean} isCoinbase - Whether this input is a coinbase (block reward) input * @property {number} sequence - Input sequence number - * @property {Txid} txid - Transaction ID of the output being spent - * @property {Vout} vout + * @property {?string=} innerRedeemscriptAsm - Inner redeemscript in assembly format (for P2SH-wrapped SegWit) */ /** @typedef {number} TxInIndex */ /** @typedef {number} TxIndex */ @@ -687,18 +687,18 @@ * * @typedef {Object} TxOutspend * @property {boolean} spent - Whether the output has been spent - * @property {(TxStatus|null)=} status - Status of the spending transaction (only present if spent) * @property {(Txid|null)=} txid - Transaction ID of the spending transaction (only present if spent) * @property {(Vin|null)=} vin - Input index in the spending transaction (only present if spent) + * @property {(TxStatus|null)=} status - Status of the spending transaction (only present if spent) */ /** * Transaction confirmation status * * @typedef {Object} TxStatus - * @property {(BlockHash|null)=} blockHash - Block hash (only present if confirmed) - * @property {(Height|null)=} blockHeight - Block height (only present if confirmed) - * @property {(Timestamp|null)=} blockTime - Block timestamp (only present if confirmed) * @property {boolean} confirmed - Whether the transaction is confirmed + * @property {(Height|null)=} blockHeight - Block height (only present if confirmed) + * @property {(BlockHash|null)=} blockHash - Block hash (only present if confirmed) + * @property {(Timestamp|null)=} blockTime - Block timestamp (only present if confirmed) */ /** * Transaction version number @@ -736,10 +736,10 @@ * Unspent transaction output * * @typedef {Object} Utxo - * @property {TxStatus} status * @property {Txid} txid - * @property {Sats} value * @property {Vout} vout + * @property {TxStatus} status + * @property {Sats} value */ /** * Virtual size in vbytes (weight / 4, rounded up) @@ -774,13 +774,12 @@ * @property {number} [timeout] - Request timeout in milliseconds */ -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); /** @type {Promise} */ const _cachePromise = _isBrowser - ? caches.open("__BRK_CLIENT__").catch(() => null) + ? caches.open('__BRK_CLIENT__').catch(() => null) : Promise.resolve(null); /** @@ -793,7 +792,7 @@ class BrkError extends Error { */ constructor(message, status) { super(message); - this.name = "BrkError"; + this.name = 'BrkError'; this.status = status; } } @@ -802,8 +801,8 @@ class BrkError extends Error { * @template T * @typedef {Object} MetricData * @property {number} total - Total number of data points - * @property {number} from - Start index (inclusive) - * @property {number} to - End index (exclusive) + * @property {number} start - Start index (inclusive) + * @property {number} end - End index (exclusive) * @property {T[]} data - The metric data */ /** @typedef {MetricData} AnyMetricData */ @@ -812,7 +811,7 @@ class BrkError extends Error { * @template T * @typedef {Object} MetricEndpoint * @property {(onUpdate?: (value: MetricData) => void) => Promise>} get - Fetch all data points - * @property {(from?: number, to?: number, onUpdate?: (value: MetricData) => void) => Promise>} range - Fetch data in range + * @property {(start?: number, end?: number, onUpdate?: (value: MetricData) => void) => Promise>} range - Fetch data in range * @property {string} path - The endpoint path */ /** @typedef {MetricEndpoint} AnyMetricEndpoint */ @@ -839,17 +838,15 @@ class BrkError extends Error { function _endpoint(client, name, index) { const p = `/api/metric/${name}/${index}`; return { - get: (onUpdate) => client.get(p, onUpdate), - range: (from, to, onUpdate) => { + get: (onUpdate) => client.getJson(p, onUpdate), + range: (start, end, onUpdate) => { const params = new URLSearchParams(); - if (from !== undefined) params.set("from", String(from)); - if (to !== undefined) params.set("to", String(to)); + if (start !== undefined) params.set('start', String(start)); + if (end !== undefined) params.set('end', String(end)); const query = params.toString(); - return client.get(query ? `${p}?${query}` : p, onUpdate); - }, - get path() { - return p; + return client.getJson(query ? `${p}?${query}` : p, onUpdate); }, + get path() { return p; }, }; } @@ -861,11 +858,23 @@ 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); } + /** + * @param {string} path + * @returns {Promise} + */ + async get(path) { + 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); + return res; + } + /** * Make a GET request with stale-while-revalidate caching * @template T @@ -873,10 +882,8 @@ class BrkClientBase { * @param {(value: T) => void} [onUpdate] - Called when data is available * @returns {Promise} */ - async get(path, onUpdate) { - const base = this.baseUrl.endsWith("/") - ? this.baseUrl.slice(0, -1) - : this.baseUrl; + 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 cachedRes = await cache?.match(url); @@ -885,16 +892,12 @@ class BrkClientBase { 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 fetch(url, { - signal: AbortSignal.timeout(this.timeout), - }); - if (!res.ok) throw new BrkError(`HTTP ${res.status}`, res.status); - if (cachedRes?.headers.get("ETag") === res.headers.get("ETag")) - return cachedJson; + const res = await this.get(path); + if (cachedRes?.headers.get('ETag') === res.headers.get('ETag')) return cachedJson; const cloned = res.clone(); const json = await res.json(); @@ -906,6 +909,16 @@ class BrkClientBase { throw e; } } + + /** + * Make a GET request and return raw text (for CSV responses) + * @param {string} path + * @returns {Promise} + */ + async getText(path) { + const res = await this.get(path); + return res.text(); + } } /** @@ -914,7 +927,8 @@ 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 @@ -934,52 +948,24 @@ 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); } - }, + } }; } @@ -999,48 +985,23 @@ 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); } - }, + } }; } @@ -1060,48 +1021,23 @@ 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); } - }, + } }; } @@ -1121,44 +1057,22 @@ 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); } - }, + } }; } @@ -1178,21 +1092,17 @@ 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); } - }, + } }; } @@ -1212,18 +1122,16 @@ 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); } - }, + } }; } @@ -1243,18 +1151,16 @@ 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); } - }, + } }; } @@ -1274,18 +1180,16 @@ 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); } - }, + } }; } @@ -1305,18 +1209,16 @@ 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); } - }, + } }; } @@ -1336,18 +1238,16 @@ 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); } - }, + } }; } @@ -1367,18 +1267,16 @@ 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); } - }, + } }; } @@ -1398,18 +1296,16 @@ 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); } - }, + } }; } @@ -1429,18 +1325,16 @@ 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); } - }, + } }; } @@ -1460,18 +1354,16 @@ 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); } - }, + } }; } @@ -1491,18 +1383,16 @@ 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); } - }, + } }; } @@ -1522,18 +1412,16 @@ 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); } - }, + } }; } @@ -1553,18 +1441,16 @@ 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); } - }, + } }; } @@ -1584,18 +1470,16 @@ 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); } - }, + } }; } @@ -1615,18 +1499,16 @@ 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); } - }, + } }; } @@ -1646,18 +1528,16 @@ 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); } - }, + } }; } @@ -1677,18 +1557,16 @@ 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); } - }, + } }; } @@ -1708,18 +1586,16 @@ 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); } - }, + } }; } @@ -1739,18 +1615,16 @@ 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); } - }, + } }; } @@ -1770,18 +1644,16 @@ 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); } - }, + } }; } @@ -1801,18 +1673,16 @@ 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); } - }, + } }; } @@ -1832,18 +1702,16 @@ 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); } - }, + } }; } @@ -1863,18 +1731,16 @@ 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); } - }, + } }; } @@ -1894,18 +1760,16 @@ 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); } - }, + } }; } @@ -1925,18 +1789,16 @@ 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); } - }, + } }; } @@ -1956,18 +1818,16 @@ 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); } - }, + } }; } @@ -1987,18 +1847,16 @@ 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); } - }, + } }; } @@ -2018,18 +1876,16 @@ 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); } - }, + } }; } @@ -2079,95 +1935,38 @@ 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')), }; } @@ -2213,87 +2012,36 @@ 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')), }; } @@ -2337,34 +2085,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')), }; } @@ -2407,78 +2155,33 @@ 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')), }; } @@ -2519,70 +2222,31 @@ 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')), }; } @@ -2619,25 +2283,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")), + 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')), }; } @@ -2672,25 +2336,25 @@ function createPrice111dSmaPattern(client, acc) { */ 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")), + 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')), }; } @@ -2726,23 +2390,23 @@ 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), }; } @@ -2777,75 +2441,24 @@ 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')), }; } @@ -2875,20 +2488,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')), }; } @@ -2959,18 +2572,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')), }; } @@ -3000,27 +2613,27 @@ 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 + * @typedef {Object} DollarsPattern * @property {MetricPattern2} average * @property {MetricPattern11} base - * @property {MetricPattern2} cumulative + * @property {MetricPattern1} cumulative * @property {MetricPattern2} max * @property {MetricPattern6} median * @property {MetricPattern2} min @@ -3032,25 +2645,25 @@ function createPeriodAveragePricePattern(client, acc) { */ /** - * Create a FullnessPattern pattern node + * Create a DollarsPattern pattern node * @template T * @param {BrkClientBase} client * @param {string} acc - Accumulated metric name - * @returns {FullnessPattern} + * @returns {DollarsPattern} */ -function createFullnessPattern(client, acc) { +function createDollarsPattern(client, acc) { return { - average: createMetricPattern2(client, _m(acc, "average")), + 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')), }; } @@ -3095,10 +2708,10 @@ function createClassAveragePricePattern(client, basePath) { /** * @template T - * @typedef {Object} DollarsPattern + * @typedef {Object} FullnessPattern * @property {MetricPattern2} average * @property {MetricPattern11} base - * @property {MetricPattern1} cumulative + * @property {MetricPattern2} cumulative * @property {MetricPattern2} max * @property {MetricPattern6} median * @property {MetricPattern2} min @@ -3110,87 +2723,25 @@ function createClassAveragePricePattern(client, basePath) { */ /** - * Create a DollarsPattern pattern node + * Create a FullnessPattern pattern node * @template T * @param {BrkClientBase} client * @param {string} acc - Accumulated metric name - * @returns {DollarsPattern} + * @returns {FullnessPattern} */ -function createDollarsPattern(client, acc) { +function createFullnessPattern(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")), - }; -} - -/** - * @typedef {Object} RelativePattern - * @property {MetricPattern1} negUnrealizedLossRelToMarketCap - * @property {MetricPattern1} netUnrealizedPnlRelToMarketCap - * @property {MetricPattern1} nupl - * @property {MetricPattern1} supplyInLossRelToCirculatingSupply - * @property {MetricPattern1} supplyInLossRelToOwnSupply - * @property {MetricPattern1} supplyInProfitRelToCirculatingSupply - * @property {MetricPattern1} supplyInProfitRelToOwnSupply - * @property {MetricPattern4} supplyRelToCirculatingSupply - * @property {MetricPattern1} unrealizedLossRelToMarketCap - * @property {MetricPattern1} unrealizedProfitRelToMarketCap - */ - -/** - * Create a RelativePattern pattern node - * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name - * @returns {RelativePattern} - */ -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"), - ), + 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')), }; } @@ -3216,46 +2767,51 @@ function createRelativePattern(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')), + }; +} + +/** + * @typedef {Object} RelativePattern + * @property {MetricPattern1} negUnrealizedLossRelToMarketCap + * @property {MetricPattern1} netUnrealizedPnlRelToMarketCap + * @property {MetricPattern1} nupl + * @property {MetricPattern1} supplyInLossRelToCirculatingSupply + * @property {MetricPattern1} supplyInLossRelToOwnSupply + * @property {MetricPattern1} supplyInProfitRelToCirculatingSupply + * @property {MetricPattern1} supplyInProfitRelToOwnSupply + * @property {MetricPattern4} supplyRelToCirculatingSupply + * @property {MetricPattern1} unrealizedLossRelToMarketCap + * @property {MetricPattern1} unrealizedProfitRelToMarketCap + */ + +/** + * Create a RelativePattern pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {RelativePattern} + */ +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')), }; } @@ -3283,16 +2839,16 @@ function createRelativePattern2(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')), }; } @@ -3352,14 +2908,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), }; } @@ -3385,16 +2941,45 @@ 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} 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 @@ -3419,7 +3004,7 @@ function create_10yTo12yPattern(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), }; } @@ -3448,36 +3033,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} _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")), + supply: createSupplyPattern2(client, _m(acc, 'supply')), unrealized: createUnrealizedPattern(client, acc), }; } @@ -3506,40 +3062,11 @@ function create_100btcPattern(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} 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} UnrealizedPattern * @property {MetricPattern1} negUnrealizedLoss @@ -3559,28 +3086,42 @@ function createPeriodCagrPattern(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), }; } @@ -3601,23 +3142,11 @@ 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')), }; } @@ -3639,31 +3168,31 @@ 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 + * @typedef {Object} CoinbasePattern + * @property {FullnessPattern} bitcoin + * @property {DollarsPattern} dollars + * @property {DollarsPattern} sats */ /** - * Create a UnclaimedRewardsPattern pattern node + * Create a CoinbasePattern pattern node * @param {BrkClientBase} client * @param {string} acc - Accumulated metric name - * @returns {UnclaimedRewardsPattern} + * @returns {CoinbasePattern} */ -function createUnclaimedRewardsPattern(client, acc) { +function createCoinbasePattern(client, acc) { return { - bitcoin: createBitcoinPattern(client, _m(acc, "btc")), - dollars: createBlockCountPattern(client, _m(acc, "usd")), - sats: createBlockCountPattern(client, acc), + bitcoin: createFullnessPattern(client, _m(acc, 'btc')), + dollars: createDollarsPattern(client, _m(acc, 'usd')), + sats: createDollarsPattern(client, acc), }; } @@ -3688,27 +3217,6 @@ function createCostBasisPattern2(client, basePath) { }; } -/** - * @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} CoinbasePattern2 * @property {BlockCountPattern} bitcoin @@ -3724,12 +3232,33 @@ function createCoinbasePattern(client, acc) { */ function createCoinbasePattern2(client, acc) { return { - bitcoin: createBlockCountPattern(client, _m(acc, "btc")), - dollars: createBlockCountPattern(client, _m(acc, "usd")), + bitcoin: createBlockCountPattern(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} _2015Pattern * @property {MetricPattern4} bitcoin @@ -3745,12 +3274,33 @@ function createCoinbasePattern2(client, acc) { */ function create_2015Pattern(client, acc) { return { - bitcoin: createMetricPattern4(client, _m(acc, "btc")), - dollars: createMetricPattern4(client, _m(acc, "usd")), + bitcoin: createMetricPattern4(client, _m(acc, 'btc')), + dollars: createMetricPattern4(client, _m(acc, 'usd')), sats: createMetricPattern4(client, acc), }; } +/** + * @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} SegwitAdoptionPattern * @property {MetricPattern11} base @@ -3767,67 +3317,8 @@ function create_2015Pattern(client, acc) { function createSegwitAdoptionPattern(client, acc) { return { base: createMetricPattern11(client, acc), - cumulative: createMetricPattern2(client, _m(acc, "cumulative")), - sum: createMetricPattern2(client, _m(acc, "sum")), - }; -} - -/** - * @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} _1dReturns1mSdPattern - * @property {MetricPattern4} sd - * @property {MetricPattern4} sma - */ - -/** - * Create a _1dReturns1mSdPattern pattern node - * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name - * @returns {_1dReturns1mSdPattern} - */ -function create_1dReturns1mSdPattern(client, acc) { - return { - sd: createMetricPattern4(client, _m(acc, "sd")), - sma: createMetricPattern4(client, _m(acc, "sma")), - }; -} - -/** - * @typedef {Object} CostBasisPattern - * @property {MetricPattern1} max - * @property {MetricPattern1} min - */ - -/** - * Create a CostBasisPattern pattern node - * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name - * @returns {CostBasisPattern} - */ -function createCostBasisPattern(client, acc) { - return { - max: createMetricPattern1(client, _m(acc, "max_cost_basis")), - min: createMetricPattern1(client, _m(acc, "min_cost_basis")), + cumulative: createMetricPattern2(client, _m(acc, 'cumulative')), + sum: createMetricPattern2(client, _m(acc, 'sum')), }; } @@ -3845,11 +3336,30 @@ function createCostBasisPattern(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} CostBasisPattern + * @property {MetricPattern1} max + * @property {MetricPattern1} min + */ + +/** + * Create a CostBasisPattern pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {CostBasisPattern} + */ +function createCostBasisPattern(client, acc) { + return { + max: createMetricPattern1(client, _m(acc, 'max_cost_basis')), + min: createMetricPattern1(client, _m(acc, 'min_cost_basis')), + }; +} + /** * @typedef {Object} RelativePattern4 * @property {MetricPattern1} supplyInLossRelToOwnSupply @@ -3864,14 +3374,69 @@ function createSupplyPattern2(client, acc) { */ 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"), - ), + supplyInLossRelToOwnSupply: createMetricPattern1(client, _m(acc, 'loss_rel_to_own_supply')), + supplyInProfitRelToOwnSupply: createMetricPattern1(client, _m(acc, 'profit_rel_to_own_supply')), + }; +} + +/** + * @typedef {Object} _1dReturns1mSdPattern + * @property {MetricPattern4} sd + * @property {MetricPattern4} sma + */ + +/** + * Create a _1dReturns1mSdPattern pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {_1dReturns1mSdPattern} + */ +function create_1dReturns1mSdPattern(client, acc) { + return { + sd: createMetricPattern4(client, _m(acc, 'sd')), + sma: createMetricPattern4(client, _m(acc, 'sma')), + }; +} + +/** + * @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), }; } @@ -3896,48 +3461,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} OutputsPattern * @property {MetricPattern1} utxoCount @@ -3951,7 +3474,7 @@ function createBlockCountPattern(client, acc) { */ function createOutputsPattern(client, acc) { return { - utxoCount: createMetricPattern1(client, _m(acc, "utxo_count")), + utxoCount: createMetricPattern1(client, _m(acc, 'utxo_count')), }; } @@ -3968,33 +3491,33 @@ function createOutputsPattern(client, acc) { */ function createRealizedPriceExtraPattern(client, acc) { return { - ratio: createMetricPattern4(client, _m(acc, "ratio")), + ratio: createMetricPattern4(client, _m(acc, 'ratio')), }; } // Catalog tree typedefs /** - * @typedef {Object} CatalogTree - * @property {CatalogTree_Addresses} addresses - * @property {CatalogTree_Blocks} blocks - * @property {CatalogTree_Cointime} cointime - * @property {CatalogTree_Constants} constants - * @property {CatalogTree_Distribution} distribution - * @property {CatalogTree_Indexes} indexes - * @property {CatalogTree_Inputs} inputs - * @property {CatalogTree_Market} market - * @property {CatalogTree_Outputs} outputs - * @property {CatalogTree_Pools} pools - * @property {CatalogTree_Positions} positions - * @property {CatalogTree_Price} price - * @property {CatalogTree_Scripts} scripts - * @property {CatalogTree_Supply} supply - * @property {CatalogTree_Transactions} transactions + * @typedef {Object} MetricsTree + * @property {MetricsTree_Addresses} addresses + * @property {MetricsTree_Blocks} blocks + * @property {MetricsTree_Cointime} cointime + * @property {MetricsTree_Constants} constants + * @property {MetricsTree_Distribution} distribution + * @property {MetricsTree_Indexes} indexes + * @property {MetricsTree_Inputs} inputs + * @property {MetricsTree_Market} market + * @property {MetricsTree_Outputs} outputs + * @property {MetricsTree_Pools} pools + * @property {MetricsTree_Positions} positions + * @property {MetricsTree_Price} price + * @property {MetricsTree_Scripts} scripts + * @property {MetricsTree_Supply} supply + * @property {MetricsTree_Transactions} transactions */ /** - * @typedef {Object} CatalogTree_Addresses + * @typedef {Object} MetricsTree_Addresses * @property {MetricPattern11} firstP2aaddressindex * @property {MetricPattern11} firstP2pk33addressindex * @property {MetricPattern11} firstP2pk65addressindex @@ -4014,24 +3537,24 @@ function createRealizedPriceExtraPattern(client, acc) { */ /** - * @typedef {Object} CatalogTree_Blocks + * @typedef {Object} MetricsTree_Blocks * @property {MetricPattern11} blockhash - * @property {CatalogTree_Blocks_Count} count - * @property {CatalogTree_Blocks_Difficulty} difficulty + * @property {MetricsTree_Blocks_Count} count + * @property {MetricsTree_Blocks_Difficulty} difficulty * @property {FullnessPattern} fullness - * @property {CatalogTree_Blocks_Halving} halving - * @property {CatalogTree_Blocks_Interval} interval - * @property {CatalogTree_Blocks_Mining} mining - * @property {CatalogTree_Blocks_Rewards} rewards - * @property {CatalogTree_Blocks_Size} size - * @property {CatalogTree_Blocks_Time} time + * @property {MetricsTree_Blocks_Halving} halving + * @property {MetricsTree_Blocks_Interval} interval + * @property {MetricsTree_Blocks_Mining} mining + * @property {MetricsTree_Blocks_Rewards} rewards + * @property {MetricsTree_Blocks_Size} size + * @property {MetricsTree_Blocks_Time} time * @property {MetricPattern11} totalSize * @property {DollarsPattern} vbytes * @property {DollarsPattern} weight */ /** - * @typedef {Object} CatalogTree_Blocks_Count + * @typedef {Object} MetricsTree_Blocks_Count * @property {MetricPattern1} _1mBlockCount * @property {MetricPattern11} _1mStart * @property {MetricPattern1} _1wBlockCount @@ -4045,7 +3568,7 @@ function createRealizedPriceExtraPattern(client, acc) { */ /** - * @typedef {Object} CatalogTree_Blocks_Difficulty + * @typedef {Object} MetricsTree_Blocks_Difficulty * @property {MetricPattern1} adjustment * @property {MetricPattern1} asHash * @property {MetricPattern1} blocksBeforeNextAdjustment @@ -4055,14 +3578,14 @@ function createRealizedPriceExtraPattern(client, acc) { */ /** - * @typedef {Object} CatalogTree_Blocks_Halving + * @typedef {Object} MetricsTree_Blocks_Halving * @property {MetricPattern1} blocksBeforeNextHalving * @property {MetricPattern1} daysBeforeNextHalving * @property {MetricPattern4} epoch */ /** - * @typedef {Object} CatalogTree_Blocks_Interval + * @typedef {Object} MetricsTree_Blocks_Interval * @property {MetricPattern2} average * @property {MetricPattern11} base * @property {MetricPattern2} max @@ -4075,7 +3598,7 @@ function createRealizedPriceExtraPattern(client, acc) { */ /** - * @typedef {Object} CatalogTree_Blocks_Mining + * @typedef {Object} MetricsTree_Blocks_Mining * @property {MetricPattern1} hashPricePhs * @property {MetricPattern1} hashPricePhsMin * @property {MetricPattern1} hashPriceRebound @@ -4094,8 +3617,8 @@ function createRealizedPriceExtraPattern(client, acc) { */ /** - * @typedef {Object} CatalogTree_Blocks_Rewards - * @property {CatalogTree_Blocks_Rewards_24hCoinbaseSum} _24hCoinbaseSum + * @typedef {Object} MetricsTree_Blocks_Rewards + * @property {MetricsTree_Blocks_Rewards_24hCoinbaseSum} _24hCoinbaseSum * @property {CoinbasePattern} coinbase * @property {MetricPattern6} feeDominance * @property {CoinbasePattern} subsidy @@ -4105,14 +3628,14 @@ function createRealizedPriceExtraPattern(client, acc) { */ /** - * @typedef {Object} CatalogTree_Blocks_Rewards_24hCoinbaseSum + * @typedef {Object} MetricsTree_Blocks_Rewards_24hCoinbaseSum * @property {MetricPattern11} bitcoin * @property {MetricPattern11} dollars * @property {MetricPattern11} sats */ /** - * @typedef {Object} CatalogTree_Blocks_Size + * @typedef {Object} MetricsTree_Blocks_Size * @property {MetricPattern2} average * @property {MetricPattern1} cumulative * @property {MetricPattern2} max @@ -4126,7 +3649,7 @@ function createRealizedPriceExtraPattern(client, acc) { */ /** - * @typedef {Object} CatalogTree_Blocks_Time + * @typedef {Object} MetricsTree_Blocks_Time * @property {MetricPattern11} date * @property {MetricPattern11} dateFixed * @property {MetricPattern1} timestamp @@ -4134,17 +3657,17 @@ function createRealizedPriceExtraPattern(client, acc) { */ /** - * @typedef {Object} CatalogTree_Cointime - * @property {CatalogTree_Cointime_Activity} activity - * @property {CatalogTree_Cointime_Adjusted} adjusted - * @property {CatalogTree_Cointime_Cap} cap - * @property {CatalogTree_Cointime_Pricing} pricing - * @property {CatalogTree_Cointime_Supply} supply - * @property {CatalogTree_Cointime_Value} value + * @typedef {Object} MetricsTree_Cointime + * @property {MetricsTree_Cointime_Activity} activity + * @property {MetricsTree_Cointime_Adjusted} adjusted + * @property {MetricsTree_Cointime_Cap} cap + * @property {MetricsTree_Cointime_Pricing} pricing + * @property {MetricsTree_Cointime_Supply} supply + * @property {MetricsTree_Cointime_Value} value */ /** - * @typedef {Object} CatalogTree_Cointime_Activity + * @typedef {Object} MetricsTree_Cointime_Activity * @property {MetricPattern1} activityToVaultednessRatio * @property {BlockCountPattern} coinblocksCreated * @property {BlockCountPattern} coinblocksStored @@ -4153,14 +3676,14 @@ function createRealizedPriceExtraPattern(client, acc) { */ /** - * @typedef {Object} CatalogTree_Cointime_Adjusted + * @typedef {Object} MetricsTree_Cointime_Adjusted * @property {MetricPattern4} cointimeAdjInflationRate * @property {MetricPattern4} cointimeAdjTxBtcVelocity * @property {MetricPattern4} cointimeAdjTxUsdVelocity */ /** - * @typedef {Object} CatalogTree_Cointime_Cap + * @typedef {Object} MetricsTree_Cointime_Cap * @property {MetricPattern1} activeCap * @property {MetricPattern1} cointimeCap * @property {MetricPattern1} investorCap @@ -4169,7 +3692,7 @@ function createRealizedPriceExtraPattern(client, acc) { */ /** - * @typedef {Object} CatalogTree_Cointime_Pricing + * @typedef {Object} MetricsTree_Cointime_Pricing * @property {MetricPattern1} activePrice * @property {ActivePriceRatioPattern} activePriceRatio * @property {MetricPattern1} cointimePrice @@ -4181,20 +3704,20 @@ function createRealizedPriceExtraPattern(client, acc) { */ /** - * @typedef {Object} CatalogTree_Cointime_Supply + * @typedef {Object} MetricsTree_Cointime_Supply * @property {ActiveSupplyPattern} activeSupply * @property {ActiveSupplyPattern} vaultedSupply */ /** - * @typedef {Object} CatalogTree_Cointime_Value + * @typedef {Object} MetricsTree_Cointime_Value * @property {BlockCountPattern} cointimeValueCreated * @property {BlockCountPattern} cointimeValueDestroyed * @property {BlockCountPattern} cointimeValueStored */ /** - * @typedef {Object} CatalogTree_Constants + * @typedef {Object} MetricsTree_Constants * @property {MetricPattern1} constant0 * @property {MetricPattern1} constant1 * @property {MetricPattern1} constant100 @@ -4216,20 +3739,20 @@ function createRealizedPriceExtraPattern(client, acc) { */ /** - * @typedef {Object} CatalogTree_Distribution - * @property {CatalogTree_Distribution_AddrCount} addrCount - * @property {CatalogTree_Distribution_AddressCohorts} addressCohorts - * @property {CatalogTree_Distribution_AddressesData} addressesData - * @property {CatalogTree_Distribution_AnyAddressIndexes} anyAddressIndexes + * @typedef {Object} MetricsTree_Distribution + * @property {MetricsTree_Distribution_AddrCount} addrCount + * @property {MetricsTree_Distribution_AddressCohorts} addressCohorts + * @property {MetricsTree_Distribution_AddressesData} addressesData + * @property {MetricsTree_Distribution_AnyAddressIndexes} anyAddressIndexes * @property {MetricPattern11} chainState - * @property {CatalogTree_Distribution_EmptyAddrCount} emptyAddrCount + * @property {MetricsTree_Distribution_EmptyAddrCount} emptyAddrCount * @property {MetricPattern32} emptyaddressindex * @property {MetricPattern31} loadedaddressindex - * @property {CatalogTree_Distribution_UtxoCohorts} utxoCohorts + * @property {MetricsTree_Distribution_UtxoCohorts} utxoCohorts */ /** - * @typedef {Object} CatalogTree_Distribution_AddrCount + * @typedef {Object} MetricsTree_Distribution_AddrCount * @property {MetricPattern1} all * @property {MetricPattern1} p2a * @property {MetricPattern1} p2pk33 @@ -4242,14 +3765,14 @@ function createRealizedPriceExtraPattern(client, acc) { */ /** - * @typedef {Object} CatalogTree_Distribution_AddressCohorts - * @property {CatalogTree_Distribution_AddressCohorts_AmountRange} amountRange - * @property {CatalogTree_Distribution_AddressCohorts_GeAmount} geAmount - * @property {CatalogTree_Distribution_AddressCohorts_LtAmount} ltAmount + * @typedef {Object} MetricsTree_Distribution_AddressCohorts + * @property {MetricsTree_Distribution_AddressCohorts_AmountRange} amountRange + * @property {MetricsTree_Distribution_AddressCohorts_GeAmount} geAmount + * @property {MetricsTree_Distribution_AddressCohorts_LtAmount} ltAmount */ /** - * @typedef {Object} CatalogTree_Distribution_AddressCohorts_AmountRange + * @typedef {Object} MetricsTree_Distribution_AddressCohorts_AmountRange * @property {_0satsPattern} _0sats * @property {_0satsPattern} _100btcTo1kBtc * @property {_0satsPattern} _100kBtcOrMore @@ -4268,7 +3791,7 @@ function createRealizedPriceExtraPattern(client, acc) { */ /** - * @typedef {Object} CatalogTree_Distribution_AddressCohorts_GeAmount + * @typedef {Object} MetricsTree_Distribution_AddressCohorts_GeAmount * @property {_0satsPattern} _100btc * @property {_0satsPattern} _100kSats * @property {_0satsPattern} _100sats @@ -4285,7 +3808,7 @@ function createRealizedPriceExtraPattern(client, acc) { */ /** - * @typedef {Object} CatalogTree_Distribution_AddressCohorts_LtAmount + * @typedef {Object} MetricsTree_Distribution_AddressCohorts_LtAmount * @property {_0satsPattern} _100btc * @property {_0satsPattern} _100kBtc * @property {_0satsPattern} _100kSats @@ -4302,13 +3825,13 @@ function createRealizedPriceExtraPattern(client, acc) { */ /** - * @typedef {Object} CatalogTree_Distribution_AddressesData + * @typedef {Object} MetricsTree_Distribution_AddressesData * @property {MetricPattern32} empty * @property {MetricPattern31} loaded */ /** - * @typedef {Object} CatalogTree_Distribution_AnyAddressIndexes + * @typedef {Object} MetricsTree_Distribution_AnyAddressIndexes * @property {MetricPattern16} p2a * @property {MetricPattern18} p2pk33 * @property {MetricPattern19} p2pk65 @@ -4320,7 +3843,7 @@ function createRealizedPriceExtraPattern(client, acc) { */ /** - * @typedef {Object} CatalogTree_Distribution_EmptyAddrCount + * @typedef {Object} MetricsTree_Distribution_EmptyAddrCount * @property {MetricPattern1} all * @property {MetricPattern1} p2a * @property {MetricPattern1} p2pk33 @@ -4333,22 +3856,22 @@ function createRealizedPriceExtraPattern(client, acc) { */ /** - * @typedef {Object} CatalogTree_Distribution_UtxoCohorts - * @property {CatalogTree_Distribution_UtxoCohorts_AgeRange} ageRange - * @property {CatalogTree_Distribution_UtxoCohorts_All} all - * @property {CatalogTree_Distribution_UtxoCohorts_AmountRange} amountRange - * @property {CatalogTree_Distribution_UtxoCohorts_Epoch} epoch - * @property {CatalogTree_Distribution_UtxoCohorts_GeAmount} geAmount - * @property {CatalogTree_Distribution_UtxoCohorts_LtAmount} ltAmount - * @property {CatalogTree_Distribution_UtxoCohorts_MaxAge} maxAge - * @property {CatalogTree_Distribution_UtxoCohorts_MinAge} minAge - * @property {CatalogTree_Distribution_UtxoCohorts_Term} term - * @property {CatalogTree_Distribution_UtxoCohorts_Type} type - * @property {CatalogTree_Distribution_UtxoCohorts_Year} year + * @typedef {Object} MetricsTree_Distribution_UtxoCohorts + * @property {MetricsTree_Distribution_UtxoCohorts_AgeRange} ageRange + * @property {MetricsTree_Distribution_UtxoCohorts_All} all + * @property {MetricsTree_Distribution_UtxoCohorts_AmountRange} amountRange + * @property {MetricsTree_Distribution_UtxoCohorts_Epoch} epoch + * @property {MetricsTree_Distribution_UtxoCohorts_GeAmount} geAmount + * @property {MetricsTree_Distribution_UtxoCohorts_LtAmount} ltAmount + * @property {MetricsTree_Distribution_UtxoCohorts_MaxAge} maxAge + * @property {MetricsTree_Distribution_UtxoCohorts_MinAge} minAge + * @property {MetricsTree_Distribution_UtxoCohorts_Term} term + * @property {MetricsTree_Distribution_UtxoCohorts_Type} type + * @property {MetricsTree_Distribution_UtxoCohorts_Year} year */ /** - * @typedef {Object} CatalogTree_Distribution_UtxoCohorts_AgeRange + * @typedef {Object} MetricsTree_Distribution_UtxoCohorts_AgeRange * @property {_10yTo12yPattern} _10yTo12y * @property {_10yTo12yPattern} _12yTo15y * @property {_10yTo12yPattern} _1dTo1w @@ -4373,25 +3896,25 @@ function createRealizedPriceExtraPattern(client, acc) { */ /** - * @typedef {Object} CatalogTree_Distribution_UtxoCohorts_All + * @typedef {Object} MetricsTree_Distribution_UtxoCohorts_All * @property {ActivityPattern2} activity - * @property {CatalogTree_Distribution_UtxoCohorts_All_CostBasis} costBasis + * @property {MetricsTree_Distribution_UtxoCohorts_All_CostBasis} costBasis * @property {OutputsPattern} outputs * @property {RealizedPattern3} realized - * @property {CatalogTree_Distribution_UtxoCohorts_All_Relative} relative + * @property {MetricsTree_Distribution_UtxoCohorts_All_Relative} relative * @property {SupplyPattern2} supply * @property {UnrealizedPattern} unrealized */ /** - * @typedef {Object} CatalogTree_Distribution_UtxoCohorts_All_CostBasis + * @typedef {Object} MetricsTree_Distribution_UtxoCohorts_All_CostBasis * @property {MetricPattern1} max * @property {MetricPattern1} min * @property {PercentilesPattern} percentiles */ /** - * @typedef {Object} CatalogTree_Distribution_UtxoCohorts_All_Relative + * @typedef {Object} MetricsTree_Distribution_UtxoCohorts_All_Relative * @property {MetricPattern1} negUnrealizedLossRelToOwnTotalUnrealizedPnl * @property {MetricPattern1} netUnrealizedPnlRelToOwnTotalUnrealizedPnl * @property {MetricPattern1} supplyInLossRelToOwnSupply @@ -4401,7 +3924,7 @@ function createRealizedPriceExtraPattern(client, acc) { */ /** - * @typedef {Object} CatalogTree_Distribution_UtxoCohorts_AmountRange + * @typedef {Object} MetricsTree_Distribution_UtxoCohorts_AmountRange * @property {_0satsPattern2} _0sats * @property {_0satsPattern2} _100btcTo1kBtc * @property {_0satsPattern2} _100kBtcOrMore @@ -4420,7 +3943,7 @@ function createRealizedPriceExtraPattern(client, acc) { */ /** - * @typedef {Object} CatalogTree_Distribution_UtxoCohorts_Epoch + * @typedef {Object} MetricsTree_Distribution_UtxoCohorts_Epoch * @property {_0satsPattern2} _0 * @property {_0satsPattern2} _1 * @property {_0satsPattern2} _2 @@ -4429,7 +3952,7 @@ function createRealizedPriceExtraPattern(client, acc) { */ /** - * @typedef {Object} CatalogTree_Distribution_UtxoCohorts_GeAmount + * @typedef {Object} MetricsTree_Distribution_UtxoCohorts_GeAmount * @property {_100btcPattern} _100btc * @property {_100btcPattern} _100kSats * @property {_100btcPattern} _100sats @@ -4446,7 +3969,7 @@ function createRealizedPriceExtraPattern(client, acc) { */ /** - * @typedef {Object} CatalogTree_Distribution_UtxoCohorts_LtAmount + * @typedef {Object} MetricsTree_Distribution_UtxoCohorts_LtAmount * @property {_100btcPattern} _100btc * @property {_100btcPattern} _100kBtc * @property {_100btcPattern} _100kSats @@ -4463,7 +3986,7 @@ function createRealizedPriceExtraPattern(client, acc) { */ /** - * @typedef {Object} CatalogTree_Distribution_UtxoCohorts_MaxAge + * @typedef {Object} MetricsTree_Distribution_UtxoCohorts_MaxAge * @property {_10yPattern} _10y * @property {_10yPattern} _12y * @property {_10yPattern} _15y @@ -4485,7 +4008,7 @@ function createRealizedPriceExtraPattern(client, acc) { */ /** - * @typedef {Object} CatalogTree_Distribution_UtxoCohorts_MinAge + * @typedef {Object} MetricsTree_Distribution_UtxoCohorts_MinAge * @property {_100btcPattern} _10y * @property {_100btcPattern} _12y * @property {_100btcPattern} _1d @@ -4507,15 +4030,15 @@ function createRealizedPriceExtraPattern(client, acc) { */ /** - * @typedef {Object} CatalogTree_Distribution_UtxoCohorts_Term - * @property {CatalogTree_Distribution_UtxoCohorts_Term_Long} long - * @property {CatalogTree_Distribution_UtxoCohorts_Term_Short} short + * @typedef {Object} MetricsTree_Distribution_UtxoCohorts_Term + * @property {MetricsTree_Distribution_UtxoCohorts_Term_Long} long + * @property {MetricsTree_Distribution_UtxoCohorts_Term_Short} short */ /** - * @typedef {Object} CatalogTree_Distribution_UtxoCohorts_Term_Long + * @typedef {Object} MetricsTree_Distribution_UtxoCohorts_Term_Long * @property {ActivityPattern2} activity - * @property {CatalogTree_Distribution_UtxoCohorts_Term_Long_CostBasis} costBasis + * @property {MetricsTree_Distribution_UtxoCohorts_Term_Long_CostBasis} costBasis * @property {OutputsPattern} outputs * @property {RealizedPattern2} realized * @property {RelativePattern5} relative @@ -4524,16 +4047,16 @@ function createRealizedPriceExtraPattern(client, acc) { */ /** - * @typedef {Object} CatalogTree_Distribution_UtxoCohorts_Term_Long_CostBasis + * @typedef {Object} MetricsTree_Distribution_UtxoCohorts_Term_Long_CostBasis * @property {MetricPattern1} max * @property {MetricPattern1} min * @property {PercentilesPattern} percentiles */ /** - * @typedef {Object} CatalogTree_Distribution_UtxoCohorts_Term_Short + * @typedef {Object} MetricsTree_Distribution_UtxoCohorts_Term_Short * @property {ActivityPattern2} activity - * @property {CatalogTree_Distribution_UtxoCohorts_Term_Short_CostBasis} costBasis + * @property {MetricsTree_Distribution_UtxoCohorts_Term_Short_CostBasis} costBasis * @property {OutputsPattern} outputs * @property {RealizedPattern3} realized * @property {RelativePattern5} relative @@ -4542,14 +4065,14 @@ function createRealizedPriceExtraPattern(client, acc) { */ /** - * @typedef {Object} CatalogTree_Distribution_UtxoCohorts_Term_Short_CostBasis + * @typedef {Object} MetricsTree_Distribution_UtxoCohorts_Term_Short_CostBasis * @property {MetricPattern1} max * @property {MetricPattern1} min * @property {PercentilesPattern} percentiles */ /** - * @typedef {Object} CatalogTree_Distribution_UtxoCohorts_Type + * @typedef {Object} MetricsTree_Distribution_UtxoCohorts_Type * @property {_0satsPattern2} empty * @property {_0satsPattern2} p2a * @property {_0satsPattern2} p2ms @@ -4564,7 +4087,7 @@ function createRealizedPriceExtraPattern(client, acc) { */ /** - * @typedef {Object} CatalogTree_Distribution_UtxoCohorts_Year + * @typedef {Object} MetricsTree_Distribution_UtxoCohorts_Year * @property {_0satsPattern2} _2009 * @property {_0satsPattern2} _2010 * @property {_0satsPattern2} _2011 @@ -4586,101 +4109,101 @@ function createRealizedPriceExtraPattern(client, acc) { */ /** - * @typedef {Object} CatalogTree_Indexes - * @property {CatalogTree_Indexes_Address} address - * @property {CatalogTree_Indexes_Dateindex} dateindex - * @property {CatalogTree_Indexes_Decadeindex} decadeindex - * @property {CatalogTree_Indexes_Difficultyepoch} difficultyepoch - * @property {CatalogTree_Indexes_Halvingepoch} halvingepoch - * @property {CatalogTree_Indexes_Height} height - * @property {CatalogTree_Indexes_Monthindex} monthindex - * @property {CatalogTree_Indexes_Quarterindex} quarterindex - * @property {CatalogTree_Indexes_Semesterindex} semesterindex - * @property {CatalogTree_Indexes_Txindex} txindex - * @property {CatalogTree_Indexes_Txinindex} txinindex - * @property {CatalogTree_Indexes_Txoutindex} txoutindex - * @property {CatalogTree_Indexes_Weekindex} weekindex - * @property {CatalogTree_Indexes_Yearindex} yearindex + * @typedef {Object} MetricsTree_Indexes + * @property {MetricsTree_Indexes_Address} address + * @property {MetricsTree_Indexes_Dateindex} dateindex + * @property {MetricsTree_Indexes_Decadeindex} decadeindex + * @property {MetricsTree_Indexes_Difficultyepoch} difficultyepoch + * @property {MetricsTree_Indexes_Halvingepoch} halvingepoch + * @property {MetricsTree_Indexes_Height} height + * @property {MetricsTree_Indexes_Monthindex} monthindex + * @property {MetricsTree_Indexes_Quarterindex} quarterindex + * @property {MetricsTree_Indexes_Semesterindex} semesterindex + * @property {MetricsTree_Indexes_Txindex} txindex + * @property {MetricsTree_Indexes_Txinindex} txinindex + * @property {MetricsTree_Indexes_Txoutindex} txoutindex + * @property {MetricsTree_Indexes_Weekindex} weekindex + * @property {MetricsTree_Indexes_Yearindex} yearindex */ /** - * @typedef {Object} CatalogTree_Indexes_Address - * @property {CatalogTree_Indexes_Address_Empty} empty - * @property {CatalogTree_Indexes_Address_Opreturn} opreturn - * @property {CatalogTree_Indexes_Address_P2a} p2a - * @property {CatalogTree_Indexes_Address_P2ms} p2ms - * @property {CatalogTree_Indexes_Address_P2pk33} p2pk33 - * @property {CatalogTree_Indexes_Address_P2pk65} p2pk65 - * @property {CatalogTree_Indexes_Address_P2pkh} p2pkh - * @property {CatalogTree_Indexes_Address_P2sh} p2sh - * @property {CatalogTree_Indexes_Address_P2tr} p2tr - * @property {CatalogTree_Indexes_Address_P2wpkh} p2wpkh - * @property {CatalogTree_Indexes_Address_P2wsh} p2wsh - * @property {CatalogTree_Indexes_Address_Unknown} unknown + * @typedef {Object} MetricsTree_Indexes_Address + * @property {MetricsTree_Indexes_Address_Empty} empty + * @property {MetricsTree_Indexes_Address_Opreturn} opreturn + * @property {MetricsTree_Indexes_Address_P2a} p2a + * @property {MetricsTree_Indexes_Address_P2ms} p2ms + * @property {MetricsTree_Indexes_Address_P2pk33} p2pk33 + * @property {MetricsTree_Indexes_Address_P2pk65} p2pk65 + * @property {MetricsTree_Indexes_Address_P2pkh} p2pkh + * @property {MetricsTree_Indexes_Address_P2sh} p2sh + * @property {MetricsTree_Indexes_Address_P2tr} p2tr + * @property {MetricsTree_Indexes_Address_P2wpkh} p2wpkh + * @property {MetricsTree_Indexes_Address_P2wsh} p2wsh + * @property {MetricsTree_Indexes_Address_Unknown} unknown */ /** - * @typedef {Object} CatalogTree_Indexes_Address_Empty + * @typedef {Object} MetricsTree_Indexes_Address_Empty * @property {MetricPattern9} identity */ /** - * @typedef {Object} CatalogTree_Indexes_Address_Opreturn + * @typedef {Object} MetricsTree_Indexes_Address_Opreturn * @property {MetricPattern14} identity */ /** - * @typedef {Object} CatalogTree_Indexes_Address_P2a + * @typedef {Object} MetricsTree_Indexes_Address_P2a * @property {MetricPattern16} identity */ /** - * @typedef {Object} CatalogTree_Indexes_Address_P2ms + * @typedef {Object} MetricsTree_Indexes_Address_P2ms * @property {MetricPattern17} identity */ /** - * @typedef {Object} CatalogTree_Indexes_Address_P2pk33 + * @typedef {Object} MetricsTree_Indexes_Address_P2pk33 * @property {MetricPattern18} identity */ /** - * @typedef {Object} CatalogTree_Indexes_Address_P2pk65 + * @typedef {Object} MetricsTree_Indexes_Address_P2pk65 * @property {MetricPattern19} identity */ /** - * @typedef {Object} CatalogTree_Indexes_Address_P2pkh + * @typedef {Object} MetricsTree_Indexes_Address_P2pkh * @property {MetricPattern20} identity */ /** - * @typedef {Object} CatalogTree_Indexes_Address_P2sh + * @typedef {Object} MetricsTree_Indexes_Address_P2sh * @property {MetricPattern21} identity */ /** - * @typedef {Object} CatalogTree_Indexes_Address_P2tr + * @typedef {Object} MetricsTree_Indexes_Address_P2tr * @property {MetricPattern22} identity */ /** - * @typedef {Object} CatalogTree_Indexes_Address_P2wpkh + * @typedef {Object} MetricsTree_Indexes_Address_P2wpkh * @property {MetricPattern23} identity */ /** - * @typedef {Object} CatalogTree_Indexes_Address_P2wsh + * @typedef {Object} MetricsTree_Indexes_Address_P2wsh * @property {MetricPattern24} identity */ /** - * @typedef {Object} CatalogTree_Indexes_Address_Unknown + * @typedef {Object} MetricsTree_Indexes_Address_Unknown * @property {MetricPattern28} identity */ /** - * @typedef {Object} CatalogTree_Indexes_Dateindex + * @typedef {Object} MetricsTree_Indexes_Dateindex * @property {MetricPattern6} date * @property {MetricPattern6} firstHeight * @property {MetricPattern6} heightCount @@ -4690,27 +4213,27 @@ function createRealizedPriceExtraPattern(client, acc) { */ /** - * @typedef {Object} CatalogTree_Indexes_Decadeindex + * @typedef {Object} MetricsTree_Indexes_Decadeindex * @property {MetricPattern7} firstYearindex * @property {MetricPattern7} identity * @property {MetricPattern7} yearindexCount */ /** - * @typedef {Object} CatalogTree_Indexes_Difficultyepoch + * @typedef {Object} MetricsTree_Indexes_Difficultyepoch * @property {MetricPattern8} firstHeight * @property {MetricPattern8} heightCount * @property {MetricPattern8} identity */ /** - * @typedef {Object} CatalogTree_Indexes_Halvingepoch + * @typedef {Object} MetricsTree_Indexes_Halvingepoch * @property {MetricPattern10} firstHeight * @property {MetricPattern10} identity */ /** - * @typedef {Object} CatalogTree_Indexes_Height + * @typedef {Object} MetricsTree_Indexes_Height * @property {MetricPattern11} dateindex * @property {MetricPattern11} difficultyepoch * @property {MetricPattern11} halvingepoch @@ -4719,7 +4242,7 @@ function createRealizedPriceExtraPattern(client, acc) { */ /** - * @typedef {Object} CatalogTree_Indexes_Monthindex + * @typedef {Object} MetricsTree_Indexes_Monthindex * @property {MetricPattern13} dateindexCount * @property {MetricPattern13} firstDateindex * @property {MetricPattern13} identity @@ -4729,45 +4252,45 @@ function createRealizedPriceExtraPattern(client, acc) { */ /** - * @typedef {Object} CatalogTree_Indexes_Quarterindex + * @typedef {Object} MetricsTree_Indexes_Quarterindex * @property {MetricPattern25} firstMonthindex * @property {MetricPattern25} identity * @property {MetricPattern25} monthindexCount */ /** - * @typedef {Object} CatalogTree_Indexes_Semesterindex + * @typedef {Object} MetricsTree_Indexes_Semesterindex * @property {MetricPattern26} firstMonthindex * @property {MetricPattern26} identity * @property {MetricPattern26} monthindexCount */ /** - * @typedef {Object} CatalogTree_Indexes_Txindex + * @typedef {Object} MetricsTree_Indexes_Txindex * @property {MetricPattern27} identity * @property {MetricPattern27} inputCount * @property {MetricPattern27} outputCount */ /** - * @typedef {Object} CatalogTree_Indexes_Txinindex + * @typedef {Object} MetricsTree_Indexes_Txinindex * @property {MetricPattern12} identity */ /** - * @typedef {Object} CatalogTree_Indexes_Txoutindex + * @typedef {Object} MetricsTree_Indexes_Txoutindex * @property {MetricPattern15} identity */ /** - * @typedef {Object} CatalogTree_Indexes_Weekindex + * @typedef {Object} MetricsTree_Indexes_Weekindex * @property {MetricPattern29} dateindexCount * @property {MetricPattern29} firstDateindex * @property {MetricPattern29} identity */ /** - * @typedef {Object} CatalogTree_Indexes_Yearindex + * @typedef {Object} MetricsTree_Indexes_Yearindex * @property {MetricPattern30} decadeindex * @property {MetricPattern30} firstMonthindex * @property {MetricPattern30} identity @@ -4775,37 +4298,37 @@ function createRealizedPriceExtraPattern(client, acc) { */ /** - * @typedef {Object} CatalogTree_Inputs + * @typedef {Object} MetricsTree_Inputs * @property {CountPattern2} count * @property {MetricPattern11} firstTxinindex * @property {MetricPattern12} outpoint * @property {MetricPattern12} outputtype - * @property {CatalogTree_Inputs_Spent} spent + * @property {MetricsTree_Inputs_Spent} spent * @property {MetricPattern12} txindex * @property {MetricPattern12} typeindex * @property {MetricPattern12} witnessSize */ /** - * @typedef {Object} CatalogTree_Inputs_Spent + * @typedef {Object} MetricsTree_Inputs_Spent * @property {MetricPattern12} txoutindex * @property {MetricPattern12} value */ /** - * @typedef {Object} CatalogTree_Market - * @property {CatalogTree_Market_Ath} ath - * @property {CatalogTree_Market_Dca} dca - * @property {CatalogTree_Market_Indicators} indicators - * @property {CatalogTree_Market_Lookback} lookback - * @property {CatalogTree_Market_MovingAverage} movingAverage - * @property {CatalogTree_Market_Range} range - * @property {CatalogTree_Market_Returns} returns - * @property {CatalogTree_Market_Volatility} volatility + * @typedef {Object} MetricsTree_Market + * @property {MetricsTree_Market_Ath} ath + * @property {MetricsTree_Market_Dca} dca + * @property {MetricsTree_Market_Indicators} indicators + * @property {MetricsTree_Market_Lookback} lookback + * @property {MetricsTree_Market_MovingAverage} movingAverage + * @property {MetricsTree_Market_Range} range + * @property {MetricsTree_Market_Returns} returns + * @property {MetricsTree_Market_Volatility} volatility */ /** - * @typedef {Object} CatalogTree_Market_Ath + * @typedef {Object} MetricsTree_Market_Ath * @property {MetricPattern4} daysSincePriceAth * @property {MetricPattern4} maxDaysBetweenPriceAths * @property {MetricPattern4} maxYearsBetweenPriceAths @@ -4815,10 +4338,10 @@ function createRealizedPriceExtraPattern(client, acc) { */ /** - * @typedef {Object} CatalogTree_Market_Dca - * @property {CatalogTree_Market_Dca_ClassAveragePrice} classAveragePrice - * @property {CatalogTree_Market_Dca_ClassReturns} classReturns - * @property {CatalogTree_Market_Dca_ClassStack} classStack + * @typedef {Object} MetricsTree_Market_Dca + * @property {MetricsTree_Market_Dca_ClassAveragePrice} classAveragePrice + * @property {MetricsTree_Market_Dca_ClassReturns} classReturns + * @property {MetricsTree_Market_Dca_ClassStack} classStack * @property {PeriodAveragePricePattern} periodAveragePrice * @property {PeriodCagrPattern} periodCagr * @property {PeriodLumpSumStackPattern} periodLumpSumStack @@ -4827,7 +4350,7 @@ function createRealizedPriceExtraPattern(client, acc) { */ /** - * @typedef {Object} CatalogTree_Market_Dca_ClassAveragePrice + * @typedef {Object} MetricsTree_Market_Dca_ClassAveragePrice * @property {MetricPattern4} _2015 * @property {MetricPattern4} _2016 * @property {MetricPattern4} _2017 @@ -4842,7 +4365,7 @@ function createRealizedPriceExtraPattern(client, acc) { */ /** - * @typedef {Object} CatalogTree_Market_Dca_ClassReturns + * @typedef {Object} MetricsTree_Market_Dca_ClassReturns * @property {MetricPattern4} _2015 * @property {MetricPattern4} _2016 * @property {MetricPattern4} _2017 @@ -4857,7 +4380,7 @@ function createRealizedPriceExtraPattern(client, acc) { */ /** - * @typedef {Object} CatalogTree_Market_Dca_ClassStack + * @typedef {Object} MetricsTree_Market_Dca_ClassStack * @property {_2015Pattern} _2015 * @property {_2015Pattern} _2016 * @property {_2015Pattern} _2017 @@ -4872,7 +4395,7 @@ function createRealizedPriceExtraPattern(client, acc) { */ /** - * @typedef {Object} CatalogTree_Market_Indicators + * @typedef {Object} MetricsTree_Market_Indicators * @property {MetricPattern6} gini * @property {MetricPattern6} macdHistogram * @property {MetricPattern6} macdLine @@ -4895,12 +4418,12 @@ function createRealizedPriceExtraPattern(client, acc) { */ /** - * @typedef {Object} CatalogTree_Market_Lookback - * @property {CatalogTree_Market_Lookback_PriceAgo} priceAgo + * @typedef {Object} MetricsTree_Market_Lookback + * @property {MetricsTree_Market_Lookback_PriceAgo} priceAgo */ /** - * @typedef {Object} CatalogTree_Market_Lookback_PriceAgo + * @typedef {Object} MetricsTree_Market_Lookback_PriceAgo * @property {MetricPattern4} _10y * @property {MetricPattern4} _1d * @property {MetricPattern4} _1m @@ -4917,7 +4440,7 @@ function createRealizedPriceExtraPattern(client, acc) { */ /** - * @typedef {Object} CatalogTree_Market_MovingAverage + * @typedef {Object} MetricsTree_Market_MovingAverage * @property {Price111dSmaPattern} price111dSma * @property {Price111dSmaPattern} price12dEma * @property {Price111dSmaPattern} price13dEma @@ -4956,7 +4479,7 @@ function createRealizedPriceExtraPattern(client, acc) { */ /** - * @typedef {Object} CatalogTree_Market_Range + * @typedef {Object} MetricsTree_Market_Range * @property {MetricPattern4} price1mMax * @property {MetricPattern4} price1mMin * @property {MetricPattern4} price1wMax @@ -4971,7 +4494,7 @@ function createRealizedPriceExtraPattern(client, acc) { */ /** - * @typedef {Object} CatalogTree_Market_Returns + * @typedef {Object} MetricsTree_Market_Returns * @property {_1dReturns1mSdPattern} _1dReturns1mSd * @property {_1dReturns1mSdPattern} _1dReturns1wSd * @property {_1dReturns1mSdPattern} _1dReturns1ySd @@ -4980,11 +4503,11 @@ function createRealizedPriceExtraPattern(client, acc) { * @property {_1dReturns1mSdPattern} downside1wSd * @property {_1dReturns1mSdPattern} downside1ySd * @property {MetricPattern6} downsideReturns - * @property {CatalogTree_Market_Returns_PriceReturns} priceReturns + * @property {MetricsTree_Market_Returns_PriceReturns} priceReturns */ /** - * @typedef {Object} CatalogTree_Market_Returns_PriceReturns + * @typedef {Object} MetricsTree_Market_Returns_PriceReturns * @property {MetricPattern4} _10y * @property {MetricPattern4} _1d * @property {MetricPattern4} _1m @@ -5001,7 +4524,7 @@ function createRealizedPriceExtraPattern(client, acc) { */ /** - * @typedef {Object} CatalogTree_Market_Volatility + * @typedef {Object} MetricsTree_Market_Volatility * @property {MetricPattern4} price1mVolatility * @property {MetricPattern4} price1wVolatility * @property {MetricPattern4} price1yVolatility @@ -5014,35 +4537,35 @@ function createRealizedPriceExtraPattern(client, acc) { */ /** - * @typedef {Object} CatalogTree_Outputs - * @property {CatalogTree_Outputs_Count} count + * @typedef {Object} MetricsTree_Outputs + * @property {MetricsTree_Outputs_Count} count * @property {MetricPattern11} firstTxoutindex * @property {MetricPattern15} outputtype - * @property {CatalogTree_Outputs_Spent} spent + * @property {MetricsTree_Outputs_Spent} spent * @property {MetricPattern15} txindex * @property {MetricPattern15} typeindex * @property {MetricPattern15} value */ /** - * @typedef {Object} CatalogTree_Outputs_Count + * @typedef {Object} MetricsTree_Outputs_Count * @property {CountPattern2} totalCount * @property {MetricPattern1} utxoCount */ /** - * @typedef {Object} CatalogTree_Outputs_Spent + * @typedef {Object} MetricsTree_Outputs_Spent * @property {MetricPattern15} txinindex */ /** - * @typedef {Object} CatalogTree_Pools + * @typedef {Object} MetricsTree_Pools * @property {MetricPattern11} heightToPool - * @property {CatalogTree_Pools_Vecs} vecs + * @property {MetricsTree_Pools_Vecs} vecs */ /** - * @typedef {Object} CatalogTree_Pools_Vecs + * @typedef {Object} MetricsTree_Pools_Vecs * @property {AaopoolPattern} aaopool * @property {AaopoolPattern} antpool * @property {AaopoolPattern} arkpool @@ -5204,26 +4727,26 @@ function createRealizedPriceExtraPattern(client, acc) { */ /** - * @typedef {Object} CatalogTree_Positions + * @typedef {Object} MetricsTree_Positions * @property {MetricPattern11} blockPosition * @property {MetricPattern27} txPosition */ /** - * @typedef {Object} CatalogTree_Price - * @property {CatalogTree_Price_Cents} cents - * @property {CatalogTree_Price_Sats} sats - * @property {CatalogTree_Price_Usd} usd + * @typedef {Object} MetricsTree_Price + * @property {MetricsTree_Price_Cents} cents + * @property {MetricsTree_Price_Sats} sats + * @property {MetricsTree_Price_Usd} usd */ /** - * @typedef {Object} CatalogTree_Price_Cents + * @typedef {Object} MetricsTree_Price_Cents * @property {MetricPattern5} ohlc - * @property {CatalogTree_Price_Cents_Split} split + * @property {MetricsTree_Price_Cents_Split} split */ /** - * @typedef {Object} CatalogTree_Price_Cents_Split + * @typedef {Object} MetricsTree_Price_Cents_Split * @property {MetricPattern5} close * @property {MetricPattern5} high * @property {MetricPattern5} low @@ -5231,20 +4754,20 @@ function createRealizedPriceExtraPattern(client, acc) { */ /** - * @typedef {Object} CatalogTree_Price_Sats + * @typedef {Object} MetricsTree_Price_Sats * @property {MetricPattern1} ohlc * @property {SplitPattern2} split */ /** - * @typedef {Object} CatalogTree_Price_Usd + * @typedef {Object} MetricsTree_Price_Usd * @property {MetricPattern1} ohlc * @property {SplitPattern2} split */ /** - * @typedef {Object} CatalogTree_Scripts - * @property {CatalogTree_Scripts_Count} count + * @typedef {Object} MetricsTree_Scripts + * @property {MetricsTree_Scripts_Count} count * @property {MetricPattern9} emptyToTxindex * @property {MetricPattern11} firstEmptyoutputindex * @property {MetricPattern11} firstOpreturnindex @@ -5253,11 +4776,11 @@ function createRealizedPriceExtraPattern(client, acc) { * @property {MetricPattern14} opreturnToTxindex * @property {MetricPattern17} p2msToTxindex * @property {MetricPattern28} unknownToTxindex - * @property {CatalogTree_Scripts_Value} value + * @property {MetricsTree_Scripts_Value} value */ /** - * @typedef {Object} CatalogTree_Scripts_Count + * @typedef {Object} MetricsTree_Scripts_Count * @property {DollarsPattern} emptyoutput * @property {DollarsPattern} opreturn * @property {DollarsPattern} p2a @@ -5276,81 +4799,81 @@ function createRealizedPriceExtraPattern(client, acc) { */ /** - * @typedef {Object} CatalogTree_Scripts_Value + * @typedef {Object} MetricsTree_Scripts_Value * @property {CoinbasePattern} opreturn */ /** - * @typedef {Object} CatalogTree_Supply - * @property {CatalogTree_Supply_Burned} burned - * @property {CatalogTree_Supply_Circulating} circulating + * @typedef {Object} MetricsTree_Supply + * @property {MetricsTree_Supply_Burned} burned + * @property {MetricsTree_Supply_Circulating} circulating * @property {MetricPattern4} inflation * @property {MetricPattern1} marketCap - * @property {CatalogTree_Supply_Velocity} velocity + * @property {MetricsTree_Supply_Velocity} velocity */ /** - * @typedef {Object} CatalogTree_Supply_Burned + * @typedef {Object} MetricsTree_Supply_Burned * @property {UnclaimedRewardsPattern} opreturn * @property {UnclaimedRewardsPattern} unspendable */ /** - * @typedef {Object} CatalogTree_Supply_Circulating + * @typedef {Object} MetricsTree_Supply_Circulating * @property {MetricPattern3} bitcoin * @property {MetricPattern3} dollars * @property {MetricPattern3} sats */ /** - * @typedef {Object} CatalogTree_Supply_Velocity + * @typedef {Object} MetricsTree_Supply_Velocity * @property {MetricPattern4} btc * @property {MetricPattern4} usd */ /** - * @typedef {Object} CatalogTree_Transactions + * @typedef {Object} MetricsTree_Transactions * @property {MetricPattern27} baseSize - * @property {CatalogTree_Transactions_Count} count - * @property {CatalogTree_Transactions_Fees} fees + * @property {MetricsTree_Transactions_Count} count + * @property {MetricsTree_Transactions_Fees} fees * @property {MetricPattern11} firstTxindex * @property {MetricPattern27} firstTxinindex * @property {MetricPattern27} firstTxoutindex * @property {MetricPattern27} height * @property {MetricPattern27} isExplicitlyRbf * @property {MetricPattern27} rawlocktime - * @property {CatalogTree_Transactions_Size} size + * @property {MetricsTree_Transactions_Size} size * @property {MetricPattern27} totalSize * @property {MetricPattern27} txid * @property {MetricPattern27} txversion - * @property {CatalogTree_Transactions_Versions} versions - * @property {CatalogTree_Transactions_Volume} volume + * @property {MetricsTree_Transactions_Versions} versions + * @property {MetricsTree_Transactions_Volume} volume */ /** - * @typedef {Object} CatalogTree_Transactions_Count + * @typedef {Object} MetricsTree_Transactions_Count * @property {MetricPattern27} isCoinbase * @property {DollarsPattern} txCount */ /** - * @typedef {Object} CatalogTree_Transactions_Fees - * @property {CatalogTree_Transactions_Fees_Fee} fee + * @typedef {Object} MetricsTree_Transactions_Fees + * @property {MetricsTree_Transactions_Fees_Fee} fee * @property {FeeRatePattern} feeRate * @property {MetricPattern27} inputValue * @property {MetricPattern27} outputValue */ /** - * @typedef {Object} CatalogTree_Transactions_Fees_Fee + * @typedef {Object} MetricsTree_Transactions_Fees_Fee * @property {CountPattern2} bitcoin - * @property {CatalogTree_Transactions_Fees_Fee_Dollars} dollars + * @property {MetricsTree_Transactions_Fees_Fee_Dollars} dollars * @property {CountPattern2} sats * @property {MetricPattern27} txindex */ /** - * @typedef {Object} CatalogTree_Transactions_Fees_Fee_Dollars + * @typedef {Object} MetricsTree_Transactions_Fees_Fee_Dollars * @property {MetricPattern1} average * @property {MetricPattern2} cumulative * @property {MetricPattern11} heightCumulative @@ -5365,20 +4888,20 @@ function createRealizedPriceExtraPattern(client, acc) { */ /** - * @typedef {Object} CatalogTree_Transactions_Size + * @typedef {Object} MetricsTree_Transactions_Size * @property {FeeRatePattern} vsize * @property {FeeRatePattern} weight */ /** - * @typedef {Object} CatalogTree_Transactions_Versions + * @typedef {Object} MetricsTree_Transactions_Versions * @property {BlockCountPattern} v1 * @property {BlockCountPattern} v2 * @property {BlockCountPattern} v3 */ /** - * @typedef {Object} CatalogTree_Transactions_Volume + * @typedef {Object} MetricsTree_Transactions_Volume * @property {_2015Pattern} annualizedVolume * @property {MetricPattern4} inputsPerSec * @property {MetricPattern4} outputsPerSec @@ -5387,7 +4910,7 @@ function createRealizedPriceExtraPattern(client, acc) { */ /** - * Main BRK client with catalog tree and API methods + * Main BRK client with metrics tree and API methods * @extends BrkClientBase */ class BrkClient extends BrkClientBase { @@ -5420,868 +4943,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} */ ({ - long: { - id: "lth", - long: "Long Term Holders", - short: "LTH", - }, - short: { - id: "sth", - long: "Short Term Holders", - short: "STH", + "short": { + "id": "sth", + "short": "STH", + "long": "Short Term Holders" }, + "long": { + "id": "lth", + "short": "LTH", + "long": "Long Term Holders" + } }); EPOCH_NAMES = /** @type {const} */ ({ - _0: { - id: "epoch_0", - long: "Epoch 0", - short: "Epoch 0", + "_0": { + "id": "epoch_0", + "short": "Epoch 0", + "long": "Epoch 0" }, - _1: { - id: "epoch_1", - long: "Epoch 1", - short: "Epoch 1", + "_1": { + "id": "epoch_1", + "short": "Epoch 1", + "long": "Epoch 1" }, - _2: { - id: "epoch_2", - long: "Epoch 2", - short: "Epoch 2", + "_2": { + "id": "epoch_2", + "short": "Epoch 2", + "long": "Epoch 2" }, - _3: { - id: "epoch_3", - long: "Epoch 3", - short: "Epoch 3", - }, - _4: { - id: "epoch_4", - long: "Epoch 4", - short: "Epoch 4", + "_3": { + "id": "epoch_3", + "short": "Epoch 3", + "long": "Epoch 3" }, + "_4": { + "id": "epoch_4", + "short": "Epoch 4", + "long": "Epoch 4" + } }); YEAR_NAMES = /** @type {const} */ ({ - _2009: { - id: "year_2009", - long: "Year 2009", - short: "2009", + "_2009": { + "id": "year_2009", + "short": "2009", + "long": "Year 2009" }, - _2010: { - id: "year_2010", - long: "Year 2010", - short: "2010", + "_2010": { + "id": "year_2010", + "short": "2010", + "long": "Year 2010" }, - _2011: { - id: "year_2011", - long: "Year 2011", - short: "2011", + "_2011": { + "id": "year_2011", + "short": "2011", + "long": "Year 2011" }, - _2012: { - id: "year_2012", - long: "Year 2012", - short: "2012", + "_2012": { + "id": "year_2012", + "short": "2012", + "long": "Year 2012" }, - _2013: { - id: "year_2013", - long: "Year 2013", - short: "2013", + "_2013": { + "id": "year_2013", + "short": "2013", + "long": "Year 2013" }, - _2014: { - id: "year_2014", - long: "Year 2014", - short: "2014", + "_2014": { + "id": "year_2014", + "short": "2014", + "long": "Year 2014" }, - _2015: { - id: "year_2015", - long: "Year 2015", - short: "2015", + "_2015": { + "id": "year_2015", + "short": "2015", + "long": "Year 2015" }, - _2016: { - id: "year_2016", - long: "Year 2016", - short: "2016", + "_2016": { + "id": "year_2016", + "short": "2016", + "long": "Year 2016" }, - _2017: { - id: "year_2017", - long: "Year 2017", - short: "2017", + "_2017": { + "id": "year_2017", + "short": "2017", + "long": "Year 2017" }, - _2018: { - id: "year_2018", - long: "Year 2018", - short: "2018", + "_2018": { + "id": "year_2018", + "short": "2018", + "long": "Year 2018" }, - _2019: { - id: "year_2019", - long: "Year 2019", - short: "2019", + "_2019": { + "id": "year_2019", + "short": "2019", + "long": "Year 2019" }, - _2020: { - id: "year_2020", - long: "Year 2020", - short: "2020", + "_2020": { + "id": "year_2020", + "short": "2020", + "long": "Year 2020" }, - _2021: { - id: "year_2021", - long: "Year 2021", - short: "2021", + "_2021": { + "id": "year_2021", + "short": "2021", + "long": "Year 2021" }, - _2022: { - id: "year_2022", - long: "Year 2022", - short: "2022", + "_2022": { + "id": "year_2022", + "short": "2022", + "long": "Year 2022" }, - _2023: { - id: "year_2023", - long: "Year 2023", - short: "2023", + "_2023": { + "id": "year_2023", + "short": "2023", + "long": "Year 2023" }, - _2024: { - id: "year_2024", - long: "Year 2024", - short: "2024", + "_2024": { + "id": "year_2024", + "short": "2024", + "long": "Year 2024" }, - _2025: { - id: "year_2025", - long: "Year 2025", - short: "2025", - }, - _2026: { - id: "year_2026", - long: "Year 2026", - short: "2026", + "_2025": { + "id": "year_2025", + "short": "2025", + "long": "Year 2025" }, + "_2026": { + "id": "year_2026", + "short": "2026", + "long": "Year 2026" + } }); SPENDABLE_TYPE_NAMES = /** @type {const} */ ({ - empty: { - id: "empty_outputs", - long: "Empty Output", - short: "Empty", + "p2pk65": { + "id": "p2pk65", + "short": "P2PK65", + "long": "Pay to Public Key (65 bytes)" }, - p2a: { - id: "p2a", - long: "Pay to Anchor", - short: "P2A", + "p2pk33": { + "id": "p2pk33", + "short": "P2PK33", + "long": "Pay to Public Key (33 bytes)" }, - p2ms: { - id: "p2ms", - long: "Pay to Multisig", - short: "P2MS", + "p2pkh": { + "id": "p2pkh", + "short": "P2PKH", + "long": "Pay to Public Key Hash" }, - p2pk33: { - id: "p2pk33", - long: "Pay to Public Key (33 bytes)", - short: "P2PK33", + "p2ms": { + "id": "p2ms", + "short": "P2MS", + "long": "Pay to Multisig" }, - p2pk65: { - id: "p2pk65", - long: "Pay to Public Key (65 bytes)", - short: "P2PK65", + "p2sh": { + "id": "p2sh", + "short": "P2SH", + "long": "Pay to Script Hash" }, - p2pkh: { - id: "p2pkh", - long: "Pay to Public Key Hash", - short: "P2PKH", + "p2wpkh": { + "id": "p2wpkh", + "short": "P2WPKH", + "long": "Pay to Witness Public Key Hash" }, - p2sh: { - id: "p2sh", - long: "Pay to Script Hash", - short: "P2SH", + "p2wsh": { + "id": "p2wsh", + "short": "P2WSH", + "long": "Pay to Witness Script Hash" }, - p2tr: { - id: "p2tr", - long: "Pay to Taproot", - short: "P2TR", + "p2tr": { + "id": "p2tr", + "short": "P2TR", + "long": "Pay to Taproot" }, - p2wpkh: { - id: "p2wpkh", - long: "Pay to Witness Public Key Hash", - short: "P2WPKH", + "p2a": { + "id": "p2a", + "short": "P2A", + "long": "Pay to Anchor" }, - p2wsh: { - id: "p2wsh", - long: "Pay to Witness Script Hash", - short: "P2WSH", - }, - unknown: { - id: "unknown_outputs", - long: "Unknown Output Type", - short: "Unknown", + "unknown": { + "id": "unknown_outputs", + "short": "Unknown", + "long": "Unknown Output Type" }, + "empty": { + "id": "empty_outputs", + "short": "Empty", + "long": "Empty Output" + } }); AGE_RANGE_NAMES = /** @type {const} */ ({ - _10yTo12y: { - id: "at_least_10y_up_to_12y_old", - long: "10 to 12 Years Old", - short: "10y-12y", + "upTo1h": { + "id": "up_to_1h_old", + "short": "<1h", + "long": "Up to 1 Hour Old" }, - _12yTo15y: { - id: "at_least_12y_up_to_15y_old", - long: "12 to 15 Years Old", - short: "12y-15y", + "_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", - long: "1 Day to 1 Week Old", - short: "1d-1w", + "_1dTo1w": { + "id": "at_least_1d_up_to_1w_old", + "short": "1d-1w", + "long": "1 Day to 1 Week Old" }, - _1hTo1d: { - id: "at_least_1h_up_to_1d_old", - long: "1 Hour to 1 Day Old", - short: "1h-1d", + "_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", - long: "1 to 2 Months Old", - short: "1m-2m", + "_1mTo2m": { + "id": "at_least_1m_up_to_2m_old", + "short": "1m-2m", + "long": "1 to 2 Months Old" }, - _1wTo1m: { - id: "at_least_1w_up_to_1m_old", - long: "1 Week to 1 Month Old", - short: "1w-1m", + "_2mTo3m": { + "id": "at_least_2m_up_to_3m_old", + "short": "2m-3m", + "long": "2 to 3 Months Old" }, - _1yTo2y: { - id: "at_least_1y_up_to_2y_old", - long: "1 to 2 Years Old", - short: "1y-2y", + "_3mTo4m": { + "id": "at_least_3m_up_to_4m_old", + "short": "3m-4m", + "long": "3 to 4 Months Old" }, - _2mTo3m: { - id: "at_least_2m_up_to_3m_old", - long: "2 to 3 Months Old", - short: "2m-3m", + "_4mTo5m": { + "id": "at_least_4m_up_to_5m_old", + "short": "4m-5m", + "long": "4 to 5 Months Old" }, - _2yTo3y: { - id: "at_least_2y_up_to_3y_old", - long: "2 to 3 Years Old", - short: "2y-3y", + "_5mTo6m": { + "id": "at_least_5m_up_to_6m_old", + "short": "5m-6m", + "long": "5 to 6 Months Old" }, - _3mTo4m: { - id: "at_least_3m_up_to_4m_old", - long: "3 to 4 Months Old", - short: "3m-4m", + "_6mTo1y": { + "id": "at_least_6m_up_to_1y_old", + "short": "6m-1y", + "long": "6 Months to 1 Year Old" }, - _3yTo4y: { - id: "at_least_3y_up_to_4y_old", - long: "3 to 4 Years Old", - short: "3y-4y", + "_1yTo2y": { + "id": "at_least_1y_up_to_2y_old", + "short": "1y-2y", + "long": "1 to 2 Years Old" }, - _4mTo5m: { - id: "at_least_4m_up_to_5m_old", - long: "4 to 5 Months Old", - short: "4m-5m", + "_2yTo3y": { + "id": "at_least_2y_up_to_3y_old", + "short": "2y-3y", + "long": "2 to 3 Years Old" }, - _4yTo5y: { - id: "at_least_4y_up_to_5y_old", - long: "4 to 5 Years Old", - short: "4y-5y", + "_3yTo4y": { + "id": "at_least_3y_up_to_4y_old", + "short": "3y-4y", + "long": "3 to 4 Years Old" }, - _5mTo6m: { - id: "at_least_5m_up_to_6m_old", - long: "5 to 6 Months Old", - short: "5m-6m", + "_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", - long: "5 to 6 Years Old", - short: "5y-6y", + "_5yTo6y": { + "id": "at_least_5y_up_to_6y_old", + "short": "5y-6y", + "long": "5 to 6 Years Old" }, - _6mTo1y: { - id: "at_least_6m_up_to_1y_old", - long: "6 Months to 1 Year Old", - short: "6m-1y", + "_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", - long: "6 to 7 Years Old", - short: "6y-7y", + "_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", - long: "7 to 8 Years Old", - short: "7y-8y", + "_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", - long: "8 to 10 Years Old", - short: "8y-10y", + "_10yTo12y": { + "id": "at_least_10y_up_to_12y_old", + "short": "10y-12y", + "long": "10 to 12 Years Old" }, - from15y: { - id: "at_least_15y_old", - long: "15+ Years Old", - short: "15y+", - }, - upTo1h: { - id: "up_to_1h_old", - long: "Up to 1 Hour Old", - short: "<1h", + "_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" + } }); MAX_AGE_NAMES = /** @type {const} */ ({ - _10y: { - id: "up_to_10y_old", - long: "Up to 10 Years Old", - short: "<10y", + "_1w": { + "id": "up_to_1w_old", + "short": "<1w", + "long": "Up to 1 Week Old" }, - _12y: { - id: "up_to_12y_old", - long: "Up to 12 Years Old", - short: "<12y", + "_1m": { + "id": "up_to_1m_old", + "short": "<1m", + "long": "Up to 1 Month Old" }, - _15y: { - id: "up_to_15y_old", - long: "Up to 15 Years Old", - short: "<15y", + "_2m": { + "id": "up_to_2m_old", + "short": "<2m", + "long": "Up to 2 Months Old" }, - _1m: { - id: "up_to_1m_old", - long: "Up to 1 Month Old", - short: "<1m", + "_3m": { + "id": "up_to_3m_old", + "short": "<3m", + "long": "Up to 3 Months Old" }, - _1w: { - id: "up_to_1w_old", - long: "Up to 1 Week Old", - short: "<1w", + "_4m": { + "id": "up_to_4m_old", + "short": "<4m", + "long": "Up to 4 Months Old" }, - _1y: { - id: "up_to_1y_old", - long: "Up to 1 Year Old", - short: "<1y", + "_5m": { + "id": "up_to_5m_old", + "short": "<5m", + "long": "Up to 5 Months Old" }, - _2m: { - id: "up_to_2m_old", - long: "Up to 2 Months Old", - short: "<2m", + "_6m": { + "id": "up_to_6m_old", + "short": "<6m", + "long": "Up to 6 Months Old" }, - _2y: { - id: "up_to_2y_old", - long: "Up to 2 Years Old", - short: "<2y", + "_1y": { + "id": "up_to_1y_old", + "short": "<1y", + "long": "Up to 1 Year Old" }, - _3m: { - id: "up_to_3m_old", - long: "Up to 3 Months Old", - short: "<3m", + "_2y": { + "id": "up_to_2y_old", + "short": "<2y", + "long": "Up to 2 Years Old" }, - _3y: { - id: "up_to_3y_old", - long: "Up to 3 Years Old", - short: "<3y", + "_3y": { + "id": "up_to_3y_old", + "short": "<3y", + "long": "Up to 3 Years Old" }, - _4m: { - id: "up_to_4m_old", - long: "Up to 4 Months Old", - short: "<4m", + "_4y": { + "id": "up_to_4y_old", + "short": "<4y", + "long": "Up to 4 Years Old" }, - _4y: { - id: "up_to_4y_old", - long: "Up to 4 Years Old", - short: "<4y", + "_5y": { + "id": "up_to_5y_old", + "short": "<5y", + "long": "Up to 5 Years Old" }, - _5m: { - id: "up_to_5m_old", - long: "Up to 5 Months Old", - short: "<5m", + "_6y": { + "id": "up_to_6y_old", + "short": "<6y", + "long": "Up to 6 Years Old" }, - _5y: { - id: "up_to_5y_old", - long: "Up to 5 Years Old", - short: "<5y", + "_7y": { + "id": "up_to_7y_old", + "short": "<7y", + "long": "Up to 7 Years Old" }, - _6m: { - id: "up_to_6m_old", - long: "Up to 6 Months Old", - short: "<6m", + "_8y": { + "id": "up_to_8y_old", + "short": "<8y", + "long": "Up to 8 Years Old" }, - _6y: { - id: "up_to_6y_old", - long: "Up to 6 Years Old", - short: "<6y", + "_10y": { + "id": "up_to_10y_old", + "short": "<10y", + "long": "Up to 10 Years Old" }, - _7y: { - id: "up_to_7y_old", - long: "Up to 7 Years Old", - short: "<7y", - }, - _8y: { - id: "up_to_8y_old", - long: "Up to 8 Years Old", - short: "<8y", + "_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 = /** @type {const} */ ({ - _10y: { - id: "at_least_10y_old", - long: "At Least 10 Years Old", - short: "10y+", + "_1d": { + "id": "at_least_1d_old", + "short": "1d+", + "long": "At Least 1 Day Old" }, - _12y: { - id: "at_least_12y_old", - long: "At Least 12 Years Old", - short: "12y+", + "_1w": { + "id": "at_least_1w_old", + "short": "1w+", + "long": "At Least 1 Week Old" }, - _1d: { - id: "at_least_1d_old", - long: "At Least 1 Day Old", - short: "1d+", + "_1m": { + "id": "at_least_1m_old", + "short": "1m+", + "long": "At Least 1 Month Old" }, - _1m: { - id: "at_least_1m_old", - long: "At Least 1 Month Old", - short: "1m+", + "_2m": { + "id": "at_least_2m_old", + "short": "2m+", + "long": "At Least 2 Months Old" }, - _1w: { - id: "at_least_1w_old", - long: "At Least 1 Week Old", - short: "1w+", + "_3m": { + "id": "at_least_3m_old", + "short": "3m+", + "long": "At Least 3 Months Old" }, - _1y: { - id: "at_least_1y_old", - long: "At Least 1 Year Old", - short: "1y+", + "_4m": { + "id": "at_least_4m_old", + "short": "4m+", + "long": "At Least 4 Months Old" }, - _2m: { - id: "at_least_2m_old", - long: "At Least 2 Months Old", - short: "2m+", + "_5m": { + "id": "at_least_5m_old", + "short": "5m+", + "long": "At Least 5 Months Old" }, - _2y: { - id: "at_least_2y_old", - long: "At Least 2 Years Old", - short: "2y+", + "_6m": { + "id": "at_least_6m_old", + "short": "6m+", + "long": "At Least 6 Months Old" }, - _3m: { - id: "at_least_3m_old", - long: "At Least 3 Months Old", - short: "3m+", + "_1y": { + "id": "at_least_1y_old", + "short": "1y+", + "long": "At Least 1 Year Old" }, - _3y: { - id: "at_least_3y_old", - long: "At Least 3 Years Old", - short: "3y+", + "_2y": { + "id": "at_least_2y_old", + "short": "2y+", + "long": "At Least 2 Years Old" }, - _4m: { - id: "at_least_4m_old", - long: "At Least 4 Months Old", - short: "4m+", + "_3y": { + "id": "at_least_3y_old", + "short": "3y+", + "long": "At Least 3 Years Old" }, - _4y: { - id: "at_least_4y_old", - long: "At Least 4 Years Old", - short: "4y+", + "_4y": { + "id": "at_least_4y_old", + "short": "4y+", + "long": "At Least 4 Years Old" }, - _5m: { - id: "at_least_5m_old", - long: "At Least 5 Months Old", - short: "5m+", + "_5y": { + "id": "at_least_5y_old", + "short": "5y+", + "long": "At Least 5 Years Old" }, - _5y: { - id: "at_least_5y_old", - long: "At Least 5 Years Old", - short: "5y+", + "_6y": { + "id": "at_least_6y_old", + "short": "6y+", + "long": "At Least 6 Years Old" }, - _6m: { - id: "at_least_6m_old", - long: "At Least 6 Months Old", - short: "6m+", + "_7y": { + "id": "at_least_7y_old", + "short": "7y+", + "long": "At Least 7 Years Old" }, - _6y: { - id: "at_least_6y_old", - long: "At Least 6 Years Old", - short: "6y+", + "_8y": { + "id": "at_least_8y_old", + "short": "8y+", + "long": "At Least 8 Years Old" }, - _7y: { - id: "at_least_7y_old", - long: "At Least 7 Years Old", - short: "7y+", - }, - _8y: { - id: "at_least_8y_old", - long: "At Least 8 Years Old", - short: "8y+", + "_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 = /** @type {const} */ ({ - _0sats: { - id: "with_0sats", - long: "0 Sats", - short: "0 sats", + "_0sats": { + "id": "with_0sats", + "short": "0 sats", + "long": "0 Sats" }, - _100btcTo1kBtc: { - id: "above_100btc_under_1k_btc", - long: "100 to 1K BTC", - short: "100-1k BTC", + "_1satTo10sats": { + "id": "above_1sat_under_10sats", + "short": "1-10 sats", + "long": "1 to 10 Sats" }, - _100kBtcOrMore: { - id: "above_100k_btc", - long: "100K+ BTC", - short: "100k+ BTC", + "_10satsTo100sats": { + "id": "above_10sats_under_100sats", + "short": "10-100 sats", + "long": "10 to 100 Sats" }, - _100kSatsTo1mSats: { - id: "above_100k_sats_under_1m_sats", - long: "100K to 1M Sats", - short: "100k-1M sats", + "_100satsTo1kSats": { + "id": "above_100sats_under_1k_sats", + "short": "100-1k sats", + "long": "100 to 1K Sats" }, - _100satsTo1kSats: { - id: "above_100sats_under_1k_sats", - long: "100 to 1K Sats", - short: "100-1k sats", + "_1kSatsTo10kSats": { + "id": "above_1k_sats_under_10k_sats", + "short": "1k-10k sats", + "long": "1K to 10K Sats" }, - _10btcTo100btc: { - id: "above_10btc_under_100btc", - long: "10 to 100 BTC", - short: "10-100 BTC", + "_10kSatsTo100kSats": { + "id": "above_10k_sats_under_100k_sats", + "short": "10k-100k sats", + "long": "10K to 100K Sats" }, - _10kBtcTo100kBtc: { - id: "above_10k_btc_under_100k_btc", - long: "10K to 100K BTC", - short: "10k-100k BTC", + "_100kSatsTo1mSats": { + "id": "above_100k_sats_under_1m_sats", + "short": "100k-1M sats", + "long": "100K to 1M Sats" }, - _10kSatsTo100kSats: { - id: "above_10k_sats_under_100k_sats", - long: "10K to 100K Sats", - short: "10k-100k 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", - long: "0.1 to 1 BTC", - short: "0.1-1 BTC", + "_10mSatsTo1btc": { + "id": "above_10m_sats_under_1btc", + "short": "0.1-1 BTC", + "long": "0.1 to 1 BTC" }, - _10satsTo100sats: { - id: "above_10sats_under_100sats", - long: "10 to 100 Sats", - short: "10-100 sats", + "_1btcTo10btc": { + "id": "above_1btc_under_10btc", + "short": "1-10 BTC", + "long": "1 to 10 BTC" }, - _1btcTo10btc: { - id: "above_1btc_under_10btc", - long: "1 to 10 BTC", - short: "1-10 BTC", + "_10btcTo100btc": { + "id": "above_10btc_under_100btc", + "short": "10-100 BTC", + "long": "10 to 100 BTC" }, - _1kBtcTo10kBtc: { - id: "above_1k_btc_under_10k_btc", - long: "1K to 10K BTC", - short: "1k-10k BTC", + "_100btcTo1kBtc": { + "id": "above_100btc_under_1k_btc", + "short": "100-1k BTC", + "long": "100 to 1K BTC" }, - _1kSatsTo10kSats: { - id: "above_1k_sats_under_10k_sats", - long: "1K to 10K Sats", - short: "1k-10k sats", + "_1kBtcTo10kBtc": { + "id": "above_1k_btc_under_10k_btc", + "short": "1k-10k BTC", + "long": "1K to 10K BTC" }, - _1mSatsTo10mSats: { - id: "above_1m_sats_under_10m_sats", - long: "1M to 10M Sats", - short: "1M-10M sats", - }, - _1satTo10sats: { - id: "above_1sat_under_10sats", - long: "1 to 10 Sats", - short: "1-10 sats", + "_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" + } }); GE_AMOUNT_NAMES = /** @type {const} */ ({ - _100btc: { - id: "above_100btc", - long: "Above 100 BTC", - short: "100+ BTC", + "_1sat": { + "id": "above_1sat", + "short": "1+ sats", + "long": "Above 1 Sat" }, - _100kSats: { - id: "above_100k_sats", - long: "Above 100K Sats", - short: "100k+ sats", + "_10sats": { + "id": "above_10sats", + "short": "10+ sats", + "long": "Above 10 Sats" }, - _100sats: { - id: "above_100sats", - long: "Above 100 Sats", - short: "100+ sats", + "_100sats": { + "id": "above_100sats", + "short": "100+ sats", + "long": "Above 100 Sats" }, - _10btc: { - id: "above_10btc", - long: "Above 10 BTC", - short: "10+ BTC", + "_1kSats": { + "id": "above_1k_sats", + "short": "1k+ sats", + "long": "Above 1K Sats" }, - _10kBtc: { - id: "above_10k_btc", - long: "Above 10K BTC", - short: "10k+ BTC", + "_10kSats": { + "id": "above_10k_sats", + "short": "10k+ sats", + "long": "Above 10K Sats" }, - _10kSats: { - id: "above_10k_sats", - long: "Above 10K Sats", - short: "10k+ sats", + "_100kSats": { + "id": "above_100k_sats", + "short": "100k+ sats", + "long": "Above 100K Sats" }, - _10mSats: { - id: "above_10m_sats", - long: "Above 0.1 BTC", - short: "0.1+ BTC", + "_1mSats": { + "id": "above_1m_sats", + "short": "1M+ sats", + "long": "Above 1M Sats" }, - _10sats: { - id: "above_10sats", - long: "Above 10 Sats", - short: "10+ sats", + "_10mSats": { + "id": "above_10m_sats", + "short": "0.1+ BTC", + "long": "Above 0.1 BTC" }, - _1btc: { - id: "above_1btc", - long: "Above 1 BTC", - short: "1+ BTC", + "_1btc": { + "id": "above_1btc", + "short": "1+ BTC", + "long": "Above 1 BTC" }, - _1kBtc: { - id: "above_1k_btc", - long: "Above 1K BTC", - short: "1k+ BTC", + "_10btc": { + "id": "above_10btc", + "short": "10+ BTC", + "long": "Above 10 BTC" }, - _1kSats: { - id: "above_1k_sats", - long: "Above 1K Sats", - short: "1k+ sats", + "_100btc": { + "id": "above_100btc", + "short": "100+ BTC", + "long": "Above 100 BTC" }, - _1mSats: { - id: "above_1m_sats", - long: "Above 1M Sats", - short: "1M+ sats", - }, - _1sat: { - id: "above_1sat", - long: "Above 1 Sat", - short: "1+ sats", + "_1kBtc": { + "id": "above_1k_btc", + "short": "1k+ BTC", + "long": "Above 1K BTC" }, + "_10kBtc": { + "id": "above_10k_btc", + "short": "10k+ BTC", + "long": "Above 10K BTC" + } }); LT_AMOUNT_NAMES = /** @type {const} */ ({ - _100btc: { - id: "under_100btc", - long: "Under 100 BTC", - short: "<100 BTC", + "_10sats": { + "id": "under_10sats", + "short": "<10 sats", + "long": "Under 10 Sats" }, - _100kBtc: { - id: "under_100k_btc", - long: "Under 100K BTC", - short: "<100k BTC", + "_100sats": { + "id": "under_100sats", + "short": "<100 sats", + "long": "Under 100 Sats" }, - _100kSats: { - id: "under_100k_sats", - long: "Under 100K Sats", - short: "<100k sats", + "_1kSats": { + "id": "under_1k_sats", + "short": "<1k sats", + "long": "Under 1K Sats" }, - _100sats: { - id: "under_100sats", - long: "Under 100 Sats", - short: "<100 sats", + "_10kSats": { + "id": "under_10k_sats", + "short": "<10k sats", + "long": "Under 10K Sats" }, - _10btc: { - id: "under_10btc", - long: "Under 10 BTC", - short: "<10 BTC", + "_100kSats": { + "id": "under_100k_sats", + "short": "<100k sats", + "long": "Under 100K Sats" }, - _10kBtc: { - id: "under_10k_btc", - long: "Under 10K BTC", - short: "<10k BTC", + "_1mSats": { + "id": "under_1m_sats", + "short": "<1M sats", + "long": "Under 1M Sats" }, - _10kSats: { - id: "under_10k_sats", - long: "Under 10K Sats", - short: "<10k sats", + "_10mSats": { + "id": "under_10m_sats", + "short": "<0.1 BTC", + "long": "Under 0.1 BTC" }, - _10mSats: { - id: "under_10m_sats", - long: "Under 0.1 BTC", - short: "<0.1 BTC", + "_1btc": { + "id": "under_1btc", + "short": "<1 BTC", + "long": "Under 1 BTC" }, - _10sats: { - id: "under_10sats", - long: "Under 10 Sats", - short: "<10 sats", + "_10btc": { + "id": "under_10btc", + "short": "<10 BTC", + "long": "Under 10 BTC" }, - _1btc: { - id: "under_1btc", - long: "Under 1 BTC", - short: "<1 BTC", + "_100btc": { + "id": "under_100btc", + "short": "<100 BTC", + "long": "Under 100 BTC" }, - _1kBtc: { - id: "under_1k_btc", - long: "Under 1K BTC", - short: "<1k BTC", + "_1kBtc": { + "id": "under_1k_btc", + "short": "<1k BTC", + "long": "Under 1K BTC" }, - _1kSats: { - id: "under_1k_sats", - long: "Under 1K Sats", - short: "<1k sats", - }, - _1mSats: { - id: "under_1m_sats", - long: "Under 1M Sats", - short: "<1M sats", + "_10kBtc": { + "id": "under_10k_btc", + "short": "<10k BTC", + "long": "Under 10K BTC" }, + "_100kBtc": { + "id": "under_100k_btc", + "short": "<100k BTC", + "long": "Under 100K BTC" + } }); /** @@ -6289,1405 +5812,1078 @@ class BrkClient extends BrkClientBase { */ constructor(options) { super(options); - /** @type {CatalogTree} */ - this.tree = this._buildTree(""); + /** @type {MetricsTree} */ + this.metrics = this._buildTree(''); } /** * @private * @param {string} basePath - * @returns {CatalogTree} + * @returns {MetricsTree} */ _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_cumulative", - ), + 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_btc", - ), - periodReturns: createPeriodAveragePricePattern(this, "dca_returns"), - periodStack: createPeriodLumpSumStackPattern(this, "dca_stack_btc"), + 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'), }, }, }; @@ -7702,7 +6898,7 @@ class BrkClient extends BrkClientBase { * @returns {Promise} */ async getAddress(address) { - return this.get(`/api/address/${address}`); + return this.getJson(`/api/address/${address}`); } /** @@ -7717,10 +6913,11 @@ 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(); - return this.get(`/api/address/${address}/txs${query ? "?" + query : ""}`); + const path = `/api/address/${address}/txs${query ? '?' + query : ''}`; + return this.getJson(path); } /** @@ -7735,12 +6932,11 @@ class BrkClient extends BrkClientBase { */ async getAddressTxsChain(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(); - return this.get( - `/api/address/${address}/txs/chain${query ? "?" + query : ""}`, - ); + const path = `/api/address/${address}/txs/chain${query ? '?' + query : ''}`; + return this.getJson(path); } /** @@ -7752,7 +6948,7 @@ class BrkClient extends BrkClientBase { * @returns {Promise} */ async getAddressTxsMempool(address) { - return this.get(`/api/address/${address}/txs/mempool`); + return this.getJson(`/api/address/${address}/txs/mempool`); } /** @@ -7764,7 +6960,7 @@ class BrkClient extends BrkClientBase { * @returns {Promise} */ async getAddressUtxo(address) { - return this.get(`/api/address/${address}/utxo`); + return this.getJson(`/api/address/${address}/utxo`); } /** @@ -7776,7 +6972,7 @@ class BrkClient extends BrkClientBase { * @returns {Promise} */ async getBlockHeight(height) { - return this.get(`/api/block-height/${height}`); + return this.getJson(`/api/block-height/${height}`); } /** @@ -7788,7 +6984,7 @@ class BrkClient extends BrkClientBase { * @returns {Promise} */ async getBlockByHash(hash) { - return this.get(`/api/block/${hash}`); + return this.getJson(`/api/block/${hash}`); } /** @@ -7800,7 +6996,7 @@ class BrkClient extends BrkClientBase { * @returns {Promise} */ async getBlockByHashRaw(hash) { - return this.get(`/api/block/${hash}/raw`); + return this.getJson(`/api/block/${hash}/raw`); } /** @@ -7812,7 +7008,7 @@ class BrkClient extends BrkClientBase { * @returns {Promise} */ async getBlockByHashStatus(hash) { - return this.get(`/api/block/${hash}/status`); + return this.getJson(`/api/block/${hash}/status`); } /** @@ -7825,7 +7021,7 @@ class BrkClient extends BrkClientBase { * @returns {Promise} */ async getBlockByHashTxidByIndex(hash, index) { - return this.get(`/api/block/${hash}/txid/${index}`); + return this.getJson(`/api/block/${hash}/txid/${index}`); } /** @@ -7837,7 +7033,7 @@ class BrkClient extends BrkClientBase { * @returns {Promise} */ async getBlockByHashTxids(hash) { - return this.get(`/api/block/${hash}/txids`); + return this.getJson(`/api/block/${hash}/txids`); } /** @@ -7850,7 +7046,7 @@ class BrkClient extends BrkClientBase { * @returns {Promise} */ async getBlockByHashTxsByStartIndex(hash, start_index) { - return this.get(`/api/block/${hash}/txs/${start_index}`); + return this.getJson(`/api/block/${hash}/txs/${start_index}`); } /** @@ -7860,7 +7056,7 @@ class BrkClient extends BrkClientBase { * @returns {Promise} */ async getBlocks() { - return this.get(`/api/blocks`); + return this.getJson(`/api/blocks`); } /** @@ -7872,7 +7068,7 @@ class BrkClient extends BrkClientBase { * @returns {Promise} */ async getBlocksByHeight(height) { - return this.get(`/api/blocks/${height}`); + return this.getJson(`/api/blocks/${height}`); } /** @@ -7882,7 +7078,7 @@ class BrkClient extends BrkClientBase { * @returns {Promise} */ async getMempoolInfo() { - return this.get(`/api/mempool/info`); + return this.getJson(`/api/mempool/info`); } /** @@ -7892,7 +7088,7 @@ class BrkClient extends BrkClientBase { * @returns {Promise} */ async getMempoolTxids() { - return this.get(`/api/mempool/txids`); + return this.getJson(`/api/mempool/txids`); } /** @@ -7904,7 +7100,7 @@ class BrkClient extends BrkClientBase { * @returns {Promise} */ async getMetric(metric) { - return this.get(`/api/metric/${metric}`); + return this.getJson(`/api/metric/${metric}`); } /** @@ -7912,49 +7108,26 @@ 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). * - * @param {Index} index - Aggregation index * @param {Metric} metric - Metric name - * @param {*=} [count] - Number of values to return (ignored if `to` is set) + * @param {Index} index - Aggregation index + * @param {number=} [start] - Inclusive starting index, if negative counts from end + * @param {number=} [end] - Exclusive ending index, if negative counts from end + * @param {number=} [count] - Number of values to return (ignored if `end` is set) * @param {Format=} [format] - Format of the output - * @param {*=} [from] - Inclusive starting index, if negative counts from end - * @param {*=} [to] - Exclusive ending index, if negative counts from end - * @returns {Promise} + * @returns {Promise} */ - async getMetricByIndex(index, metric, count, format, from, to) { + async getMetricByIndex(metric, index, start, end, count, format) { const params = new URLSearchParams(); - if (count !== undefined) params.set("count", String(count)); - if (format !== undefined) params.set("format", String(format)); - if (from !== undefined) params.set("from", String(from)); - if (to !== undefined) params.set("to", String(to)); + if (start !== undefined) params.set('start', String(start)); + if (end !== undefined) params.set('end', String(end)); + if (count !== undefined) params.set('count', String(count)); + if (format !== undefined) params.set('format', String(format)); const query = params.toString(); - return this.get( - `/api/metric/${metric}/${index}${query ? "?" + query : ""}`, - ); - } - - /** - * Bulk metric data - * - * Fetch multiple metrics in a single request. Supports filtering by index and date range. Returns an array of MetricData objects. - * - * @param {*=} [count] - Number of values to return (ignored if `to` is set) - * @param {Format=} [format] - Format of the output - * @param {*=} [from] - Inclusive starting index, if negative counts from end - * @param {Index} [index] - Index to query - * @param {Metrics} [metrics] - Requested metrics - * @param {*=} [to] - Exclusive ending index, if negative counts from end - * @returns {Promise} - */ - async getMetricsBulk(count, format, from, index, metrics, to) { - const params = new URLSearchParams(); - if (count !== undefined) params.set("count", String(count)); - if (format !== undefined) params.set("format", String(format)); - if (from !== undefined) params.set("from", String(from)); - params.set("index", String(index)); - params.set("metrics", String(metrics)); - if (to !== undefined) params.set("to", String(to)); - const query = params.toString(); - return this.get(`/api/metrics/bulk${query ? "?" + query : ""}`); + const path = `/api/metric/${metric}/${index}${query ? '?' + query : ''}`; + if (format === 'csv') { + return this.getText(path); + } + return this.getJson(path); } /** @@ -7963,8 +7136,37 @@ class BrkClient extends BrkClientBase { * 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 {Promise} */ - async getMetricsCatalog() { - return this.get(`/api/metrics/catalog`); + async getMetrics() { + 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. + * + * @param {Metrics} [metrics] - Requested metrics + * @param {Index} [index] - Index to query + * @param {number=} [start] - Inclusive starting index, if negative counts from end + * @param {number=} [end] - Exclusive ending index, if negative counts from end + * @param {number=} [count] - Number of values to return (ignored if `end` is set) + * @param {Format=} [format] - Format of the output + * @returns {Promise} + */ + async getMetricsBulk(metrics, index, start, end, count, 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 (count !== undefined) params.set('count', String(count)); + if (format !== undefined) params.set('format', String(format)); + const query = params.toString(); + const path = `/api/metrics/bulk${query ? '?' + query : ''}`; + if (format === 'csv') { + return this.getText(path); + } + return this.getJson(path); } /** @@ -7974,7 +7176,7 @@ class BrkClient extends BrkClientBase { * @returns {Promise} */ async getMetricsCount() { - return this.get(`/api/metrics/count`); + return this.getJson(`/api/metrics/count`); } /** @@ -7984,7 +7186,7 @@ class BrkClient extends BrkClientBase { * @returns {Promise} */ async getMetricsIndexes() { - return this.get(`/api/metrics/indexes`); + return this.getJson(`/api/metrics/indexes`); } /** @@ -7992,14 +7194,15 @@ class BrkClient extends BrkClientBase { * * Paginated list of available metrics * - * @param {*=} [page] - Pagination index + * @param {number=} [page] - Pagination index * @returns {Promise} */ async getMetricsList(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(); - return this.get(`/api/metrics/list${query ? "?" + query : ""}`); + const path = `/api/metrics/list${query ? '?' + query : ''}`; + return this.getJson(path); } /** @@ -8013,9 +7216,10 @@ class BrkClient extends BrkClientBase { */ async getMetricsSearchByMetric(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(); - return this.get(`/api/metrics/search/${metric}${query ? "?" + query : ""}`); + const path = `/api/metrics/search/${metric}${query ? '?' + query : ''}`; + return this.getJson(path); } /** @@ -8027,7 +7231,7 @@ class BrkClient extends BrkClientBase { * @returns {Promise} */ async getTxByTxid(txid) { - return this.get(`/api/tx/${txid}`); + return this.getJson(`/api/tx/${txid}`); } /** @@ -8039,7 +7243,7 @@ class BrkClient extends BrkClientBase { * @returns {Promise} */ async getTxByTxidHex(txid) { - return this.get(`/api/tx/${txid}/hex`); + return this.getJson(`/api/tx/${txid}/hex`); } /** @@ -8052,7 +7256,7 @@ class BrkClient extends BrkClientBase { * @returns {Promise} */ async getTxByTxidOutspendByVout(txid, vout) { - return this.get(`/api/tx/${txid}/outspend/${vout}`); + return this.getJson(`/api/tx/${txid}/outspend/${vout}`); } /** @@ -8064,7 +7268,7 @@ class BrkClient extends BrkClientBase { * @returns {Promise} */ async getTxByTxidOutspends(txid) { - return this.get(`/api/tx/${txid}/outspends`); + return this.getJson(`/api/tx/${txid}/outspends`); } /** @@ -8076,7 +7280,7 @@ class BrkClient extends BrkClientBase { * @returns {Promise} */ async getTxByTxidStatus(txid) { - return this.get(`/api/tx/${txid}/status`); + return this.getJson(`/api/tx/${txid}/status`); } /** @@ -8086,7 +7290,7 @@ class BrkClient extends BrkClientBase { * @returns {Promise} */ async getV1DifficultyAdjustment() { - return this.get(`/api/v1/difficulty-adjustment`); + return this.getJson(`/api/v1/difficulty-adjustment`); } /** @@ -8096,7 +7300,7 @@ class BrkClient extends BrkClientBase { * @returns {Promise} */ async getV1FeesMempoolBlocks() { - return this.get(`/api/v1/fees/mempool-blocks`); + return this.getJson(`/api/v1/fees/mempool-blocks`); } /** @@ -8106,7 +7310,7 @@ class BrkClient extends BrkClientBase { * @returns {Promise} */ async getV1FeesRecommended() { - return this.get(`/api/v1/fees/recommended`); + return this.getJson(`/api/v1/fees/recommended`); } /** @@ -8118,7 +7322,7 @@ class BrkClient extends BrkClientBase { * @returns {Promise} */ async getV1MiningBlocksFeesByTimePeriod(time_period) { - return this.get(`/api/v1/mining/blocks/fees/${time_period}`); + return this.getJson(`/api/v1/mining/blocks/fees/${time_period}`); } /** @@ -8130,7 +7334,7 @@ class BrkClient extends BrkClientBase { * @returns {Promise} */ async getV1MiningBlocksRewardsByTimePeriod(time_period) { - return this.get(`/api/v1/mining/blocks/rewards/${time_period}`); + return this.getJson(`/api/v1/mining/blocks/rewards/${time_period}`); } /** @@ -8142,7 +7346,7 @@ class BrkClient extends BrkClientBase { * @returns {Promise} */ async getV1MiningBlocksSizesWeightsByTimePeriod(time_period) { - return this.get(`/api/v1/mining/blocks/sizes-weights/${time_period}`); + return this.getJson(`/api/v1/mining/blocks/sizes-weights/${time_period}`); } /** @@ -8154,7 +7358,7 @@ class BrkClient extends BrkClientBase { * @returns {Promise} */ async getV1MiningBlocksTimestamp(timestamp) { - return this.get(`/api/v1/mining/blocks/timestamp/${timestamp}`); + return this.getJson(`/api/v1/mining/blocks/timestamp/${timestamp}`); } /** @@ -8164,7 +7368,7 @@ class BrkClient extends BrkClientBase { * @returns {Promise} */ async getV1MiningDifficultyAdjustments() { - return this.get(`/api/v1/mining/difficulty-adjustments`); + return this.getJson(`/api/v1/mining/difficulty-adjustments`); } /** @@ -8176,7 +7380,7 @@ class BrkClient extends BrkClientBase { * @returns {Promise} */ async getV1MiningDifficultyAdjustmentsByTimePeriod(time_period) { - return this.get(`/api/v1/mining/difficulty-adjustments/${time_period}`); + return this.getJson(`/api/v1/mining/difficulty-adjustments/${time_period}`); } /** @@ -8186,7 +7390,7 @@ class BrkClient extends BrkClientBase { * @returns {Promise} */ async getV1MiningHashrate() { - return this.get(`/api/v1/mining/hashrate`); + return this.getJson(`/api/v1/mining/hashrate`); } /** @@ -8198,7 +7402,7 @@ class BrkClient extends BrkClientBase { * @returns {Promise} */ async getV1MiningHashrateByTimePeriod(time_period) { - return this.get(`/api/v1/mining/hashrate/${time_period}`); + return this.getJson(`/api/v1/mining/hashrate/${time_period}`); } /** @@ -8210,7 +7414,7 @@ class BrkClient extends BrkClientBase { * @returns {Promise} */ async getV1MiningPoolBySlug(slug) { - return this.get(`/api/v1/mining/pool/${slug}`); + return this.getJson(`/api/v1/mining/pool/${slug}`); } /** @@ -8220,7 +7424,7 @@ class BrkClient extends BrkClientBase { * @returns {Promise} */ async getV1MiningPools() { - return this.get(`/api/v1/mining/pools`); + return this.getJson(`/api/v1/mining/pools`); } /** @@ -8232,7 +7436,7 @@ class BrkClient extends BrkClientBase { * @returns {Promise} */ async getV1MiningPoolsByTimePeriod(time_period) { - return this.get(`/api/v1/mining/pools/${time_period}`); + return this.getJson(`/api/v1/mining/pools/${time_period}`); } /** @@ -8244,7 +7448,7 @@ class BrkClient extends BrkClientBase { * @returns {Promise} */ async getV1MiningRewardStatsByBlockCount(block_count) { - return this.get(`/api/v1/mining/reward-stats/${block_count}`); + return this.getJson(`/api/v1/mining/reward-stats/${block_count}`); } /** @@ -8256,7 +7460,7 @@ class BrkClient extends BrkClientBase { * @returns {Promise} */ async getV1ValidateAddress(address) { - return this.get(`/api/v1/validate-address/${address}`); + return this.getJson(`/api/v1/validate-address/${address}`); } /** @@ -8266,7 +7470,7 @@ class BrkClient extends BrkClientBase { * @returns {Promise} */ async getHealth() { - return this.get(`/health`); + return this.getJson(`/health`); } /** @@ -8276,8 +7480,9 @@ class BrkClient extends BrkClientBase { * @returns {Promise} */ async getVersion() { - return this.get(`/version`); + return this.getJson(`/version`); } + } export { BrkClient, BrkError }; diff --git a/packages/brk_client/brk_client/__init__.py b/packages/brk_client/brk_client/__init__.py index 69f16f9fd..21735b987 100644 --- a/packages/brk_client/brk_client/__init__.py +++ b/packages/brk_client/brk_client/__init__.py @@ -1,23 +1,12 @@ # Auto-generated BRK Python client # Do not edit manually -from __future__ import annotations +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 -from typing import ( - Any, - Generic, - List, - Literal, - Optional, - Protocol, - TypedDict, - TypeVar, - Union, -) - -import httpx - -T = TypeVar("T") +T = TypeVar('T') # Type definitions @@ -27,656 +16,62 @@ Address = str Sats = int # Index within its type (e.g., 0 for first P2WPKH address) TypeIndex = int - - -class AddressChainStats(TypedDict): - """ - Address statistics on the blockchain (confirmed transactions only) - - Based on mempool.space's format with type_index extension. - - Attributes: - funded_txo_count: Total number of transaction outputs that funded this address - funded_txo_sum: Total amount in satoshis received by this address across all funded outputs - spent_txo_count: Total number of transaction outputs spent from this address - spent_txo_sum: Total amount in satoshis spent from this address - 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 - spent_txo_sum: Sats - tx_count: int - type_index: TypeIndex - - -class AddressMempoolStats(TypedDict): - """ - Address statistics in the mempool (unconfirmed transactions only) - - Based on mempool.space's format. - - Attributes: - funded_txo_count: Number of unconfirmed transaction outputs funding this address - funded_txo_sum: Total amount in satoshis being received in unconfirmed transactions - spent_txo_count: Number of unconfirmed transaction inputs spending from this address - 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 - - Attributes: - address: Bitcoin address string - 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] - - # Transaction ID (hash) Txid = str - - -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 - - Attributes: - address: The validated address - isscript: Whether this is a script address (P2SH) - isvalid: Whether the address is valid - iswitness: Whether this is a witness address - scriptPubKey: The scriptPubKey in hex - witness_program: Witness program in hex - witness_version: Witness version (0 for P2WPKH/P2WSH, 1 for P2TR) - """ - - address: Optional[str] - isscript: Optional[bool] - isvalid: bool - iswitness: Optional[bool] - scriptPubKey: Optional[str] - witness_program: Optional[str] - witness_version: Optional[int] - - # Unified index for any address type (loaded or empty) AnyAddressIndex = TypeIndex # Bitcoin amount as floating point (1 BTC = 100,000,000 satoshis) Bitcoin = float # Position within a .blk file, encoding file index and byte offset BlkPosition = int - - -class BlockCountParam(TypedDict): - """ - Attributes: - block_count: Number of recent blocks to include - """ - - block_count: int - - # Block height Height = int # UNIX timestamp in seconds Timestamp = int - - -class BlockFeesEntry(TypedDict): - """ - A single block fees data point. - """ - - avgFees: Sats - avgHeight: Height - timestamp: Timestamp - - # Block hash BlockHash = str - - -class BlockHashParam(TypedDict): - hash: BlockHash - - TxIndex = int - - -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 - - # Transaction or block weight in weight units (WU) Weight = int - - -class BlockInfo(TypedDict): - """ - Block information returned by the API - - Attributes: - difficulty: Block difficulty as a floating point number - height: Block height - id: Block hash - size: Block size in bytes - timestamp: Block timestamp (Unix time) - tx_count: Number of transactions in the block - weight: Block weight in weight units - """ - - difficulty: float - height: Height - id: BlockHash - size: int - timestamp: Timestamp - tx_count: int - weight: Weight - - -class BlockRewardsEntry(TypedDict): - """ - A single block rewards data point. - """ - - avgHeight: int - avgRewards: int - timestamp: int - - -class BlockSizeEntry(TypedDict): - """ - A single block size data point. - """ - - avgHeight: int - avgSize: int - timestamp: int - - -class BlockWeightEntry(TypedDict): - """ - A single block weight data point. - """ - - avgHeight: int - avgWeight: int - timestamp: 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 - - Attributes: - height: Block height (only if in best chain) - in_best_chain: Whether this block is in the best chain - next_best: Hash of the next block in the best chain (only if in best chain and not tip) - """ - - height: Union[Height, None] - in_best_chain: bool - next_best: Union[BlockHash, None] - - -class BlockTimestamp(TypedDict): - """ - Block information returned for timestamp queries - - Attributes: - hash: Block hash - height: Block height - timestamp: Block timestamp in ISO 8601 format - """ - - hash: BlockHash - height: Height - timestamp: str - - Cents = int # Closing price value for a time period Close = Cents # Output format for API responses Format = Literal["json", "csv"] - - -class DataRangeFormat(TypedDict): - """ - Data range with output format for API query parameters - - Attributes: - count: Number of values to return (ignored if `to` is set) - format: Format of the output - from_: Inclusive starting index, if negative counts from end - to: Exclusive ending index, if negative counts from end - """ - - count: Optional[int] - format: Format - from_: Optional[int] - to: Optional[int] - - # Date in YYYYMMDD format stored as u32 Date = int DateIndex = int DecadeIndex = int - - -class DifficultyAdjustment(TypedDict): - """ - Difficulty adjustment information. - - Attributes: - adjustedTimeAvg: Time-adjusted average (accounting for timestamp manipulation) - difficultyChange: Estimated difficulty change at next retarget (%) - estimatedRetargetDate: Estimated Unix timestamp of next retarget - nextRetargetHeight: Height of next retarget - previousRetarget: Previous difficulty adjustment (%) - progressPercent: Progress through current difficulty epoch (0-100%) - remainingBlocks: Blocks remaining until retarget - remainingTime: Estimated seconds until retarget - timeAvg: Average block time in current epoch (seconds) - timeOffset: Time offset from expected schedule (seconds) - """ - - adjustedTimeAvg: int - difficultyChange: float - estimatedRetargetDate: int - nextRetargetHeight: Height - previousRetarget: float - progressPercent: float - remainingBlocks: int - remainingTime: int - timeAvg: int - timeOffset: int - - -class DifficultyAdjustmentEntry(TypedDict): - """ - A single difficulty adjustment entry. - Serializes as array: [timestamp, height, difficulty, change_percent] - """ - - change_percent: float - difficulty: float - height: Height - timestamp: Timestamp - - -class DifficultyEntry(TypedDict): - """ - A single difficulty data point. - - Attributes: - difficulty: Difficulty value. - height: Block height of the adjustment. - timestamp: Unix timestamp of the difficulty adjustment. - """ - - difficulty: float - height: Height - timestamp: Timestamp - - DifficultyEpoch = int # US Dollar amount as floating point Dollars = float - - -class EmptyAddressData(TypedDict): - """ - Data of an empty address - - Attributes: - funded_txo_count: Total funded/spent transaction output count (equal since address is empty) - transfered: Total satoshis transferred - tx_count: Total transaction count - """ - - funded_txo_count: int - transfered: Sats - tx_count: int - - EmptyAddressIndex = TypeIndex EmptyOutputIndex = TypeIndex # Fee rate in sats/vB FeeRate = float HalvingEpoch = int - - -class HashrateEntry(TypedDict): - """ - A single hashrate data point. - - Attributes: - avgHashrate: Average hashrate (H/s). - timestamp: Unix timestamp. - """ - - avgHashrate: int - timestamp: Timestamp - - -class HashrateSummary(TypedDict): - """ - Summary of network hashrate and difficulty data. - - Attributes: - currentDifficulty: Current network difficulty. - currentHashrate: Current network hashrate (H/s). - difficulty: Historical difficulty adjustments. - hashrates: Historical hashrate data points. - """ - - currentDifficulty: float - currentHashrate: int - difficulty: List[DifficultyEntry] - hashrates: List[HashrateEntry] - - -class Health(TypedDict): - """ - Server health status - """ - - service: str - status: str - timestamp: str - - -class HeightParam(TypedDict): - height: Height - - # Hex-encoded string Hex = str # Highest price value for a time period High = Cents - - -class IndexInfo(TypedDict): - """ - Information about an available index and its query aliases - - Attributes: - aliases: All Accepted query aliases - index: The canonical index name - """ - - aliases: List[str] - index: Index - - # Maximum number of results to return. Defaults to 100 if not specified. Limit = int - - -class LimitParam(TypedDict): - limit: Limit - - -class LoadedAddressData(TypedDict): - """ - Data for a loaded (non-empty) address with current balance - - Attributes: - funded_txo_count: Number of transaction outputs funded to this address - realized_cap: The realized capitalization of this address - received: Satoshis received by this address - sent: Satoshis sent by this address - spent_txo_count: Number of transaction outputs spent by this address - tx_count: Total transaction count - """ - - funded_txo_count: int - realized_cap: Dollars - received: Sats - sent: Sats - spent_txo_count: int - tx_count: int - - LoadedAddressIndex = TypeIndex # Lowest price value for a time period Low = Cents - - -class MempoolBlock(TypedDict): - """ - Block info in a mempool.space like format for fee estimation. - - Attributes: - blockSize: Total block size in weight units - blockVSize: Total block virtual size in vbytes - feeRange: Fee rate range: [min, 10%, 25%, 50%, 75%, 90%, max] - medianFee: Median fee rate in sat/vB - nTx: Number of transactions in the projected block - totalFees: Total fees in satoshis - """ - - blockSize: int - blockVSize: float - feeRange: List[FeeRate] - medianFee: FeeRate - nTx: int - totalFees: Sats - - # Virtual size in vbytes (weight / 4, rounded up) VSize = int - - -class MempoolInfo(TypedDict): - """ - Mempool statistics - - Attributes: - count: Number of transactions in the mempool - total_fee: Total fees of all transactions in the mempool (satoshis) - vsize: Total virtual size of all transactions in the mempool (vbytes) - """ - - count: int - total_fee: Sats - vsize: VSize - - # Metric name Metric = str - - -class MetricCount(TypedDict): - """ - Metric count statistics - distinct metrics and total metric-index combinations - - Attributes: - distinct_metrics: Number of unique metrics available (e.g., realized_price, market_cap) - lazy_endpoints: Number of lazy (computed on-the-fly) metric-index combinations - stored_endpoints: Number of eager (stored on disk) metric-index combinations - total_endpoints: Total number of metric-index combinations across all timeframes - """ - - distinct_metrics: int - lazy_endpoints: int - stored_endpoints: int - total_endpoints: int - - -class MetricParam(TypedDict): - metric: Metric - - # Comma-separated list of metric names Metrics = str - - -class MetricSelection(TypedDict): - """ - Selection of metrics to query - - Attributes: - count: Number of values to return (ignored if `to` is set) - format: Format of the output - from_: Inclusive starting index, if negative counts from end - index: Index to query - metrics: Requested metrics - to: Exclusive ending index, if negative counts from end - """ - - count: Optional[int] - format: Format - from_: Optional[int] - index: Index - metrics: Metrics - to: Optional[int] - - -class MetricSelectionLegacy(TypedDict): - """ - Legacy metric selection parameters (deprecated) - - Attributes: - count: Number of values to return (ignored if `to` is set) - format: Format of the output - from_: Inclusive starting index, if negative counts from end - to: Exclusive ending index, if negative counts from end - """ - - count: Optional[int] - format: Format - from_: Optional[int] - ids: Metrics - index: Index - to: Optional[int] - - -class MetricWithIndex(TypedDict): - """ - Attributes: - index: Aggregation index - metric: Metric name - """ - - index: Index - metric: Metric - - MonthIndex = int # Opening price value for a time period Open = Cents - - -class OHLCCents(TypedDict): - """ - OHLC (Open, High, Low, Close) data in cents - """ - - close: Close - high: High - low: Low - open: Open - - -class OHLCDollars(TypedDict): - """ - OHLC (Open, High, Low, Close) data in dollars - """ - - close: Close - high: High - low: Low - open: Open - - -class OHLCSats(TypedDict): - """ - OHLC (Open, High, Low, Close) data in satoshis - """ - - close: Close - high: High - low: Low - open: Open - - 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 @@ -699,365 +94,10 @@ P2WPKHAddressIndex = TypeIndex P2WPKHBytes = U8x20 P2WSHAddressIndex = TypeIndex P2WSHBytes = U8x32 - - -class PaginatedMetrics(TypedDict): - """ - A paginated list of available metric names (1000 per page) - - Attributes: - current_page: Current page number (0-indexed) - 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 - - Attributes: - page: Pagination index - """ - - page: Optional[int] - - -class PoolBlockCounts(TypedDict): - """ - Block counts for different time periods - - Attributes: - _1w: Blocks mined in last week - _24h: Blocks mined in last 24 hours - all: Total blocks mined (all time) - """ - - _1w: int - _24h: int - all: int - - -class PoolBlockShares(TypedDict): - """ - Pool's share of total blocks for different time periods - - Attributes: - _1w: Share of blocks in last week - _24h: Share of blocks in last 24 hours - all: Share of all blocks (0.0 - 1.0) - """ - - _1w: float - _24h: float - all: float - - -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", -] - - -class PoolDetailInfo(TypedDict): - """ - Pool information for detail view - - Attributes: - addresses: Known payout addresses - id: Unique pool identifier - link: Pool website URL - name: Pool name - regexes: Coinbase tag patterns (regexes) - slug: URL-friendly pool identifier - """ - - addresses: List[str] - id: int - link: str - name: str - regexes: List[str] - slug: PoolSlug - - -class PoolDetail(TypedDict): - """ - Detailed pool information with statistics across time periods - - Attributes: - blockCount: Block counts for different time periods - blockShare: Pool's share of total blocks for different time periods - estimatedHashrate: Estimated hashrate based on blocks mined - pool: Pool information - reportedHashrate: Self-reported hashrate (if available) - """ - - blockCount: PoolBlockCounts - blockShare: PoolBlockShares - estimatedHashrate: int - pool: PoolDetailInfo - reportedHashrate: Optional[int] - - -class PoolInfo(TypedDict): - """ - Basic pool information for listing all pools - - Attributes: - name: Pool name - 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 - - Attributes: - blockCount: Number of blocks mined in the time period - emptyBlocks: Number of empty blocks mined - link: Pool website URL - name: Pool name - poolId: Unique pool identifier - rank: Pool ranking by block count (1 = most blocks) - share: Pool's share of total blocks (0.0 - 1.0) - slug: URL-friendly pool identifier - """ - - blockCount: int - emptyBlocks: int - link: str - name: str - poolId: int - rank: int - share: float - slug: PoolSlug - - -class PoolsSummary(TypedDict): - """ - Mining pools response for a time period - - Attributes: - blockCount: Total blocks in the time period - lastEstimatedHashrate: Estimated network hashrate (hashes per second) - pools: List of pools sorted by block count descending - """ - - blockCount: int - lastEstimatedHashrate: int - pools: List[PoolStats] - - +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 - - -class RecommendedFees(TypedDict): - """ - Recommended fee rates in sat/vB - - Attributes: - economyFee: Fee rate for economical confirmation - fastestFee: Fee rate for fastest confirmation (next block) - halfHourFee: Fee rate for confirmation within ~30 minutes (3 blocks) - hourFee: Fee rate for confirmation within ~1 hour (6 blocks) - minimumFee: Minimum relay fee rate - """ - - economyFee: FeeRate - fastestFee: FeeRate - halfHourFee: FeeRate - hourFee: FeeRate - minimumFee: FeeRate - - -class RewardStats(TypedDict): - """ - Block reward statistics over a range of blocks - - Attributes: - endBlock: Last block in the range - startBlock: First block in the range - """ - - endBlock: Height - startBlock: Height - totalFee: Sats - totalReward: Sats - totalTx: int - - SemesterIndex = int # Fixed-size boolean value optimized for on-disk storage (stored as u16) StoredBool = int @@ -1071,7 +111,663 @@ StoredU16 = int 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"] +# Index of the output being spent in the previous transaction +Vout = int +# Transaction version number +TxVersion = int +TxInIndex = int +TxOutIndex = int +# Input index in the spending transaction +Vin = int +UnknownOutputIndex = TypeIndex +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"] +# 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: + funded_txo_count: Total number of transaction outputs that funded this address + funded_txo_sum: Total amount in satoshis received by this address across all funded outputs + spent_txo_count: Total number of transaction outputs spent from this address + spent_txo_sum: Total amount in satoshis spent from this address + 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 + spent_txo_sum: Sats + tx_count: int + type_index: TypeIndex + +class AddressMempoolStats(TypedDict): + """ + Address statistics in the mempool (unconfirmed transactions only) + + Based on mempool.space's format. + + Attributes: + funded_txo_count: Number of unconfirmed transaction outputs funding this address + funded_txo_sum: Total amount in satoshis being received in unconfirmed transactions + spent_txo_count: Number of unconfirmed transaction inputs spending from this address + 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 + + Attributes: + address: Bitcoin address string + 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 + + Attributes: + isvalid: Whether the address is valid + address: The validated address + scriptPubKey: The scriptPubKey in hex + isscript: Whether this is a script address (P2SH) + iswitness: Whether this is a witness address + 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] + isscript: Optional[bool] + iswitness: Optional[bool] + 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 + + Attributes: + id: Block hash + height: Block height + tx_count: Number of transactions in the block + size: Block size in bytes + weight: Block weight in weight units + timestamp: Block timestamp (Unix time) + difficulty: Block difficulty as a floating point number + """ + id: BlockHash + height: Height + tx_count: int + size: int + weight: Weight + 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 + + Attributes: + in_best_chain: Whether this block is in the best chain + 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 + + Attributes: + height: Block height + 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 + + Attributes: + start: Inclusive starting index, if negative counts from end + end: Exclusive ending index, if negative counts from end + count: Number of values to return (ignored if `end` is set) + format: Format of the output + """ + start: Optional[int] + end: Optional[int] + count: Optional[int] + format: Format + +class DifficultyAdjustment(TypedDict): + """ + Difficulty adjustment information. + + Attributes: + progressPercent: Progress through current difficulty epoch (0-100%) + difficultyChange: Estimated difficulty change at next retarget (%) + estimatedRetargetDate: Estimated Unix timestamp of next retarget + remainingBlocks: Blocks remaining until retarget + remainingTime: Estimated seconds until retarget + previousRetarget: Previous difficulty adjustment (%) + nextRetargetHeight: Height of next retarget + timeAvg: Average block time in current epoch (seconds) + adjustedTimeAvg: Time-adjusted average (accounting for timestamp manipulation) + timeOffset: Time offset from expected schedule (seconds) + """ + progressPercent: float + difficultyChange: float + estimatedRetargetDate: int + remainingBlocks: int + remainingTime: int + previousRetarget: float + nextRetargetHeight: Height + timeAvg: int + 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. + + Attributes: + timestamp: Unix timestamp of the difficulty adjustment. + difficulty: Difficulty value. + height: Block height of the adjustment. + """ + timestamp: Timestamp + difficulty: float + height: Height + +class EmptyAddressData(TypedDict): + """ + Data of an empty address + + Attributes: + tx_count: Total transaction count + 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. + + Attributes: + timestamp: Unix timestamp. + avgHashrate: Average hashrate (H/s). + """ + timestamp: Timestamp + avgHashrate: int + +class HashrateSummary(TypedDict): + """ + Summary of network hashrate and difficulty data. + + Attributes: + hashrates: Historical hashrate data points. + difficulty: Historical difficulty adjustments. + 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 + + Attributes: + 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 + + Attributes: + tx_count: Total transaction count + funded_txo_count: Number of transaction outputs funded to this address + spent_txo_count: Number of transaction outputs spent by this address + received: Satoshis received by this address + 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 + received: Sats + sent: Sats + realized_cap: Dollars + +class MempoolBlock(TypedDict): + """ + Block info in a mempool.space like format for fee estimation. + + Attributes: + blockSize: Total block size in weight units + blockVSize: Total block virtual size in vbytes + nTx: Number of transactions in the projected block + totalFees: Total fees in satoshis + medianFee: Median fee rate in sat/vB + feeRange: Fee rate range: [min, 10%, 25%, 50%, 75%, 90%, max] + """ + blockSize: int + blockVSize: float + nTx: int + totalFees: Sats + medianFee: FeeRate + feeRange: List[FeeRate] + +class MempoolInfo(TypedDict): + """ + Mempool statistics + + Attributes: + count: Number of transactions in the mempool + 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 + + Attributes: + distinct_metrics: Number of unique metrics available (e.g., realized_price, market_cap) + total_endpoints: Total number of metric-index combinations across all timeframes + 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 + + Attributes: + metrics: Requested metrics + index: Index to query + start: Inclusive starting index, if negative counts from end + end: Exclusive ending index, if negative counts from end + count: Number of values to return (ignored if `end` is set) + format: Format of the output + """ + metrics: Metrics + index: Index + start: Optional[int] + end: Optional[int] + count: Optional[int] + format: Format + +class MetricSelectionLegacy(TypedDict): + """ + Legacy metric selection parameters (deprecated) + + Attributes: + start: Inclusive starting index, if negative counts from end + end: Exclusive ending index, if negative counts from end + count: Number of values to return (ignored if `end` is set) + format: Format of the output + """ + index: Index + ids: Metrics + start: Optional[int] + end: Optional[int] + count: Optional[int] + 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) + + Attributes: + current_page: Current page number (0-indexed) + 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 + + Attributes: + page: Pagination index + """ + page: Optional[int] + +class PoolBlockCounts(TypedDict): + """ + Block counts for different time periods + + Attributes: + all: Total blocks mined (all time) + _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 + + Attributes: + all: Share of all blocks (0.0 - 1.0) + _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 + + Attributes: + id: Unique pool identifier + name: Pool name + link: Pool website URL + addresses: Known payout addresses + regexes: Coinbase tag patterns (regexes) + slug: URL-friendly pool identifier + """ + id: int + name: str + link: str + addresses: List[str] + regexes: List[str] + slug: PoolSlug + +class PoolDetail(TypedDict): + """ + Detailed pool information with statistics across time periods + + Attributes: + pool: Pool information + blockCount: Block counts for different time periods + blockShare: Pool's share of total blocks for different time periods + 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 + + Attributes: + name: Pool name + 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 + + Attributes: + poolId: Unique pool identifier + name: Pool name + link: Pool website URL + blockCount: Number of blocks mined in the time period + rank: Pool ranking by block count (1 = most blocks) + emptyBlocks: Number of empty blocks mined + slug: URL-friendly pool identifier + share: Pool's share of total blocks (0.0 - 1.0) + """ + poolId: int + name: str + link: str + blockCount: int + rank: int + emptyBlocks: int + slug: PoolSlug + share: float + +class PoolsSummary(TypedDict): + """ + Mining pools response for a time period + + Attributes: + pools: List of pools sorted by block count descending + 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 + + Attributes: + fastestFee: Fee rate for fastest confirmation (next block) + halfHourFee: Fee rate for confirmation within ~30 minutes (3 blocks) + hourFee: Fee rate for confirmation within ~1 hour (6 blocks) + 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 + + Attributes: + 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): """ @@ -1081,26 +777,15 @@ class SupplyState(TypedDict): utxo_count: Number of unspent transaction outputs value: Total value in satoshis """ - utxo_count: int value: Sats - -# 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"] - - class TimePeriodParam(TypedDict): time_period: TimePeriod - class TimestampParam(TypedDict): timestamp: Timestamp - class TxOut(TypedDict): """ Transaction output @@ -1109,91 +794,69 @@ class TxOut(TypedDict): scriptpubkey: Script pubkey (locking script) value: Value of the output in satoshis """ - scriptpubkey: str value: Sats - -# Index of the output being spent in the previous transaction -Vout = int - - class TxIn(TypedDict): """ Transaction input Attributes: - inner_redeemscript_asm: Inner redeemscript in assembly format (for P2SH-wrapped SegWit) - is_coinbase: Whether this input is a coinbase (block reward) input + txid: Transaction ID of the output being spent prevout: Information about the previous output being spent scriptsig: Signature script (for non-SegWit inputs) scriptsig_asm: Signature script in assembly format + is_coinbase: Whether this input is a coinbase (block reward) input sequence: Input sequence number - txid: Transaction ID of the output being spent + inner_redeemscript_asm: Inner redeemscript in assembly format (for P2SH-wrapped SegWit) """ - - inner_redeemscript_asm: Optional[str] - is_coinbase: bool + txid: Txid + vout: Vout prevout: Union[TxOut, None] scriptsig: str scriptsig_asm: str + is_coinbase: bool sequence: int - txid: Txid - vout: Vout - + inner_redeemscript_asm: Optional[str] class TxStatus(TypedDict): """ Transaction confirmation status Attributes: - block_hash: Block hash (only present if confirmed) - block_height: Block height (only present if confirmed) - block_time: Block timestamp (only present if confirmed) confirmed: Whether the transaction is confirmed + block_height: Block height (only present if confirmed) + block_hash: Block hash (only present if confirmed) + block_time: Block timestamp (only present if confirmed) """ - - block_hash: Union[BlockHash, None] - block_height: Union[Height, None] - block_time: Union[Timestamp, None] confirmed: bool - - -# Transaction version number -TxVersion = int - + 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 Attributes: - fee: Transaction fee in satoshis - sigops: Number of signature operations size: Transaction size in bytes + weight: Transaction weight + sigops: Number of signature operations + fee: Transaction fee in satoshis vin: Transaction inputs vout: Transaction outputs - weight: Transaction weight """ - - fee: Sats index: Union[TxIndex, None] - locktime: RawLockTime - sigops: int - size: int - status: TxStatus txid: Txid version: TxVersion + locktime: RawLockTime + size: int + weight: Weight + sigops: int + fee: Sats vin: List[TxIn] vout: List[TxOut] - weight: Weight - - -TxInIndex = int -TxOutIndex = int -# Input index in the spending transaction -Vin = int - + status: TxStatus class TxOutspend(TypedDict): """ @@ -1201,21 +864,18 @@ class TxOutspend(TypedDict): Attributes: spent: Whether the output has been spent - status: Status of the spending transaction (only present if spent) txid: Transaction ID of the spending transaction (only present if spent) vin: Input index in the spending transaction (only present if spent) + status: Status of the spending transaction (only present if spent) """ - spent: bool - status: Union[TxStatus, None] 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) @@ -1224,90 +884,41 @@ class TxidVout(TypedDict): txid: Transaction ID vout: Output index """ - txid: Txid vout: Vout - -UnknownOutputIndex = TypeIndex - - class Utxo(TypedDict): """ Unspent transaction output """ - - status: TxStatus txid: Txid - value: Sats vout: Vout - + status: TxStatus + value: Sats class ValidateAddressParam(TypedDict): """ Attributes: address: Bitcoin address to validate (can be any string) """ - address: str - -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", -] - - class MetricLeafWithSchema(TypedDict): """ MetricLeaf with JSON Schema for client generation Attributes: - indexes: Available indexes for this metric - kind: The Rust type (e.g., "Sats", "StoredF64") name: The metric name/identifier + kind: The Rust type (e.g., "Sats", "StoredF64") + indexes: Available indexes for this metric type: JSON Schema type (e.g., "integer", "number", "string", "boolean", "array", "object") """ - - indexes: List[Index] - kind: str name: str + kind: str + indexes: List[Index] type: str -# Hierarchical tree node for organizing metrics into categories -TreeNode = Union[dict[str, "TreeNode"], MetricLeafWithSchema] - - class BrkError(Exception): """Custom error class for BRK client errors.""" @@ -1320,27 +931,48 @@ class BrkClientBase: """Base HTTP client for making requests.""" def __init__(self, base_url: str, timeout: float = 30.0): - self.base_url = base_url - self.timeout = timeout - self._client = httpx.Client(timeout=timeout) + parsed = urlparse(base_url) + self._host = parsed.netloc + self._secure = parsed.scheme == 'https' + self._timeout = timeout + self._conn: Optional[Union[HTTPSConnection, HTTPConnection]] = None - def get(self, path: str) -> Any: - """Make a GET request.""" + def _connect(self) -> Union[HTTPSConnection, HTTPConnection]: + """Get or create HTTP connection.""" + if self._conn is None: + if self._secure: + self._conn = HTTPSConnection(self._host, timeout=self._timeout) + else: + self._conn = HTTPConnection(self._host, timeout=self._timeout) + return self._conn + + def get(self, path: str) -> bytes: + """Make a GET request and return raw bytes.""" try: - base = self.base_url.rstrip("/") - response = self._client.get(f"{base}{path}") - response.raise_for_status() - return response.json() - except httpx.HTTPStatusError as e: - raise BrkError( - f"HTTP error: {e.response.status_code}", e.response.status_code - ) - except httpx.RequestError as e: + conn = self._connect() + conn.request("GET", path) + res = conn.getresponse() + data = res.read() + if res.status >= 400: + raise BrkError(f"HTTP error: {res.status}", res.status) + return data + except (ConnectionError, OSError, TimeoutError) as e: + self._conn = None raise BrkError(str(e)) + def get_json(self, path: str) -> Any: + """Make a GET request and return JSON.""" + return json.loads(self.get(path)) + + def get_text(self, path: str) -> str: + """Make a GET request and return text.""" + return self.get(path).decode() + def close(self): """Close the HTTP client.""" - self._client.close() + if self._conn: + self._conn.close() + self._conn = None def __enter__(self): return self @@ -1356,10 +988,9 @@ def _m(acc: str, s: str) -> str: class MetricData(TypedDict, Generic[T]): """Metric data with range information.""" - total: int - from_: int # 'from' is reserved in Python - to: int + start: int + end: int data: List[T] @@ -1377,20 +1008,18 @@ class MetricEndpoint(Generic[T]): def get(self) -> MetricData[T]: """Fetch all data points for this metric/index.""" - return self._client.get(self.path()) + return self._client.get_json(self.path()) - def range( - self, from_val: Optional[int] = None, to_val: 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 from_val is not None: - params.append(f"from={from_val}") - if to_val is not None: - params.append(f"to={to_val}") + if start is not None: + params.append(f"start={start}") + if end is not None: + params.append(f"end={end}") query = "&".join(params) p = self.path() - return self._client.get(f"{p}?{query}" if query else p) + return self._client.get_json(f"{p}?{query}" if query else p) def path(self) -> str: """Get the endpoint path.""" @@ -1420,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 @@ -1471,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 @@ -1553,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 @@ -1632,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 @@ -1708,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 @@ -1766,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 @@ -1803,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 @@ -1838,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 @@ -1873,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 @@ -1908,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 @@ -1943,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 @@ -1978,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 @@ -2013,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 @@ -2048,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 @@ -2083,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 @@ -2118,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 @@ -2153,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 @@ -2188,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 @@ -2223,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 @@ -2258,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 @@ -2293,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 @@ -2328,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 @@ -2363,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 @@ -2398,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 @@ -2433,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 @@ -2468,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 @@ -2503,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 @@ -2538,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 @@ -2573,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 @@ -2608,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 @@ -2643,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 @@ -2678,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 @@ -2713,1062 +2182,518 @@ 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")) - + 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.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 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 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 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.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")) - - -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") - + 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 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.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.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 RelativePattern: +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 FullnessPattern(Generic[T]): + """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.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')) 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')) 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 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) @@ -3776,13 +2701,12 @@ 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) @@ -3790,27 +2714,12 @@ class _10yPattern: 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.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) @@ -3818,3863 +2727,2934 @@ class _100btcPattern: 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 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 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 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 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.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" - ) - + 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 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.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 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 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.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 _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 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 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.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 _1dReturns1mSdPattern: +class _2015Pattern: """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")) + 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 CostBasisPattern: +class UnclaimedRewardsPattern: """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.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 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 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 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')) 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.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 SatsPattern(Generic[T]): +class _1dReturns1mSdPattern: """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.sd: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'sd')) + self.sma: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'sma')) 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 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')) 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")) - - -# Catalog tree classes - - -class CatalogTree: - """Catalog tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.addresses: CatalogTree_Addresses = CatalogTree_Addresses(client) - self.blocks: CatalogTree_Blocks = CatalogTree_Blocks(client) - self.cointime: CatalogTree_Cointime = CatalogTree_Cointime(client) - self.constants: CatalogTree_Constants = CatalogTree_Constants(client) - self.distribution: CatalogTree_Distribution = CatalogTree_Distribution(client) - self.indexes: CatalogTree_Indexes = CatalogTree_Indexes(client) - self.inputs: CatalogTree_Inputs = CatalogTree_Inputs(client) - self.market: CatalogTree_Market = CatalogTree_Market(client) - self.outputs: CatalogTree_Outputs = CatalogTree_Outputs(client) - self.pools: CatalogTree_Pools = CatalogTree_Pools(client) - self.positions: CatalogTree_Positions = CatalogTree_Positions(client) - self.price: CatalogTree_Price = CatalogTree_Price(client) - self.scripts: CatalogTree_Scripts = CatalogTree_Scripts(client) - self.supply: CatalogTree_Supply = CatalogTree_Supply(client) - self.transactions: CatalogTree_Transactions = CatalogTree_Transactions(client) - - -class CatalogTree_Addresses: - """Catalog 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" - ) - - -class CatalogTree_Blocks: - """Catalog tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.blockhash: MetricPattern11[BlockHash] = MetricPattern11( - client, "blockhash" - ) - self.count: CatalogTree_Blocks_Count = CatalogTree_Blocks_Count(client) - self.difficulty: CatalogTree_Blocks_Difficulty = CatalogTree_Blocks_Difficulty( - client - ) - self.fullness: FullnessPattern[StoredF32] = FullnessPattern( - client, "block_fullness" - ) - self.halving: CatalogTree_Blocks_Halving = CatalogTree_Blocks_Halving(client) - self.interval: CatalogTree_Blocks_Interval = CatalogTree_Blocks_Interval(client) - self.mining: CatalogTree_Blocks_Mining = CatalogTree_Blocks_Mining(client) - self.rewards: CatalogTree_Blocks_Rewards = CatalogTree_Blocks_Rewards(client) - self.size: CatalogTree_Blocks_Size = CatalogTree_Blocks_Size(client) - self.time: CatalogTree_Blocks_Time = CatalogTree_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" - ) - - -class CatalogTree_Blocks_Count: - """Catalog 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" - ) - - -class CatalogTree_Blocks_Difficulty: - """Catalog 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") - - -class CatalogTree_Blocks_Halving: - """Catalog 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" - ) - - -class CatalogTree_Blocks_Interval: - """Catalog 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" - ) - - -class CatalogTree_Blocks_Mining: - """Catalog 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" - ) - - -class CatalogTree_Blocks_Rewards: - """Catalog tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self._24h_coinbase_sum: CatalogTree_Blocks_Rewards_24hCoinbaseSum = ( - CatalogTree_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 CatalogTree_Blocks_Rewards_24hCoinbaseSum: - """Catalog 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") - - -class CatalogTree_Blocks_Size: - """Catalog 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") - - -class CatalogTree_Blocks_Time: - """Catalog 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" - ) - - -class CatalogTree_Cointime: - """Catalog tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.activity: CatalogTree_Cointime_Activity = CatalogTree_Cointime_Activity( - client - ) - self.adjusted: CatalogTree_Cointime_Adjusted = CatalogTree_Cointime_Adjusted( - client - ) - self.cap: CatalogTree_Cointime_Cap = CatalogTree_Cointime_Cap(client) - self.pricing: CatalogTree_Cointime_Pricing = CatalogTree_Cointime_Pricing( - client - ) - self.supply: CatalogTree_Cointime_Supply = CatalogTree_Cointime_Supply(client) - self.value: CatalogTree_Cointime_Value = CatalogTree_Cointime_Value(client) - - -class CatalogTree_Cointime_Activity: - """Catalog 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" - ) - - -class CatalogTree_Cointime_Adjusted: - """Catalog 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" - ) - - -class CatalogTree_Cointime_Cap: - """Catalog 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" - ) - - -class CatalogTree_Cointime_Pricing: - """Catalog 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" - ) - - -class CatalogTree_Cointime_Supply: - """Catalog 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" - ) - - -class CatalogTree_Cointime_Value: - """Catalog 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" - ) - - -class CatalogTree_Constants: - """Catalog 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" - ) - - -class CatalogTree_Distribution: - """Catalog tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.addr_count: CatalogTree_Distribution_AddrCount = ( - CatalogTree_Distribution_AddrCount(client) - ) - self.address_cohorts: CatalogTree_Distribution_AddressCohorts = ( - CatalogTree_Distribution_AddressCohorts(client) - ) - self.addresses_data: CatalogTree_Distribution_AddressesData = ( - CatalogTree_Distribution_AddressesData(client) - ) - self.any_address_indexes: CatalogTree_Distribution_AnyAddressIndexes = ( - CatalogTree_Distribution_AnyAddressIndexes(client) - ) - self.chain_state: MetricPattern11[SupplyState] = MetricPattern11( - client, "chain" - ) - self.empty_addr_count: CatalogTree_Distribution_EmptyAddrCount = ( - CatalogTree_Distribution_EmptyAddrCount(client) - ) - self.emptyaddressindex: MetricPattern32[EmptyAddressIndex] = MetricPattern32( - client, "emptyaddressindex" - ) - self.loadedaddressindex: MetricPattern31[LoadedAddressIndex] = MetricPattern31( - client, "loadedaddressindex" - ) - self.utxo_cohorts: CatalogTree_Distribution_UtxoCohorts = ( - CatalogTree_Distribution_UtxoCohorts(client) - ) - - -class CatalogTree_Distribution_AddrCount: - """Catalog 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" - ) - - -class CatalogTree_Distribution_AddressCohorts: - """Catalog tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.amount_range: CatalogTree_Distribution_AddressCohorts_AmountRange = ( - CatalogTree_Distribution_AddressCohorts_AmountRange(client) - ) - self.ge_amount: CatalogTree_Distribution_AddressCohorts_GeAmount = ( - CatalogTree_Distribution_AddressCohorts_GeAmount(client) - ) - self.lt_amount: CatalogTree_Distribution_AddressCohorts_LtAmount = ( - CatalogTree_Distribution_AddressCohorts_LtAmount(client) - ) - - -class CatalogTree_Distribution_AddressCohorts_AmountRange: - """Catalog 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" - ) - - -class CatalogTree_Distribution_AddressCohorts_GeAmount: - """Catalog 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") - - -class CatalogTree_Distribution_AddressCohorts_LtAmount: - """Catalog 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") - - -class CatalogTree_Distribution_AddressesData: - """Catalog tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.empty: MetricPattern32[EmptyAddressData] = MetricPattern32( - client, "emptyaddressdata" - ) - self.loaded: MetricPattern31[LoadedAddressData] = MetricPattern31( - client, "loadedaddressdata" - ) - - -class CatalogTree_Distribution_AnyAddressIndexes: - """Catalog 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" - ) - - -class CatalogTree_Distribution_EmptyAddrCount: - """Catalog 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" - ) - - -class CatalogTree_Distribution_UtxoCohorts: - """Catalog tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.age_range: CatalogTree_Distribution_UtxoCohorts_AgeRange = ( - CatalogTree_Distribution_UtxoCohorts_AgeRange(client) - ) - self.all: CatalogTree_Distribution_UtxoCohorts_All = ( - CatalogTree_Distribution_UtxoCohorts_All(client) - ) - self.amount_range: CatalogTree_Distribution_UtxoCohorts_AmountRange = ( - CatalogTree_Distribution_UtxoCohorts_AmountRange(client) - ) - self.epoch: CatalogTree_Distribution_UtxoCohorts_Epoch = ( - CatalogTree_Distribution_UtxoCohorts_Epoch(client) - ) - self.ge_amount: CatalogTree_Distribution_UtxoCohorts_GeAmount = ( - CatalogTree_Distribution_UtxoCohorts_GeAmount(client) - ) - self.lt_amount: CatalogTree_Distribution_UtxoCohorts_LtAmount = ( - CatalogTree_Distribution_UtxoCohorts_LtAmount(client) - ) - self.max_age: CatalogTree_Distribution_UtxoCohorts_MaxAge = ( - CatalogTree_Distribution_UtxoCohorts_MaxAge(client) - ) - self.min_age: CatalogTree_Distribution_UtxoCohorts_MinAge = ( - CatalogTree_Distribution_UtxoCohorts_MinAge(client) - ) - self.term: CatalogTree_Distribution_UtxoCohorts_Term = ( - CatalogTree_Distribution_UtxoCohorts_Term(client) - ) - self.type_: CatalogTree_Distribution_UtxoCohorts_Type = ( - CatalogTree_Distribution_UtxoCohorts_Type(client) - ) - self.year: CatalogTree_Distribution_UtxoCohorts_Year = ( - CatalogTree_Distribution_UtxoCohorts_Year(client) - ) - - -class CatalogTree_Distribution_UtxoCohorts_AgeRange: - """Catalog 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") - - -class CatalogTree_Distribution_UtxoCohorts_All: - """Catalog tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.activity: ActivityPattern2 = ActivityPattern2( - client, "coinblocks_destroyed_cumulative" - ) - self.cost_basis: CatalogTree_Distribution_UtxoCohorts_All_CostBasis = ( - CatalogTree_Distribution_UtxoCohorts_All_CostBasis(client) - ) - self.outputs: OutputsPattern = OutputsPattern(client, "utxo_count") - self.realized: RealizedPattern3 = RealizedPattern3(client, "adjusted_sopr") - self.relative: CatalogTree_Distribution_UtxoCohorts_All_Relative = ( - CatalogTree_Distribution_UtxoCohorts_All_Relative(client) - ) - self.supply: SupplyPattern2 = SupplyPattern2(client, "supply") - self.unrealized: UnrealizedPattern = UnrealizedPattern( - client, "neg_unrealized_loss" - ) - - -class CatalogTree_Distribution_UtxoCohorts_All_CostBasis: - """Catalog 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") - - -class CatalogTree_Distribution_UtxoCohorts_All_Relative: - """Catalog 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") - - -class CatalogTree_Distribution_UtxoCohorts_AmountRange: - """Catalog 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" - ) - - -class CatalogTree_Distribution_UtxoCohorts_Epoch: - """Catalog 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") - - -class CatalogTree_Distribution_UtxoCohorts_GeAmount: - """Catalog 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") - - -class CatalogTree_Distribution_UtxoCohorts_LtAmount: - """Catalog 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") - - -class CatalogTree_Distribution_UtxoCohorts_MaxAge: - """Catalog 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") - - -class CatalogTree_Distribution_UtxoCohorts_MinAge: - """Catalog 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") - - -class CatalogTree_Distribution_UtxoCohorts_Term: - """Catalog tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.long: CatalogTree_Distribution_UtxoCohorts_Term_Long = ( - CatalogTree_Distribution_UtxoCohorts_Term_Long(client) - ) - self.short: CatalogTree_Distribution_UtxoCohorts_Term_Short = ( - CatalogTree_Distribution_UtxoCohorts_Term_Short(client) - ) - - -class CatalogTree_Distribution_UtxoCohorts_Term_Long: - """Catalog tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.activity: ActivityPattern2 = ActivityPattern2(client, "lth") - self.cost_basis: CatalogTree_Distribution_UtxoCohorts_Term_Long_CostBasis = ( - CatalogTree_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 CatalogTree_Distribution_UtxoCohorts_Term_Long_CostBasis: - """Catalog 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" - ) - - -class CatalogTree_Distribution_UtxoCohorts_Term_Short: - """Catalog tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.activity: ActivityPattern2 = ActivityPattern2(client, "sth") - self.cost_basis: CatalogTree_Distribution_UtxoCohorts_Term_Short_CostBasis = ( - CatalogTree_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 CatalogTree_Distribution_UtxoCohorts_Term_Short_CostBasis: - """Catalog 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" - ) - - -class CatalogTree_Distribution_UtxoCohorts_Type: - """Catalog 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") - - -class CatalogTree_Distribution_UtxoCohorts_Year: - """Catalog 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") - - -class CatalogTree_Indexes: - """Catalog tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.address: CatalogTree_Indexes_Address = CatalogTree_Indexes_Address(client) - self.dateindex: CatalogTree_Indexes_Dateindex = CatalogTree_Indexes_Dateindex( - client - ) - self.decadeindex: CatalogTree_Indexes_Decadeindex = ( - CatalogTree_Indexes_Decadeindex(client) - ) - self.difficultyepoch: CatalogTree_Indexes_Difficultyepoch = ( - CatalogTree_Indexes_Difficultyepoch(client) - ) - self.halvingepoch: CatalogTree_Indexes_Halvingepoch = ( - CatalogTree_Indexes_Halvingepoch(client) - ) - self.height: CatalogTree_Indexes_Height = CatalogTree_Indexes_Height(client) - self.monthindex: CatalogTree_Indexes_Monthindex = ( - CatalogTree_Indexes_Monthindex(client) - ) - self.quarterindex: CatalogTree_Indexes_Quarterindex = ( - CatalogTree_Indexes_Quarterindex(client) - ) - self.semesterindex: CatalogTree_Indexes_Semesterindex = ( - CatalogTree_Indexes_Semesterindex(client) - ) - self.txindex: CatalogTree_Indexes_Txindex = CatalogTree_Indexes_Txindex(client) - self.txinindex: CatalogTree_Indexes_Txinindex = CatalogTree_Indexes_Txinindex( - client - ) - self.txoutindex: CatalogTree_Indexes_Txoutindex = ( - CatalogTree_Indexes_Txoutindex(client) - ) - self.weekindex: CatalogTree_Indexes_Weekindex = CatalogTree_Indexes_Weekindex( - client - ) - self.yearindex: CatalogTree_Indexes_Yearindex = CatalogTree_Indexes_Yearindex( - client - ) - - -class CatalogTree_Indexes_Address: - """Catalog tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.empty: CatalogTree_Indexes_Address_Empty = ( - CatalogTree_Indexes_Address_Empty(client) - ) - self.opreturn: CatalogTree_Indexes_Address_Opreturn = ( - CatalogTree_Indexes_Address_Opreturn(client) - ) - self.p2a: CatalogTree_Indexes_Address_P2a = CatalogTree_Indexes_Address_P2a( - client - ) - self.p2ms: CatalogTree_Indexes_Address_P2ms = CatalogTree_Indexes_Address_P2ms( - client - ) - self.p2pk33: CatalogTree_Indexes_Address_P2pk33 = ( - CatalogTree_Indexes_Address_P2pk33(client) - ) - self.p2pk65: CatalogTree_Indexes_Address_P2pk65 = ( - CatalogTree_Indexes_Address_P2pk65(client) - ) - self.p2pkh: CatalogTree_Indexes_Address_P2pkh = ( - CatalogTree_Indexes_Address_P2pkh(client) - ) - self.p2sh: CatalogTree_Indexes_Address_P2sh = CatalogTree_Indexes_Address_P2sh( - client - ) - self.p2tr: CatalogTree_Indexes_Address_P2tr = CatalogTree_Indexes_Address_P2tr( - client - ) - self.p2wpkh: CatalogTree_Indexes_Address_P2wpkh = ( - CatalogTree_Indexes_Address_P2wpkh(client) - ) - self.p2wsh: CatalogTree_Indexes_Address_P2wsh = ( - CatalogTree_Indexes_Address_P2wsh(client) - ) - self.unknown: CatalogTree_Indexes_Address_Unknown = ( - CatalogTree_Indexes_Address_Unknown(client) - ) - - -class CatalogTree_Indexes_Address_Empty: - """Catalog tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.identity: MetricPattern9[EmptyOutputIndex] = MetricPattern9( - client, "emptyoutputindex" - ) - - -class CatalogTree_Indexes_Address_Opreturn: - """Catalog tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.identity: MetricPattern14[OpReturnIndex] = MetricPattern14( - client, "opreturnindex" - ) - - -class CatalogTree_Indexes_Address_P2a: - """Catalog tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.identity: MetricPattern16[P2AAddressIndex] = MetricPattern16( - client, "p2aaddressindex" - ) - - -class CatalogTree_Indexes_Address_P2ms: - """Catalog tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.identity: MetricPattern17[P2MSOutputIndex] = MetricPattern17( - client, "p2msoutputindex" - ) - - -class CatalogTree_Indexes_Address_P2pk33: - """Catalog tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.identity: MetricPattern18[P2PK33AddressIndex] = MetricPattern18( - client, "p2pk33addressindex" - ) - - -class CatalogTree_Indexes_Address_P2pk65: - """Catalog tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.identity: MetricPattern19[P2PK65AddressIndex] = MetricPattern19( - client, "p2pk65addressindex" - ) - - -class CatalogTree_Indexes_Address_P2pkh: - """Catalog tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.identity: MetricPattern20[P2PKHAddressIndex] = MetricPattern20( - client, "p2pkhaddressindex" - ) - - -class CatalogTree_Indexes_Address_P2sh: - """Catalog tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.identity: MetricPattern21[P2SHAddressIndex] = MetricPattern21( - client, "p2shaddressindex" - ) - - -class CatalogTree_Indexes_Address_P2tr: - """Catalog tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.identity: MetricPattern22[P2TRAddressIndex] = MetricPattern22( - client, "p2traddressindex" - ) - - -class CatalogTree_Indexes_Address_P2wpkh: - """Catalog tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.identity: MetricPattern23[P2WPKHAddressIndex] = MetricPattern23( - client, "p2wpkhaddressindex" - ) - - -class CatalogTree_Indexes_Address_P2wsh: - """Catalog tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.identity: MetricPattern24[P2WSHAddressIndex] = MetricPattern24( - client, "p2wshaddressindex" - ) - - -class CatalogTree_Indexes_Address_Unknown: - """Catalog tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.identity: MetricPattern28[UnknownOutputIndex] = MetricPattern28( - client, "unknownoutputindex" - ) - - -class CatalogTree_Indexes_Dateindex: - """Catalog 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" - ) - - -class CatalogTree_Indexes_Decadeindex: - """Catalog 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" - ) - - -class CatalogTree_Indexes_Difficultyepoch: - """Catalog 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" - ) - - -class CatalogTree_Indexes_Halvingepoch: - """Catalog 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" - ) - - -class CatalogTree_Indexes_Height: - """Catalog 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" - ) - - -class CatalogTree_Indexes_Monthindex: - """Catalog 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" - ) - - -class CatalogTree_Indexes_Quarterindex: - """Catalog 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" - ) - - -class CatalogTree_Indexes_Semesterindex: - """Catalog 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" - ) - - -class CatalogTree_Indexes_Txindex: - """Catalog 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" - ) - - -class CatalogTree_Indexes_Txinindex: - """Catalog tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.identity: MetricPattern12[TxInIndex] = MetricPattern12(client, "txinindex") - - -class CatalogTree_Indexes_Txoutindex: - """Catalog tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.identity: MetricPattern15[TxOutIndex] = MetricPattern15( - client, "txoutindex" - ) - - -class CatalogTree_Indexes_Weekindex: - """Catalog 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") - - -class CatalogTree_Indexes_Yearindex: - """Catalog 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" - ) - - -class CatalogTree_Inputs: - """Catalog 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" - ) - self.spent: CatalogTree_Inputs_Spent = CatalogTree_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" - ) - - -class CatalogTree_Inputs_Spent: - """Catalog tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.txoutindex: MetricPattern12[TxOutIndex] = MetricPattern12( - client, "txoutindex" - ) - self.value: MetricPattern12[Sats] = MetricPattern12(client, "value") - - -class CatalogTree_Market: - """Catalog tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.ath: CatalogTree_Market_Ath = CatalogTree_Market_Ath(client) - self.dca: CatalogTree_Market_Dca = CatalogTree_Market_Dca(client) - self.indicators: CatalogTree_Market_Indicators = CatalogTree_Market_Indicators( - client - ) - self.lookback: CatalogTree_Market_Lookback = CatalogTree_Market_Lookback(client) - self.moving_average: CatalogTree_Market_MovingAverage = ( - CatalogTree_Market_MovingAverage(client) - ) - self.range: CatalogTree_Market_Range = CatalogTree_Market_Range(client) - self.returns: CatalogTree_Market_Returns = CatalogTree_Market_Returns(client) - self.volatility: CatalogTree_Market_Volatility = CatalogTree_Market_Volatility( - client - ) - - -class CatalogTree_Market_Ath: - """Catalog 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" - ) - - -class CatalogTree_Market_Dca: - """Catalog tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.class_average_price: CatalogTree_Market_Dca_ClassAveragePrice = ( - CatalogTree_Market_Dca_ClassAveragePrice(client) - ) - self.class_returns: CatalogTree_Market_Dca_ClassReturns = ( - CatalogTree_Market_Dca_ClassReturns(client) - ) - self.class_stack: CatalogTree_Market_Dca_ClassStack = ( - CatalogTree_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_btc") - ) - self.period_returns: PeriodAveragePricePattern[StoredF32] = ( - PeriodAveragePricePattern(client, "dca_returns") - ) - self.period_stack: PeriodLumpSumStackPattern = PeriodLumpSumStackPattern( - client, "dca_stack_btc" - ) - - -class CatalogTree_Market_Dca_ClassAveragePrice: - """Catalog 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" - ) - - -class CatalogTree_Market_Dca_ClassReturns: - """Catalog 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" - ) - - -class CatalogTree_Market_Dca_ClassStack: - """Catalog 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") - - -class CatalogTree_Market_Indicators: - """Catalog 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" - ) - - -class CatalogTree_Market_Lookback: - """Catalog tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.price_ago: CatalogTree_Market_Lookback_PriceAgo = ( - CatalogTree_Market_Lookback_PriceAgo(client) - ) - - -class CatalogTree_Market_Lookback_PriceAgo: - """Catalog 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") - - -class CatalogTree_Market_MovingAverage: - """Catalog 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" - ) - - -class CatalogTree_Market_Range: - """Catalog 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" - ) - - -class CatalogTree_Market_Returns: - """Catalog 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: CatalogTree_Market_Returns_PriceReturns = ( - CatalogTree_Market_Returns_PriceReturns(client) - ) - - -class CatalogTree_Market_Returns_PriceReturns: - """Catalog 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") - - -class CatalogTree_Market_Volatility: - """Catalog 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" - ) - - -class CatalogTree_Outputs: - """Catalog tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.count: CatalogTree_Outputs_Count = CatalogTree_Outputs_Count(client) - self.first_txoutindex: MetricPattern11[TxOutIndex] = MetricPattern11( - client, "first_txoutindex" - ) - self.outputtype: MetricPattern15[OutputType] = MetricPattern15( - client, "outputtype" - ) - self.spent: CatalogTree_Outputs_Spent = CatalogTree_Outputs_Spent(client) - self.txindex: MetricPattern15[TxIndex] = MetricPattern15(client, "txindex") - self.typeindex: MetricPattern15[TypeIndex] = MetricPattern15( - client, "typeindex" - ) - self.value: MetricPattern15[Sats] = MetricPattern15(client, "value") - - -class CatalogTree_Outputs_Count: - """Catalog 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" - ) - - -class CatalogTree_Outputs_Spent: - """Catalog tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.txinindex: MetricPattern15[TxInIndex] = MetricPattern15( - client, "txinindex" - ) - - -class CatalogTree_Pools: - """Catalog tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.height_to_pool: MetricPattern11[PoolSlug] = MetricPattern11(client, "pool") - self.vecs: CatalogTree_Pools_Vecs = CatalogTree_Pools_Vecs(client) - - -class CatalogTree_Pools_Vecs: - """Catalog 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") - - -class CatalogTree_Positions: - """Catalog 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" - ) - - -class CatalogTree_Price: - """Catalog tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.cents: CatalogTree_Price_Cents = CatalogTree_Price_Cents(client) - self.sats: CatalogTree_Price_Sats = CatalogTree_Price_Sats(client) - self.usd: CatalogTree_Price_Usd = CatalogTree_Price_Usd(client) - - -class CatalogTree_Price_Cents: - """Catalog tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.ohlc: MetricPattern5[OHLCCents] = MetricPattern5(client, "ohlc_cents") - self.split: CatalogTree_Price_Cents_Split = CatalogTree_Price_Cents_Split( - client - ) - - -class CatalogTree_Price_Cents_Split: - """Catalog 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") - - -class CatalogTree_Price_Sats: - """Catalog 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") - - -class CatalogTree_Price_Usd: - """Catalog 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") - - -class CatalogTree_Scripts: - """Catalog tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.count: CatalogTree_Scripts_Count = CatalogTree_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.value: CatalogTree_Scripts_Value = CatalogTree_Scripts_Value(client) - - -class CatalogTree_Scripts_Count: - """Catalog 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" - ) - - -class CatalogTree_Scripts_Value: - """Catalog tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.opreturn: CoinbasePattern = CoinbasePattern(client, "opreturn_value") - - -class CatalogTree_Supply: - """Catalog tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.burned: CatalogTree_Supply_Burned = CatalogTree_Supply_Burned(client) - self.circulating: CatalogTree_Supply_Circulating = ( - CatalogTree_Supply_Circulating(client) - ) - self.inflation: MetricPattern4[StoredF32] = MetricPattern4( - client, "inflation_rate" - ) - self.market_cap: MetricPattern1[Dollars] = MetricPattern1(client, "market_cap") - self.velocity: CatalogTree_Supply_Velocity = CatalogTree_Supply_Velocity(client) - - -class CatalogTree_Supply_Burned: - """Catalog tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.opreturn: UnclaimedRewardsPattern = UnclaimedRewardsPattern( - client, "opreturn_supply" - ) - self.unspendable: UnclaimedRewardsPattern = UnclaimedRewardsPattern( - client, "unspendable_supply" - ) - - -class CatalogTree_Supply_Circulating: - """Catalog 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") - - -class CatalogTree_Supply_Velocity: - """Catalog 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") - - -class CatalogTree_Transactions: - """Catalog tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.base_size: MetricPattern27[StoredU32] = MetricPattern27( - client, "base_size" - ) - self.count: CatalogTree_Transactions_Count = CatalogTree_Transactions_Count( - client - ) - self.fees: CatalogTree_Transactions_Fees = CatalogTree_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.size: CatalogTree_Transactions_Size = CatalogTree_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: CatalogTree_Transactions_Versions = ( - CatalogTree_Transactions_Versions(client) - ) - self.volume: CatalogTree_Transactions_Volume = CatalogTree_Transactions_Volume( - client - ) - - -class CatalogTree_Transactions_Count: - """Catalog 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") - - -class CatalogTree_Transactions_Fees: - """Catalog tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.fee: CatalogTree_Transactions_Fees_Fee = CatalogTree_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 CatalogTree_Transactions_Fees_Fee: - """Catalog tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.bitcoin: CountPattern2[Bitcoin] = CountPattern2(client, "fee_btc") - self.dollars: CatalogTree_Transactions_Fees_Fee_Dollars = ( - CatalogTree_Transactions_Fees_Fee_Dollars(client) - ) - self.sats: CountPattern2[Sats] = CountPattern2(client, "fee") - self.txindex: MetricPattern27[Sats] = MetricPattern27(client, "fee") - - -class CatalogTree_Transactions_Fees_Fee_Dollars: - """Catalog 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") - - -class CatalogTree_Transactions_Size: - """Catalog 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" - ) - - -class CatalogTree_Transactions_Versions: - """Catalog 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") - - -class CatalogTree_Transactions_Volume: - """Catalog 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" - ) - + self.ratio: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'ratio')) + +# 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') + +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') + +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') + +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') + +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') + +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') + +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') + +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') + +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') + +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') + +class MetricsTree_Blocks: + """Metrics tree node.""" + + 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.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') + +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') + +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') + +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') + +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') + +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') + +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') + +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) + self.cap: MetricsTree_Cointime_Cap = MetricsTree_Cointime_Cap(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') + +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') + +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') + +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') + +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') + +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) + +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') + +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') + +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') + +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') + +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') + +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') + +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') + +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') + +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') + +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') + +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') + +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') + +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') + +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') + +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') + +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') + +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') + +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) + +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') + +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') + +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) + +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) + +class MetricsTree_Indexes_Address_Empty: + """Metrics tree node.""" + + 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') + +class MetricsTree_Indexes_Address_P2a: + """Metrics tree node.""" + + 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') + +class MetricsTree_Indexes_Address_P2pk33: + """Metrics tree node.""" + + 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') + +class MetricsTree_Indexes_Address_P2pkh: + """Metrics tree node.""" + + 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') + +class MetricsTree_Indexes_Address_P2tr: + """Metrics tree node.""" + + 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') + +class MetricsTree_Indexes_Address_P2wsh: + """Metrics tree node.""" + + 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') + +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) + +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') + +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') + +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') + +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') + +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') + +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') + +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') + +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') + +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') + +class MetricsTree_Indexes_Txinindex: + """Metrics tree node.""" + + 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') + +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') + +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') + +class MetricsTree_Indexes: + """Metrics tree node.""" + + 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.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.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) + +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') + +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') + 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') + +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') + +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') + +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') + +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') + +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') + +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') + +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') + +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) + +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') + +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') + +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') + +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) + +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') + +class MetricsTree_Market: + """Metrics tree node.""" + + 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.lookback: MetricsTree_Market_Lookback = MetricsTree_Market_Lookback(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) + +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') + +class MetricsTree_Outputs_Spent: + """Metrics tree node.""" + + 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 = ''): + 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.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') + +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') + +class MetricsTree_Pools: + """Metrics tree node.""" + + 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') + +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') + +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) + +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') + +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') + +class MetricsTree_Price: + """Metrics tree node.""" + + 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') + +class MetricsTree_Scripts_Value: + """Metrics tree node.""" + + 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 = ''): + 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.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') + +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') + +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') + +class MetricsTree_Supply: + """Metrics tree node.""" + + 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.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') + +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') + +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') + +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') + +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') + +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') + +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') + +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) + 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.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) + +class MetricsTree: + """Metrics tree node.""" + + 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) + self.constants: MetricsTree_Constants = MetricsTree_Constants(client) + self.distribution: MetricsTree_Distribution = MetricsTree_Distribution(client) + self.indexes: MetricsTree_Indexes = MetricsTree_Indexes(client) + self.inputs: MetricsTree_Inputs = MetricsTree_Inputs(client) + self.market: MetricsTree_Market = MetricsTree_Market(client) + self.outputs: MetricsTree_Outputs = MetricsTree_Outputs(client) + self.pools: MetricsTree_Pools = MetricsTree_Pools(client) + self.positions: MetricsTree_Positions = MetricsTree_Positions(client) + self.price: MetricsTree_Price = MetricsTree_Price(client) + self.scripts: MetricsTree_Scripts = MetricsTree_Scripts(client) + self.supply: MetricsTree_Supply = MetricsTree_Supply(client) + self.transactions: MetricsTree_Transactions = MetricsTree_Transactions(client) class BrkClient(BrkClientBase): - """Main BRK client with catalog tree and API methods.""" + """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.tree = CatalogTree(self) + 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(f"/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]: + 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.""" 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) - return self.get(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_txs_chain(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.""" 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) - return self.get( - 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]: """Address mempool transactions. Get unconfirmed transaction IDs for an address from the mempool (up to 50).""" - return self.get(f"/api/address/{address}/txs/mempool") + return self.get_json(f'/api/address/{address}/txs/mempool') def get_address_utxo(self, address: Address) -> List[Utxo]: """Address UTXOs. Get unspent transaction outputs for an address.""" - return self.get(f"/api/address/{address}/utxo") + return self.get_json(f'/api/address/{address}/utxo') def get_block_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(f"/api/block-height/{height}") + return self.get_json(f'/api/block-height/{height}') def get_block_by_hash(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(f"/api/block/{hash}") + return self.get_json(f'/api/block/{hash}') def get_block_by_hash_raw(self, hash: BlockHash) -> List[float]: """Raw block. Returns the raw block data in binary format.""" - return self.get(f"/api/block/{hash}/raw") + return self.get_json(f'/api/block/{hash}/raw') def get_block_by_hash_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(f"/api/block/{hash}/status") + return self.get_json(f'/api/block/{hash}/status') def get_block_by_hash_txid_by_index(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(f"/api/block/{hash}/txid/{index}") + return self.get_json(f'/api/block/{hash}/txid/{index}') def get_block_by_hash_txids(self, hash: BlockHash) -> List[Txid]: """Block transaction IDs. Retrieve all transaction IDs in a block by block hash.""" - return self.get(f"/api/block/{hash}/txids") + return self.get_json(f'/api/block/{hash}/txids') - def get_block_by_hash_txs_by_start_index( - self, hash: BlockHash, start_index: TxIndex - ) -> List[Transaction]: + def get_block_by_hash_txs_by_start_index(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(f"/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("/api/blocks") + return self.get_json('/api/blocks') def get_blocks_by_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(f"/api/blocks/{height}") + return self.get_json(f'/api/blocks/{height}') def get_mempool_info(self) -> MempoolInfo: """Mempool statistics. Get current mempool statistics including transaction count, total vsize, and total fees.""" - return self.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("/api/mempool/txids") + return self.get_json('/api/mempool/txids') def get_metric(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(f"/api/metric/{metric}") + return self.get_json(f'/api/metric/{metric}') - def get_metric_by_index( - self, - index: Index, - metric: Metric, - count: Optional[Any] = None, - format: Optional[Format] = None, - from_: Optional[Any] = None, - to: Optional[Any] = None, - ) -> AnyMetricData: + def get_metric_by_index(self, metric: Metric, index: Index, start: Optional[float] = None, end: Optional[float] = None, count: Optional[float] = 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).""" params = [] - if count is not None: - params.append(f"count={count}") - if format is not None: - params.append(f"format={format}") - if from_ is not None: - params.append(f"from={from_}") - if to is not None: - params.append(f"to={to}") - query = "&".join(params) - return self.get(f"/api/metric/{metric}/{index}{'?' + query if query else ''}") + if start is not None: params.append(f'start={start}') + if end is not None: params.append(f'end={end}') + if count is not None: params.append(f'count={count}') + 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_bulk( - self, - index: Index, - metrics: Metrics, - count: Optional[Any] = None, - format: Optional[Format] = None, - from_: Optional[Any] = None, - to: Optional[Any] = None, - ) -> List[AnyMetricData]: + def get_metrics(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') + + def get_metrics_bulk(self, metrics: Metrics, index: Index, start: Optional[float] = None, end: Optional[float] = None, count: Optional[float] = 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.""" params = [] - if count is not None: - params.append(f"count={count}") - if format is not None: - params.append(f"format={format}") - if from_ is not None: - params.append(f"from={from_}") - params.append(f"index={index}") - params.append(f"metrics={metrics}") - if to is not None: - params.append(f"to={to}") - query = "&".join(params) - return self.get(f"/api/metrics/bulk{'?' + query if query else ''}") - - def get_metrics_catalog(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("/api/metrics/catalog") + 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 count is not None: params.append(f'count={count}') + 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("/api/metrics/count") + return self.get_json('/api/metrics/count') def get_metrics_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("/api/metrics/indexes") + return self.get_json('/api/metrics/indexes') - def get_metrics_list(self, page: Optional[Any] = None) -> PaginatedMetrics: + def get_metrics_list(self, page: Optional[float] = None) -> PaginatedMetrics: """Metrics list. Paginated list of available metrics""" params = [] - if page is not None: - params.append(f"page={page}") - query = "&".join(params) - return self.get(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 get_metrics_search_by_metric(self, metric: Metric, limit: Optional[Limit] = None) -> List[Metric]: """Search metrics. Fuzzy search for metrics by name. Supports partial matches and typos.""" params = [] - if limit is not None: - params.append(f"limit={limit}") - query = "&".join(params) - return self.get(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: """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(f"/api/tx/{txid}") + return self.get_json(f'/api/tx/{txid}') def get_tx_by_txid_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(f"/api/tx/{txid}/hex") + return self.get_json(f'/api/tx/{txid}/hex') def get_tx_by_txid_outspend_by_vout(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(f"/api/tx/{txid}/outspend/{vout}") + return self.get_json(f'/api/tx/{txid}/outspend/{vout}') def get_tx_by_txid_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(f"/api/tx/{txid}/outspends") + return self.get_json(f'/api/tx/{txid}/outspends') def get_tx_by_txid_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(f"/api/tx/{txid}/status") + return self.get_json(f'/api/tx/{txid}/status') def get_v1_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("/api/v1/difficulty-adjustment") + return self.get_json('/api/v1/difficulty-adjustment') def get_v1_fees_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("/api/v1/fees/mempool-blocks") + return self.get_json('/api/v1/fees/mempool-blocks') def get_v1_fees_recommended(self) -> RecommendedFees: """Recommended fees. Get recommended fee rates for different confirmation targets based on current mempool state.""" - return self.get("/api/v1/fees/recommended") + return self.get_json('/api/v1/fees/recommended') - def get_v1_mining_blocks_fees_by_time_period( - self, time_period: TimePeriod - ) -> List[BlockFeesEntry]: + def get_v1_mining_blocks_fees_by_time_period(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(f"/api/v1/mining/blocks/fees/{time_period}") + return self.get_json(f'/api/v1/mining/blocks/fees/{time_period}') - def get_v1_mining_blocks_rewards_by_time_period( - self, time_period: TimePeriod - ) -> List[BlockRewardsEntry]: + def get_v1_mining_blocks_rewards_by_time_period(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(f"/api/v1/mining/blocks/rewards/{time_period}") + return self.get_json(f'/api/v1/mining/blocks/rewards/{time_period}') - def get_v1_mining_blocks_sizes_weights_by_time_period( - self, time_period: TimePeriod - ) -> BlockSizesWeights: + def get_v1_mining_blocks_sizes_weights_by_time_period(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(f"/api/v1/mining/blocks/sizes-weights/{time_period}") + return self.get_json(f'/api/v1/mining/blocks/sizes-weights/{time_period}') def get_v1_mining_blocks_timestamp(self, timestamp: Timestamp) -> BlockTimestamp: """Block by timestamp. Find the block closest to a given UNIX timestamp.""" - return self.get(f"/api/v1/mining/blocks/timestamp/{timestamp}") + return self.get_json(f'/api/v1/mining/blocks/timestamp/{timestamp}') def get_v1_mining_difficulty_adjustments(self) -> List[DifficultyAdjustmentEntry]: """Difficulty adjustments (all time). Get historical difficulty adjustments. Returns array of [timestamp, height, difficulty, change_percent].""" - return self.get("/api/v1/mining/difficulty-adjustments") + return self.get_json('/api/v1/mining/difficulty-adjustments') - def get_v1_mining_difficulty_adjustments_by_time_period( - self, time_period: TimePeriod - ) -> List[DifficultyAdjustmentEntry]: + def get_v1_mining_difficulty_adjustments_by_time_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(f"/api/v1/mining/difficulty-adjustments/{time_period}") + return self.get_json(f'/api/v1/mining/difficulty-adjustments/{time_period}') def get_v1_mining_hashrate(self) -> HashrateSummary: """Network hashrate (all time). Get network hashrate and difficulty data for all time.""" - return self.get("/api/v1/mining/hashrate") + return self.get_json('/api/v1/mining/hashrate') - def get_v1_mining_hashrate_by_time_period( - self, time_period: TimePeriod - ) -> HashrateSummary: + def get_v1_mining_hashrate_by_time_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(f"/api/v1/mining/hashrate/{time_period}") + return self.get_json(f'/api/v1/mining/hashrate/{time_period}') def get_v1_mining_pool_by_slug(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(f"/api/v1/mining/pool/{slug}") + return self.get_json(f'/api/v1/mining/pool/{slug}') def get_v1_mining_pools(self) -> List[PoolInfo]: """List all mining pools. Get list of all known mining pools with their identifiers.""" - return self.get("/api/v1/mining/pools") + return self.get_json('/api/v1/mining/pools') - def get_v1_mining_pools_by_time_period( - self, time_period: TimePeriod - ) -> PoolsSummary: + def get_v1_mining_pools_by_time_period(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(f"/api/v1/mining/pools/{time_period}") + return self.get_json(f'/api/v1/mining/pools/{time_period}') - def get_v1_mining_reward_stats_by_block_count( - self, block_count: float - ) -> RewardStats: + def get_v1_mining_reward_stats_by_block_count(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(f"/api/v1/mining/reward-stats/{block_count}") + return self.get_json(f'/api/v1/mining/reward-stats/{block_count}') def get_v1_validate_address(self, address: str) -> AddressValidation: """Validate address. Validate a Bitcoin address and get information about its type and scriptPubKey.""" - return self.get(f"/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("/health") + return self.get_json('/health') def get_version(self) -> str: """API version. Returns the current version of the API server""" - return self.get("/version") + return self.get_json('/version') + diff --git a/packages/brk_client/pyproject.toml b/packages/brk_client/pyproject.toml index 5895c2b39..4dbb17ff2 100644 --- a/packages/brk_client/pyproject.toml +++ b/packages/brk_client/pyproject.toml @@ -16,7 +16,6 @@ classifiers = [ "Programming Language :: Python :: 3.13", "Typing :: Typed", ] -dependencies = ["httpx>=0.25.0"] [project.urls] Homepage = "https://bitcoinresearchkit.org" @@ -24,7 +23,6 @@ Repository = "https://github.com/bitcoinresearchkit/brk" [dependency-groups] dev = [ - "lazydocs>=0.4.8", "pydoc-markdown>=4.8.2", "pytest", ] diff --git a/packages/brk_client/scripts/publish.sh b/packages/brk_client/scripts/publish.sh index 7e1ccd99b..e4bb6f2c9 100755 --- a/packages/brk_client/scripts/publish.sh +++ b/packages/brk_client/scripts/publish.sh @@ -1,3 +1,4 @@ +uv run pytest tests/basic.py -s uvx pydoc-markdown > DOCS.md uv build uvx uv-publish diff --git a/packages/brk_client/tests/basic.py b/packages/brk_client/tests/basic.py index 84e7e032d..1ab8a5e0f 100644 --- a/packages/brk_client/tests/basic.py +++ b/packages/brk_client/tests/basic.py @@ -1,18 +1,20 @@ +# Run: +# uv run pytest tests/basic.py -s + from __future__ import print_function from brk_client import BrkClient def test_client_creation(): - client = BrkClient("http://localhost:3110") - assert client.base_url == "http://localhost:3110" + BrkClient("http://localhost:3110") def test_tree_exists(): client = BrkClient("http://localhost:3110") - assert hasattr(client, "tree") - assert hasattr(client.tree, "price") - assert hasattr(client.tree, "blocks") + assert hasattr(client, "metrics") + assert hasattr(client.metrics, "price") + assert hasattr(client.metrics, "blocks") def test_fetch_block(): @@ -20,28 +22,35 @@ def test_fetch_block(): print(client.get_block_height(800000)) -def test_fetch_any_metric(): +def test_fetch_json_metric(): client = BrkClient("http://localhost:3110") - print(client.get_metric_by_index("dateindex", "price_close")) + a = client.get_metric_by_index("price_close", "dateindex") + print(a) + + +def test_fetch_csv_metric(): + client = BrkClient("http://localhost:3110") + a = client.get_metric_by_index("price_close", "dateindex", -10, None, None, "csv") + print(a) def test_fetch_typed_metric(): client = BrkClient("http://localhost:3110") - a = client.tree.constants.constant_0.by.dateindex().range(-10) + a = client.metrics.constants.constant_0.by.dateindex().range(-10) print(a) - b = client.tree.outputs.count.utxo_count.by.height().range(-10) + b = client.metrics.outputs.count.utxo_count.by.height().range(-10) print(b) - c = client.tree.price.usd.split.close.by.dateindex().range(-10) + c = client.metrics.price.usd.split.close.by.dateindex().range(-10) print(c) - d = client.tree.market.dca.period_lump_sum_stack._10y.dollars.by.dateindex().range( + d = client.metrics.market.dca.period_lump_sum_stack._10y.dollars.by.dateindex().range( -10 ) print(d) - e = client.tree.market.dca.class_average_price._2017.by.dateindex().range(-10) + e = client.metrics.market.dca.class_average_price._2017.by.dateindex().range(-10) print(e) - f = client.tree.distribution.address_cohorts.amount_range._10k_sats_to_100k_sats.activity.sent.dollars.cumulative.by.dateindex().range( + f = client.metrics.distribution.address_cohorts.amount_range._10k_sats_to_100k_sats.activity.sent.dollars.cumulative.by.dateindex().range( -10 ) print(f) - g = client.tree.price.usd.ohlc.by.dateindex().range(-10) + g = client.metrics.price.usd.ohlc.by.dateindex().range(-10) print(g) diff --git a/packages/brk_client/uv.lock b/packages/brk_client/uv.lock index 1647576b3..e2e87ba6a 100644 --- a/packages/brk_client/uv.lock +++ b/packages/brk_client/uv.lock @@ -1,19 +1,6 @@ version = 1 revision = 3 -requires-python = ">=3.12" - -[[package]] -name = "anyio" -version = "4.12.0" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "idna" }, - { name = "typing-extensions", marker = "python_full_version < '3.13'" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/16/ce/8a777047513153587e5434fd752e89334ac33e379aa3497db860eeb60377/anyio-4.12.0.tar.gz", hash = "sha256:73c693b567b0c55130c104d0b43a9baf3aa6a31fc6110116509f27bf75e21ec0", size = 228266, upload-time = "2025-11-28T23:37:38.911Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/7f/9c/36c5c37947ebfb8c7f22e0eb6e4d188ee2d53aa3880f3f2744fb894f0cb1/anyio-4.12.0-py3-none-any.whl", hash = "sha256:dad2376a628f98eeca4881fc56cd06affd18f659b17a747d3ff0307ced94b1bb", size = 113362, upload-time = "2025-11-28T23:36:57.897Z" }, -] +requires-python = ">=3.11" [[package]] name = "black" @@ -28,6 +15,10 @@ dependencies = [ ] sdist = { url = "https://files.pythonhosted.org/packages/fd/f4/a57cde4b60da0e249073009f4a9087e9e0a955deae78d3c2a493208d0c5c/black-23.12.1.tar.gz", hash = "sha256:4ce3ef14ebe8d9509188014d96af1c456a910d5b5cbf434a09fef7e024b3d0d5", size = 620809, upload-time = "2023-12-22T23:06:17.382Z" } wheels = [ + { url = "https://files.pythonhosted.org/packages/ed/2c/d9b1a77101e6e5f294f6553d76c39322122bfea2a438aeea4eb6d4b22749/black-23.12.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:8d4df77958a622f9b5a4c96edb4b8c0034f8434032ab11077ec6c56ae9f384ba", size = 1541926, upload-time = "2023-12-22T23:23:17.72Z" }, + { url = "https://files.pythonhosted.org/packages/72/e2/d981a3ff05ba9abe3cfa33e70c986facb0614fd57c4f802ef435f4dd1697/black-23.12.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:602cfb1196dc692424c70b6507593a2b29aac0547c1be9a1d1365f0d964c353b", size = 1388465, upload-time = "2023-12-22T23:19:00.611Z" }, + { url = "https://files.pythonhosted.org/packages/eb/59/1f5c8eb7bba8a8b1bb5c87f097d16410c93a48a6655be3773db5d2783deb/black-23.12.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9c4352800f14be5b4864016882cdba10755bd50805c95f728011bcb47a4afd59", size = 1691993, upload-time = "2023-12-22T23:08:32.018Z" }, + { url = "https://files.pythonhosted.org/packages/37/bf/a80abc6fcdb00f0d4d3d74184b172adbf2197f6b002913fa0fb6af4dc6db/black-23.12.1-cp311-cp311-win_amd64.whl", hash = "sha256:0808494f2b2df923ffc5723ed3c7b096bd76341f6213989759287611e9837d50", size = 1340929, upload-time = "2023-12-22T23:09:37.088Z" }, { url = "https://files.pythonhosted.org/packages/66/16/8726cedc83be841dfa854bbeef1288ee82272282a71048d7935292182b0b/black-23.12.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:25e57fd232a6d6ff3f4478a6fd0580838e47c93c83eaf1ccc92d4faf27112c4e", size = 1569989, upload-time = "2023-12-22T23:20:22.158Z" }, { url = "https://files.pythonhosted.org/packages/d2/1e/30f5eafcc41b8378890ba39b693fa111f7dca8a2620ba5162075d95ffe46/black-23.12.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:2d9e13db441c509a3763a7a3d9a49ccc1b4e974a47be4e08ade2a228876500ec", size = 1398647, upload-time = "2023-12-22T23:19:57.225Z" }, { url = "https://files.pythonhosted.org/packages/99/de/ddb45cc044256431d96d846ce03164d149d81ca606b5172224d1872e0b58/black-23.12.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6d1bd9c210f8b109b1762ec9fd36592fdd528485aadb3f5849b2740ef17e674e", size = 1720450, upload-time = "2023-12-22T23:08:52.675Z" }, @@ -39,23 +30,17 @@ wheels = [ name = "brk-client" version = "0.1.0a2" source = { editable = "." } -dependencies = [ - { name = "httpx" }, -] [package.dev-dependencies] dev = [ - { name = "lazydocs" }, { name = "pydoc-markdown" }, { name = "pytest" }, ] [package.metadata] -requires-dist = [{ name = "httpx", specifier = ">=0.25.0" }] [package.metadata.requires-dev] dev = [ - { name = "lazydocs", specifier = ">=0.4.8" }, { name = "pydoc-markdown", specifier = ">=4.8.2" }, { name = "pytest" }, ] @@ -75,6 +60,22 @@ version = "3.4.4" source = { registry = "https://pypi.org/simple" } sdist = { url = "https://files.pythonhosted.org/packages/13/69/33ddede1939fdd074bce5434295f38fae7136463422fe4fd3e0e89b98062/charset_normalizer-3.4.4.tar.gz", hash = "sha256:94537985111c35f28720e43603b8e7b43a6ecfb2ce1d3058bbe955b73404e21a", size = 129418, upload-time = "2025-10-14T04:42:32.879Z" } wheels = [ + { url = "https://files.pythonhosted.org/packages/ed/27/c6491ff4954e58a10f69ad90aca8a1b6fe9c5d3c6f380907af3c37435b59/charset_normalizer-3.4.4-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:6e1fcf0720908f200cd21aa4e6750a48ff6ce4afe7ff5a79a90d5ed8a08296f8", size = 206988, upload-time = "2025-10-14T04:40:33.79Z" }, + { url = "https://files.pythonhosted.org/packages/94/59/2e87300fe67ab820b5428580a53cad894272dbb97f38a7a814a2a1ac1011/charset_normalizer-3.4.4-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5f819d5fe9234f9f82d75bdfa9aef3a3d72c4d24a6e57aeaebba32a704553aa0", size = 147324, upload-time = "2025-10-14T04:40:34.961Z" }, + { url = "https://files.pythonhosted.org/packages/07/fb/0cf61dc84b2b088391830f6274cb57c82e4da8bbc2efeac8c025edb88772/charset_normalizer-3.4.4-cp311-cp311-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:a59cb51917aa591b1c4e6a43c132f0cdc3c76dbad6155df4e28ee626cc77a0a3", size = 142742, upload-time = "2025-10-14T04:40:36.105Z" }, + { url = "https://files.pythonhosted.org/packages/62/8b/171935adf2312cd745d290ed93cf16cf0dfe320863ab7cbeeae1dcd6535f/charset_normalizer-3.4.4-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:8ef3c867360f88ac904fd3f5e1f902f13307af9052646963ee08ff4f131adafc", size = 160863, upload-time = "2025-10-14T04:40:37.188Z" }, + { url = "https://files.pythonhosted.org/packages/09/73/ad875b192bda14f2173bfc1bc9a55e009808484a4b256748d931b6948442/charset_normalizer-3.4.4-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:d9e45d7faa48ee908174d8fe84854479ef838fc6a705c9315372eacbc2f02897", size = 157837, upload-time = "2025-10-14T04:40:38.435Z" }, + { url = "https://files.pythonhosted.org/packages/6d/fc/de9cce525b2c5b94b47c70a4b4fb19f871b24995c728e957ee68ab1671ea/charset_normalizer-3.4.4-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:840c25fb618a231545cbab0564a799f101b63b9901f2569faecd6b222ac72381", size = 151550, upload-time = "2025-10-14T04:40:40.053Z" }, + { url = "https://files.pythonhosted.org/packages/55/c2/43edd615fdfba8c6f2dfbd459b25a6b3b551f24ea21981e23fb768503ce1/charset_normalizer-3.4.4-cp311-cp311-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:ca5862d5b3928c4940729dacc329aa9102900382fea192fc5e52eb69d6093815", size = 149162, upload-time = "2025-10-14T04:40:41.163Z" }, + { url = "https://files.pythonhosted.org/packages/03/86/bde4ad8b4d0e9429a4e82c1e8f5c659993a9a863ad62c7df05cf7b678d75/charset_normalizer-3.4.4-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:d9c7f57c3d666a53421049053eaacdd14bbd0a528e2186fcb2e672effd053bb0", size = 150019, upload-time = "2025-10-14T04:40:42.276Z" }, + { url = "https://files.pythonhosted.org/packages/1f/86/a151eb2af293a7e7bac3a739b81072585ce36ccfb4493039f49f1d3cae8c/charset_normalizer-3.4.4-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:277e970e750505ed74c832b4bf75dac7476262ee2a013f5574dd49075879e161", size = 143310, upload-time = "2025-10-14T04:40:43.439Z" }, + { url = "https://files.pythonhosted.org/packages/b5/fe/43dae6144a7e07b87478fdfc4dbe9efd5defb0e7ec29f5f58a55aeef7bf7/charset_normalizer-3.4.4-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:31fd66405eaf47bb62e8cd575dc621c56c668f27d46a61d975a249930dd5e2a4", size = 162022, upload-time = "2025-10-14T04:40:44.547Z" }, + { url = "https://files.pythonhosted.org/packages/80/e6/7aab83774f5d2bca81f42ac58d04caf44f0cc2b65fc6db2b3b2e8a05f3b3/charset_normalizer-3.4.4-cp311-cp311-musllinux_1_2_riscv64.whl", hash = "sha256:0d3d8f15c07f86e9ff82319b3d9ef6f4bf907608f53fe9d92b28ea9ae3d1fd89", size = 149383, upload-time = "2025-10-14T04:40:46.018Z" }, + { url = "https://files.pythonhosted.org/packages/4f/e8/b289173b4edae05c0dde07f69f8db476a0b511eac556dfe0d6bda3c43384/charset_normalizer-3.4.4-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:9f7fcd74d410a36883701fafa2482a6af2ff5ba96b9a620e9e0721e28ead5569", size = 159098, upload-time = "2025-10-14T04:40:47.081Z" }, + { url = "https://files.pythonhosted.org/packages/d8/df/fe699727754cae3f8478493c7f45f777b17c3ef0600e28abfec8619eb49c/charset_normalizer-3.4.4-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:ebf3e58c7ec8a8bed6d66a75d7fb37b55e5015b03ceae72a8e7c74495551e224", size = 152991, upload-time = "2025-10-14T04:40:48.246Z" }, + { url = "https://files.pythonhosted.org/packages/1a/86/584869fe4ddb6ffa3bd9f491b87a01568797fb9bd8933f557dba9771beaf/charset_normalizer-3.4.4-cp311-cp311-win32.whl", hash = "sha256:eecbc200c7fd5ddb9a7f16c7decb07b566c29fa2161a16cf67b8d068bd21690a", size = 99456, upload-time = "2025-10-14T04:40:49.376Z" }, + { url = "https://files.pythonhosted.org/packages/65/f6/62fdd5feb60530f50f7e38b4f6a1d5203f4d16ff4f9f0952962c044e919a/charset_normalizer-3.4.4-cp311-cp311-win_amd64.whl", hash = "sha256:5ae497466c7901d54b639cf42d5b8c1b6a4fead55215500d2f486d34db48d016", size = 106978, upload-time = "2025-10-14T04:40:50.844Z" }, + { url = "https://files.pythonhosted.org/packages/7a/9d/0710916e6c82948b3be62d9d398cb4fcf4e97b56d6a6aeccd66c4b2f2bd5/charset_normalizer-3.4.4-cp311-cp311-win_arm64.whl", hash = "sha256:65e2befcd84bc6f37095f5961e68a6f077bf44946771354a28ad434c2cce0ae1", size = 99969, upload-time = "2025-10-14T04:40:52.272Z" }, { url = "https://files.pythonhosted.org/packages/f3/85/1637cd4af66fa687396e757dec650f28025f2a2f5a5531a3208dc0ec43f2/charset_normalizer-3.4.4-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:0a98e6759f854bd25a58a73fa88833fba3b7c491169f86ce1180c948ab3fd394", size = 208425, upload-time = "2025-10-14T04:40:53.353Z" }, { url = "https://files.pythonhosted.org/packages/9d/6a/04130023fef2a0d9c62d0bae2649b69f7b7d8d24ea5536feef50551029df/charset_normalizer-3.4.4-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:b5b290ccc2a263e8d185130284f8501e3e36c5e02750fc6b6bdeb2e9e96f1e25", size = 148162, upload-time = "2025-10-14T04:40:54.558Z" }, { url = "https://files.pythonhosted.org/packages/78/29/62328d79aa60da22c9e0b9a66539feae06ca0f5a4171ac4f7dc285b83688/charset_normalizer-3.4.4-cp312-cp312-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:74bb723680f9f7a6234dcf67aea57e708ec1fbdf5699fb91dfd6f511b0a320ef", size = 144558, upload-time = "2025-10-14T04:40:55.677Z" }, @@ -233,43 +234,6 @@ version = "0.11" source = { registry = "https://pypi.org/simple" } sdist = { url = "https://files.pythonhosted.org/packages/a2/ce/5d6a3782b9f88097ce3e579265015db3372ae78d12f67629b863a9208c96/docstring_parser-0.11.tar.gz", hash = "sha256:93b3f8f481c7d24e37c5d9f30293c89e2933fa209421c8abd731dd3ef0715ecb", size = 22775, upload-time = "2021-09-30T07:44:10.288Z" } -[[package]] -name = "h11" -version = "0.16.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/01/ee/02a2c011bdab74c6fb3c75474d40b3052059d95df7e73351460c8588d963/h11-0.16.0.tar.gz", hash = "sha256:4e35b956cf45792e4caa5885e69fba00bdbc6ffafbfa020300e549b208ee5ff1", size = 101250, upload-time = "2025-04-24T03:35:25.427Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/04/4b/29cac41a4d98d144bf5f6d33995617b185d14b22401f75ca86f384e87ff1/h11-0.16.0-py3-none-any.whl", hash = "sha256:63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86", size = 37515, upload-time = "2025-04-24T03:35:24.344Z" }, -] - -[[package]] -name = "httpcore" -version = "1.0.9" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "certifi" }, - { name = "h11" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/06/94/82699a10bca87a5556c9c59b5963f2d039dbd239f25bc2a63907a05a14cb/httpcore-1.0.9.tar.gz", hash = "sha256:6e34463af53fd2ab5d807f399a9b45ea31c3dfa2276f15a2c3f00afff6e176e8", size = 85484, upload-time = "2025-04-24T22:06:22.219Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/7e/f5/f66802a942d491edb555dd61e3a9961140fd64c90bce1eafd741609d334d/httpcore-1.0.9-py3-none-any.whl", hash = "sha256:2d400746a40668fc9dec9810239072b40b4484b640a8c38fd654a024c7a1bf55", size = 78784, upload-time = "2025-04-24T22:06:20.566Z" }, -] - -[[package]] -name = "httpx" -version = "0.28.1" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "anyio" }, - { name = "certifi" }, - { name = "httpcore" }, - { name = "idna" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/b1/df/48c586a5fe32a0f01324ee087459e112ebb7224f646c0b5023f5e79e9956/httpx-0.28.1.tar.gz", hash = "sha256:75e98c5f16b0f35b567856f597f06ff2270a374470a5c2392242528e3e3e42fc", size = 141406, upload-time = "2024-12-06T15:37:23.222Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/2a/39/e50c7c3a983047577ee07d2a9e53faf5a69493943ec3f6a384bdc792deb2/httpx-0.28.1-py3-none-any.whl", hash = "sha256:d909fcccc110f8c7faf814ca82a9a4d816bc5a6dbfea25d6591d6985b8ba59ad", size = 73517, upload-time = "2024-12-06T15:37:21.509Z" }, -] - [[package]] name = "idna" version = "3.11" @@ -300,36 +264,23 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/62/a1/3d680cbfd5f4b8f15abc1d571870c5fc3e594bb582bc3b64ea099db13e56/jinja2-3.1.6-py3-none-any.whl", hash = "sha256:85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67", size = 134899, upload-time = "2025-03-05T20:05:00.369Z" }, ] -[[package]] -name = "lazydocs" -version = "0.4.8" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "typer" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/10/d2/ff630536151c8f5aaf03aebbc963f570dc9f2af0b3f35c11774e0c4c75af/lazydocs-0.4.8.tar.gz", hash = "sha256:8ac1fda05f03e0c5ae1d30b81eaeb785476efa161194a5e8bfa8630e14af9562", size = 23218, upload-time = "2021-07-27T08:05:43.759Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/96/9e/6b8b057eb511ea904a4fd6a835fee0a87ccb08edd64026e783a3ee6bb8c5/lazydocs-0.4.8-py3-none-any.whl", hash = "sha256:cebdce88c8e01ae19c63da77fc25a16abd6f7a7055930001644703643e608fed", size = 17611, upload-time = "2021-07-27T08:05:42.386Z" }, -] - -[[package]] -name = "markdown-it-py" -version = "4.0.0" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "mdurl" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/5b/f5/4ec618ed16cc4f8fb3b701563655a69816155e79e24a17b651541804721d/markdown_it_py-4.0.0.tar.gz", hash = "sha256:cb0a2b4aa34f932c007117b194e945bd74e0ec24133ceb5bac59009cda1cb9f3", size = 73070, upload-time = "2025-08-11T12:57:52.854Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/94/54/e7d793b573f298e1c9013b8c4dade17d481164aa517d1d7148619c2cedbf/markdown_it_py-4.0.0-py3-none-any.whl", hash = "sha256:87327c59b172c5011896038353a81343b6754500a08cd7a4973bb48c6d578147", size = 87321, upload-time = "2025-08-11T12:57:51.923Z" }, -] - [[package]] name = "markupsafe" version = "3.0.3" source = { registry = "https://pypi.org/simple" } sdist = { url = "https://files.pythonhosted.org/packages/7e/99/7690b6d4034fffd95959cbe0c02de8deb3098cc577c67bb6a24fe5d7caa7/markupsafe-3.0.3.tar.gz", hash = "sha256:722695808f4b6457b320fdc131280796bdceb04ab50fe1795cd540799ebe1698", size = 80313, upload-time = "2025-09-27T18:37:40.426Z" } wheels = [ + { url = "https://files.pythonhosted.org/packages/08/db/fefacb2136439fc8dd20e797950e749aa1f4997ed584c62cfb8ef7c2be0e/markupsafe-3.0.3-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:1cc7ea17a6824959616c525620e387f6dd30fec8cb44f649e31712db02123dad", size = 11631, upload-time = "2025-09-27T18:36:18.185Z" }, + { url = "https://files.pythonhosted.org/packages/e1/2e/5898933336b61975ce9dc04decbc0a7f2fee78c30353c5efba7f2d6ff27a/markupsafe-3.0.3-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:4bd4cd07944443f5a265608cc6aab442e4f74dff8088b0dfc8238647b8f6ae9a", size = 12058, upload-time = "2025-09-27T18:36:19.444Z" }, + { url = "https://files.pythonhosted.org/packages/1d/09/adf2df3699d87d1d8184038df46a9c80d78c0148492323f4693df54e17bb/markupsafe-3.0.3-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6b5420a1d9450023228968e7e6a9ce57f65d148ab56d2313fcd589eee96a7a50", size = 24287, upload-time = "2025-09-27T18:36:20.768Z" }, + { url = "https://files.pythonhosted.org/packages/30/ac/0273f6fcb5f42e314c6d8cd99effae6a5354604d461b8d392b5ec9530a54/markupsafe-3.0.3-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0bf2a864d67e76e5c9a34dc26ec616a66b9888e25e7b9460e1c76d3293bd9dbf", size = 22940, upload-time = "2025-09-27T18:36:22.249Z" }, + { url = "https://files.pythonhosted.org/packages/19/ae/31c1be199ef767124c042c6c3e904da327a2f7f0cd63a0337e1eca2967a8/markupsafe-3.0.3-cp311-cp311-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:bc51efed119bc9cfdf792cdeaa4d67e8f6fcccab66ed4bfdd6bde3e59bfcbb2f", size = 21887, upload-time = "2025-09-27T18:36:23.535Z" }, + { url = "https://files.pythonhosted.org/packages/b2/76/7edcab99d5349a4532a459e1fe64f0b0467a3365056ae550d3bcf3f79e1e/markupsafe-3.0.3-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:068f375c472b3e7acbe2d5318dea141359e6900156b5b2ba06a30b169086b91a", size = 23692, upload-time = "2025-09-27T18:36:24.823Z" }, + { url = "https://files.pythonhosted.org/packages/a4/28/6e74cdd26d7514849143d69f0bf2399f929c37dc2b31e6829fd2045b2765/markupsafe-3.0.3-cp311-cp311-musllinux_1_2_riscv64.whl", hash = "sha256:7be7b61bb172e1ed687f1754f8e7484f1c8019780f6f6b0786e76bb01c2ae115", size = 21471, upload-time = "2025-09-27T18:36:25.95Z" }, + { url = "https://files.pythonhosted.org/packages/62/7e/a145f36a5c2945673e590850a6f8014318d5577ed7e5920a4b3448e0865d/markupsafe-3.0.3-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:f9e130248f4462aaa8e2552d547f36ddadbeaa573879158d721bbd33dfe4743a", size = 22923, upload-time = "2025-09-27T18:36:27.109Z" }, + { url = "https://files.pythonhosted.org/packages/0f/62/d9c46a7f5c9adbeeeda52f5b8d802e1094e9717705a645efc71b0913a0a8/markupsafe-3.0.3-cp311-cp311-win32.whl", hash = "sha256:0db14f5dafddbb6d9208827849fad01f1a2609380add406671a26386cdf15a19", size = 14572, upload-time = "2025-09-27T18:36:28.045Z" }, + { url = "https://files.pythonhosted.org/packages/83/8a/4414c03d3f891739326e1783338e48fb49781cc915b2e0ee052aa490d586/markupsafe-3.0.3-cp311-cp311-win_amd64.whl", hash = "sha256:de8a88e63464af587c950061a5e6a67d3632e36df62b986892331d4620a35c01", size = 15077, upload-time = "2025-09-27T18:36:29.025Z" }, + { url = "https://files.pythonhosted.org/packages/35/73/893072b42e6862f319b5207adc9ae06070f095b358655f077f69a35601f0/markupsafe-3.0.3-cp311-cp311-win_arm64.whl", hash = "sha256:3b562dd9e9ea93f13d53989d23a7e775fdfd1066c33494ff43f5418bc8c58a5c", size = 13876, upload-time = "2025-09-27T18:36:29.954Z" }, { url = "https://files.pythonhosted.org/packages/5a/72/147da192e38635ada20e0a2e1a51cf8823d2119ce8883f7053879c2199b5/markupsafe-3.0.3-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:d53197da72cc091b024dd97249dfc7794d6a56530370992a5e1a08983ad9230e", size = 11615, upload-time = "2025-09-27T18:36:30.854Z" }, { url = "https://files.pythonhosted.org/packages/9a/81/7e4e08678a1f98521201c3079f77db69fb552acd56067661f8c2f534a718/markupsafe-3.0.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:1872df69a4de6aead3491198eaf13810b565bdbeec3ae2dc8780f14458ec73ce", size = 12020, upload-time = "2025-09-27T18:36:31.971Z" }, { url = "https://files.pythonhosted.org/packages/1e/2c/799f4742efc39633a1b54a92eec4082e4f815314869865d876824c257c1e/markupsafe-3.0.3-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:3a7e8ae81ae39e62a41ec302f972ba6ae23a5c5396c8e60113e9066ef893da0d", size = 24332, upload-time = "2025-09-27T18:36:32.813Z" }, @@ -387,15 +338,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/70/bc/6f1c2f612465f5fa89b95bead1f44dcb607670fd42891d8fdcd5d039f4f4/markupsafe-3.0.3-cp314-cp314t-win_arm64.whl", hash = "sha256:32001d6a8fc98c8cb5c947787c5d08b0a50663d139f1305bac5885d98d9b40fa", size = 14146, upload-time = "2025-09-27T18:37:28.327Z" }, ] -[[package]] -name = "mdurl" -version = "0.1.2" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/d6/54/cfe61301667036ec958cb99bd3efefba235e65cdeb9c84d24a8293ba1d90/mdurl-0.1.2.tar.gz", hash = "sha256:bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba", size = 8729, upload-time = "2022-08-14T12:40:10.846Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/b3/38/89ba8ad64ae25be8de66a6d463314cf1eb366222074cfda9ee839c56a4b4/mdurl-0.1.2-py3-none-any.whl", hash = "sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8", size = 9979, upload-time = "2022-08-14T12:40:09.779Z" }, -] - [[package]] name = "mypy-extensions" version = "1.1.0" @@ -528,6 +470,15 @@ version = "6.0.3" source = { registry = "https://pypi.org/simple" } sdist = { url = "https://files.pythonhosted.org/packages/05/8e/961c0007c59b8dd7729d542c61a4d537767a59645b82a0b521206e1e25c2/pyyaml-6.0.3.tar.gz", hash = "sha256:d76623373421df22fb4cf8817020cbb7ef15c725b9d5e45f17e189bfc384190f", size = 130960, upload-time = "2025-09-25T21:33:16.546Z" } wheels = [ + { url = "https://files.pythonhosted.org/packages/6d/16/a95b6757765b7b031c9374925bb718d55e0a9ba8a1b6a12d25962ea44347/pyyaml-6.0.3-cp311-cp311-macosx_10_13_x86_64.whl", hash = "sha256:44edc647873928551a01e7a563d7452ccdebee747728c1080d881d68af7b997e", size = 185826, upload-time = "2025-09-25T21:31:58.655Z" }, + { url = "https://files.pythonhosted.org/packages/16/19/13de8e4377ed53079ee996e1ab0a9c33ec2faf808a4647b7b4c0d46dd239/pyyaml-6.0.3-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:652cb6edd41e718550aad172851962662ff2681490a8a711af6a4d288dd96824", size = 175577, upload-time = "2025-09-25T21:32:00.088Z" }, + { url = "https://files.pythonhosted.org/packages/0c/62/d2eb46264d4b157dae1275b573017abec435397aa59cbcdab6fc978a8af4/pyyaml-6.0.3-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:10892704fc220243f5305762e276552a0395f7beb4dbf9b14ec8fd43b57f126c", size = 775556, upload-time = "2025-09-25T21:32:01.31Z" }, + { url = "https://files.pythonhosted.org/packages/10/cb/16c3f2cf3266edd25aaa00d6c4350381c8b012ed6f5276675b9eba8d9ff4/pyyaml-6.0.3-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:850774a7879607d3a6f50d36d04f00ee69e7fc816450e5f7e58d7f17f1ae5c00", size = 882114, upload-time = "2025-09-25T21:32:03.376Z" }, + { url = "https://files.pythonhosted.org/packages/71/60/917329f640924b18ff085ab889a11c763e0b573da888e8404ff486657602/pyyaml-6.0.3-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b8bb0864c5a28024fac8a632c443c87c5aa6f215c0b126c449ae1a150412f31d", size = 806638, upload-time = "2025-09-25T21:32:04.553Z" }, + { url = "https://files.pythonhosted.org/packages/dd/6f/529b0f316a9fd167281a6c3826b5583e6192dba792dd55e3203d3f8e655a/pyyaml-6.0.3-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:1d37d57ad971609cf3c53ba6a7e365e40660e3be0e5175fa9f2365a379d6095a", size = 767463, upload-time = "2025-09-25T21:32:06.152Z" }, + { url = "https://files.pythonhosted.org/packages/f2/6a/b627b4e0c1dd03718543519ffb2f1deea4a1e6d42fbab8021936a4d22589/pyyaml-6.0.3-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:37503bfbfc9d2c40b344d06b2199cf0e96e97957ab1c1b546fd4f87e53e5d3e4", size = 794986, upload-time = "2025-09-25T21:32:07.367Z" }, + { url = "https://files.pythonhosted.org/packages/45/91/47a6e1c42d9ee337c4839208f30d9f09caa9f720ec7582917b264defc875/pyyaml-6.0.3-cp311-cp311-win32.whl", hash = "sha256:8098f252adfa6c80ab48096053f512f2321f0b998f98150cea9bd23d83e1467b", size = 142543, upload-time = "2025-09-25T21:32:08.95Z" }, + { url = "https://files.pythonhosted.org/packages/da/e3/ea007450a105ae919a72393cb06f122f288ef60bba2dc64b26e2646fa315/pyyaml-6.0.3-cp311-cp311-win_amd64.whl", hash = "sha256:9f3bfb4965eb874431221a3ff3fdcddc7e74e3b07799e0e84ca4a0f867d449bf", size = 158763, upload-time = "2025-09-25T21:32:09.96Z" }, { url = "https://files.pythonhosted.org/packages/d1/33/422b98d2195232ca1826284a76852ad5a86fe23e31b009c9886b2d0fb8b2/pyyaml-6.0.3-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:7f047e29dcae44602496db43be01ad42fc6f1cc0d8cd6c83d342306c32270196", size = 182063, upload-time = "2025-09-25T21:32:11.445Z" }, { url = "https://files.pythonhosted.org/packages/89/a0/6cf41a19a1f2f3feab0e9c0b74134aa2ce6849093d5517a0c550fe37a648/pyyaml-6.0.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:fc09d0aa354569bc501d4e787133afc08552722d3ab34836a80547331bb5d4a0", size = 173973, upload-time = "2025-09-25T21:32:12.492Z" }, { url = "https://files.pythonhosted.org/packages/ed/23/7a778b6bd0b9a8039df8b1b1d80e2e2ad78aa04171592c8a5c43a56a6af4/pyyaml-6.0.3-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:9149cad251584d5fb4981be1ecde53a1ca46c891a79788c0df828d2f166bda28", size = 775116, upload-time = "2025-09-25T21:32:13.652Z" }, @@ -583,34 +534,21 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/1e/db/4254e3eabe8020b458f1a747140d32277ec7a271daf1d235b70dc0b4e6e3/requests-2.32.5-py3-none-any.whl", hash = "sha256:2462f94637a34fd532264295e186976db0f5d453d1cdd31473c85a6a161affb6", size = 64738, upload-time = "2025-08-18T20:46:00.542Z" }, ] -[[package]] -name = "rich" -version = "14.2.0" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "markdown-it-py" }, - { name = "pygments" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/fb/d2/8920e102050a0de7bfabeb4c4614a49248cf8d5d7a8d01885fbb24dc767a/rich-14.2.0.tar.gz", hash = "sha256:73ff50c7c0c1c77c8243079283f4edb376f0f6442433aecb8ce7e6d0b92d1fe4", size = 219990, upload-time = "2025-10-09T14:16:53.064Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/25/7a/b0178788f8dc6cafce37a212c99565fa1fe7872c70c6c9c1e1a372d9d88f/rich-14.2.0-py3-none-any.whl", hash = "sha256:76bc51fe2e57d2b1be1f96c524b890b816e334ab4c1e45888799bfaab0021edd", size = 243393, upload-time = "2025-10-09T14:16:51.245Z" }, -] - -[[package]] -name = "shellingham" -version = "1.5.4" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/58/15/8b3609fd3830ef7b27b655beb4b4e9c62313a4e8da8c676e142cc210d58e/shellingham-1.5.4.tar.gz", hash = "sha256:8dbca0739d487e5bd35ab3ca4b36e11c4078f3a234bfce294b0a0291363404de", size = 10310, upload-time = "2023-10-24T04:13:40.426Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/e0/f9/0595336914c5619e5f28a1fb793285925a8cd4b432c9da0a987836c7f822/shellingham-1.5.4-py2.py3-none-any.whl", hash = "sha256:7ecfff8f2fd72616f7481040475a65b2bf8af90a56c89140852d1120324e8686", size = 9755, upload-time = "2023-10-24T04:13:38.866Z" }, -] - [[package]] name = "tomli" version = "2.4.0" source = { registry = "https://pypi.org/simple" } sdist = { url = "https://files.pythonhosted.org/packages/82/30/31573e9457673ab10aa432461bee537ce6cef177667deca369efb79df071/tomli-2.4.0.tar.gz", hash = "sha256:aa89c3f6c277dd275d8e243ad24f3b5e701491a860d5121f2cdd399fbb31fc9c", size = 17477, upload-time = "2026-01-11T11:22:38.165Z" } wheels = [ + { url = "https://files.pythonhosted.org/packages/3c/d9/3dc2289e1f3b32eb19b9785b6a006b28ee99acb37d1d47f78d4c10e28bf8/tomli-2.4.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:b5ef256a3fd497d4973c11bf142e9ed78b150d36f5773f1ca6088c230ffc5867", size = 153663, upload-time = "2026-01-11T11:21:45.27Z" }, + { url = "https://files.pythonhosted.org/packages/51/32/ef9f6845e6b9ca392cd3f64f9ec185cc6f09f0a2df3db08cbe8809d1d435/tomli-2.4.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:5572e41282d5268eb09a697c89a7bee84fae66511f87533a6f88bd2f7b652da9", size = 148469, upload-time = "2026-01-11T11:21:46.873Z" }, + { url = "https://files.pythonhosted.org/packages/d6/c2/506e44cce89a8b1b1e047d64bd495c22c9f71f21e05f380f1a950dd9c217/tomli-2.4.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:551e321c6ba03b55676970b47cb1b73f14a0a4dce6a3e1a9458fd6d921d72e95", size = 236039, upload-time = "2026-01-11T11:21:48.503Z" }, + { url = "https://files.pythonhosted.org/packages/b3/40/e1b65986dbc861b7e986e8ec394598187fa8aee85b1650b01dd925ca0be8/tomli-2.4.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:5e3f639a7a8f10069d0e15408c0b96a2a828cfdec6fca05296ebcdcc28ca7c76", size = 243007, upload-time = "2026-01-11T11:21:49.456Z" }, + { url = "https://files.pythonhosted.org/packages/9c/6f/6e39ce66b58a5b7ae572a0f4352ff40c71e8573633deda43f6a379d56b3e/tomli-2.4.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:1b168f2731796b045128c45982d3a4874057626da0e2ef1fdd722848b741361d", size = 240875, upload-time = "2026-01-11T11:21:50.755Z" }, + { url = "https://files.pythonhosted.org/packages/aa/ad/cb089cb190487caa80204d503c7fd0f4d443f90b95cf4ef5cf5aa0f439b0/tomli-2.4.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:133e93646ec4300d651839d382d63edff11d8978be23da4cc106f5a18b7d0576", size = 246271, upload-time = "2026-01-11T11:21:51.81Z" }, + { url = "https://files.pythonhosted.org/packages/0b/63/69125220e47fd7a3a27fd0de0c6398c89432fec41bc739823bcc66506af6/tomli-2.4.0-cp311-cp311-win32.whl", hash = "sha256:b6c78bdf37764092d369722d9946cb65b8767bfa4110f902a1b2542d8d173c8a", size = 96770, upload-time = "2026-01-11T11:21:52.647Z" }, + { url = "https://files.pythonhosted.org/packages/1e/0d/a22bb6c83f83386b0008425a6cd1fa1c14b5f3dd4bad05e98cf3dbbf4a64/tomli-2.4.0-cp311-cp311-win_amd64.whl", hash = "sha256:d3d1654e11d724760cdb37a3d7691f0be9db5fbdaef59c9f532aabf87006dbaa", size = 107626, upload-time = "2026-01-11T11:21:53.459Z" }, + { url = "https://files.pythonhosted.org/packages/2f/6d/77be674a3485e75cacbf2ddba2b146911477bd887dda9d8c9dfb2f15e871/tomli-2.4.0-cp311-cp311-win_arm64.whl", hash = "sha256:cae9c19ed12d4e8f3ebf46d1a75090e4c0dc16271c5bce1c833ac168f08fb614", size = 94842, upload-time = "2026-01-11T11:21:54.831Z" }, { url = "https://files.pythonhosted.org/packages/3c/43/7389a1869f2f26dba52404e1ef13b4784b6b37dac93bac53457e3ff24ca3/tomli-2.4.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:920b1de295e72887bafa3ad9f7a792f811847d57ea6b1215154030cf131f16b1", size = 154894, upload-time = "2026-01-11T11:21:56.07Z" }, { url = "https://files.pythonhosted.org/packages/e9/05/2f9bf110b5294132b2edf13fe6ca6ae456204f3d749f623307cbb7a946f2/tomli-2.4.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:7d6d9a4aee98fac3eab4952ad1d73aee87359452d1c086b5ceb43ed02ddb16b8", size = 149053, upload-time = "2026-01-11T11:21:57.467Z" }, { url = "https://files.pythonhosted.org/packages/e8/41/1eda3ca1abc6f6154a8db4d714a4d35c4ad90adc0bcf700657291593fbf3/tomli-2.4.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:36b9d05b51e65b254ea6c2585b59d2c4cb91c8a3d91d0ed0f17591a29aaea54a", size = 243481, upload-time = "2026-01-11T11:21:58.661Z" }, @@ -671,21 +609,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/d4/84/021bbeb7edb990dd6875cb6ab08d32faaa49fec63453d863730260a01f9e/typeapi-2.3.0-py3-none-any.whl", hash = "sha256:576b7dcb94412e91c5cae107a393674f8f99c10a24beb8be2302e3fed21d5cc2", size = 26858, upload-time = "2025-10-23T13:44:09.833Z" }, ] -[[package]] -name = "typer" -version = "0.21.1" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "click" }, - { name = "rich" }, - { name = "shellingham" }, - { name = "typing-extensions" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/36/bf/8825b5929afd84d0dabd606c67cd57b8388cb3ec385f7ef19c5cc2202069/typer-0.21.1.tar.gz", hash = "sha256:ea835607cd752343b6b2b7ce676893e5a0324082268b48f27aa058bdb7d2145d", size = 110371, upload-time = "2026-01-06T11:21:10.989Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/a0/1d/d9257dd49ff2ca23ea5f132edf1281a0c4f9de8a762b9ae399b670a59235/typer-0.21.1-py3-none-any.whl", hash = "sha256:7985e89081c636b88d172c2ee0cfe33c253160994d47bdfdc302defd7d1f1d01", size = 47381, upload-time = "2026-01-06T11:21:09.824Z" }, -] - [[package]] name = "typing-extensions" version = "4.15.0" @@ -710,6 +633,9 @@ version = "6.0.0" source = { registry = "https://pypi.org/simple" } sdist = { url = "https://files.pythonhosted.org/packages/db/7d/7f3d619e951c88ed75c6037b246ddcf2d322812ee8ea189be89511721d54/watchdog-6.0.0.tar.gz", hash = "sha256:9ddf7c82fda3ae8e24decda1338ede66e1c99883db93711d8fb941eaa2d8c282", size = 131220, upload-time = "2024-11-01T14:07:13.037Z" } wheels = [ + { url = "https://files.pythonhosted.org/packages/e0/24/d9be5cd6642a6aa68352ded4b4b10fb0d7889cb7f45814fb92cecd35f101/watchdog-6.0.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:6eb11feb5a0d452ee41f824e271ca311a09e250441c262ca2fd7ebcf2461a06c", size = 96393, upload-time = "2024-11-01T14:06:31.756Z" }, + { url = "https://files.pythonhosted.org/packages/63/7a/6013b0d8dbc56adca7fdd4f0beed381c59f6752341b12fa0886fa7afc78b/watchdog-6.0.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:ef810fbf7b781a5a593894e4f439773830bdecb885e6880d957d5b9382a960d2", size = 88392, upload-time = "2024-11-01T14:06:32.99Z" }, + { url = "https://files.pythonhosted.org/packages/d1/40/b75381494851556de56281e053700e46bff5b37bf4c7267e858640af5a7f/watchdog-6.0.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:afd0fe1b2270917c5e23c2a65ce50c2a4abb63daafb0d419fde368e272a76b7c", size = 89019, upload-time = "2024-11-01T14:06:34.963Z" }, { url = "https://files.pythonhosted.org/packages/39/ea/3930d07dafc9e286ed356a679aa02d777c06e9bfd1164fa7c19c288a5483/watchdog-6.0.0-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:bdd4e6f14b8b18c334febb9c4425a878a2ac20efd1e0b231978e7b150f92a948", size = 96471, upload-time = "2024-11-01T14:06:37.745Z" }, { url = "https://files.pythonhosted.org/packages/12/87/48361531f70b1f87928b045df868a9fd4e253d9ae087fa4cf3f7113be363/watchdog-6.0.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:c7c15dda13c4eb00d6fb6fc508b3c0ed88b9d5d374056b239c4ad1611125c860", size = 88449, upload-time = "2024-11-01T14:06:39.748Z" }, { url = "https://files.pythonhosted.org/packages/5b/7e/8f322f5e600812e6f9a31b75d242631068ca8f4ef0582dd3ae6e72daecc8/watchdog-6.0.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:6f10cb2d5902447c7d0da897e2c6768bca89174d0c6e1e30abec5421af97a5b0", size = 89054, upload-time = "2024-11-01T14:06:41.009Z" }, @@ -734,6 +660,18 @@ version = "2.0.1" source = { registry = "https://pypi.org/simple" } sdist = { url = "https://files.pythonhosted.org/packages/49/2a/6de8a50cb435b7f42c46126cf1a54b2aab81784e74c8595c8e025e8f36d3/wrapt-2.0.1.tar.gz", hash = "sha256:9c9c635e78497cacb81e84f8b11b23e0aacac7a136e73b8e5b2109a1d9fc468f", size = 82040, upload-time = "2025-11-07T00:45:33.312Z" } wheels = [ + { url = "https://files.pythonhosted.org/packages/98/60/553997acf3939079dab022e37b67b1904b5b0cc235503226898ba573b10c/wrapt-2.0.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:0e17283f533a0d24d6e5429a7d11f250a58d28b4ae5186f8f47853e3e70d2590", size = 77480, upload-time = "2025-11-07T00:43:30.573Z" }, + { url = "https://files.pythonhosted.org/packages/2d/50/e5b3d30895d77c52105c6d5cbf94d5b38e2a3dd4a53d22d246670da98f7c/wrapt-2.0.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:85df8d92158cb8f3965aecc27cf821461bb5f40b450b03facc5d9f0d4d6ddec6", size = 60690, upload-time = "2025-11-07T00:43:31.594Z" }, + { url = "https://files.pythonhosted.org/packages/f0/40/660b2898703e5cbbb43db10cdefcc294274458c3ca4c68637c2b99371507/wrapt-2.0.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:c1be685ac7700c966b8610ccc63c3187a72e33cab53526a27b2a285a662cd4f7", size = 61578, upload-time = "2025-11-07T00:43:32.918Z" }, + { url = "https://files.pythonhosted.org/packages/5b/36/825b44c8a10556957bc0c1d84c7b29a40e05fcf1873b6c40aa9dbe0bd972/wrapt-2.0.1-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:df0b6d3b95932809c5b3fecc18fda0f1e07452d05e2662a0b35548985f256e28", size = 114115, upload-time = "2025-11-07T00:43:35.605Z" }, + { url = "https://files.pythonhosted.org/packages/83/73/0a5d14bb1599677304d3c613a55457d34c344e9b60eda8a737c2ead7619e/wrapt-2.0.1-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:4da7384b0e5d4cae05c97cd6f94faaf78cc8b0f791fc63af43436d98c4ab37bb", size = 116157, upload-time = "2025-11-07T00:43:37.058Z" }, + { url = "https://files.pythonhosted.org/packages/01/22/1c158fe763dbf0a119f985d945711d288994fe5514c0646ebe0eb18b016d/wrapt-2.0.1-cp311-cp311-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:ec65a78fbd9d6f083a15d7613b2800d5663dbb6bb96003899c834beaa68b242c", size = 112535, upload-time = "2025-11-07T00:43:34.138Z" }, + { url = "https://files.pythonhosted.org/packages/5c/28/4f16861af67d6de4eae9927799b559c20ebdd4fe432e89ea7fe6fcd9d709/wrapt-2.0.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:7de3cc939be0e1174969f943f3b44e0d79b6f9a82198133a5b7fc6cc92882f16", size = 115404, upload-time = "2025-11-07T00:43:39.214Z" }, + { url = "https://files.pythonhosted.org/packages/a0/8b/7960122e625fad908f189b59c4aae2d50916eb4098b0fb2819c5a177414f/wrapt-2.0.1-cp311-cp311-musllinux_1_2_riscv64.whl", hash = "sha256:fb1a5b72cbd751813adc02ef01ada0b0d05d3dcbc32976ce189a1279d80ad4a2", size = 111802, upload-time = "2025-11-07T00:43:40.476Z" }, + { url = "https://files.pythonhosted.org/packages/3e/73/7881eee5ac31132a713ab19a22c9e5f1f7365c8b1df50abba5d45b781312/wrapt-2.0.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:3fa272ca34332581e00bf7773e993d4f632594eb2d1b0b162a9038df0fd971dd", size = 113837, upload-time = "2025-11-07T00:43:42.921Z" }, + { url = "https://files.pythonhosted.org/packages/45/00/9499a3d14e636d1f7089339f96c4409bbc7544d0889f12264efa25502ae8/wrapt-2.0.1-cp311-cp311-win32.whl", hash = "sha256:fc007fdf480c77301ab1afdbb6ab22a5deee8885f3b1ed7afcb7e5e84a0e27be", size = 58028, upload-time = "2025-11-07T00:43:47.369Z" }, + { url = "https://files.pythonhosted.org/packages/70/5d/8f3d7eea52f22638748f74b102e38fdf88cb57d08ddeb7827c476a20b01b/wrapt-2.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:47434236c396d04875180171ee1f3815ca1eada05e24a1ee99546320d54d1d1b", size = 60385, upload-time = "2025-11-07T00:43:44.34Z" }, + { url = "https://files.pythonhosted.org/packages/14/e2/32195e57a8209003587bbbad44d5922f13e0ced2a493bb46ca882c5b123d/wrapt-2.0.1-cp311-cp311-win_arm64.whl", hash = "sha256:837e31620e06b16030b1d126ed78e9383815cbac914693f54926d816d35d8edf", size = 58893, upload-time = "2025-11-07T00:43:46.161Z" }, { url = "https://files.pythonhosted.org/packages/cb/73/8cb252858dc8254baa0ce58ce382858e3a1cf616acebc497cb13374c95c6/wrapt-2.0.1-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:1fdbb34da15450f2b1d735a0e969c24bdb8d8924892380126e2a293d9902078c", size = 78129, upload-time = "2025-11-07T00:43:48.852Z" }, { url = "https://files.pythonhosted.org/packages/19/42/44a0db2108526ee6e17a5ab72478061158f34b08b793df251d9fbb9a7eb4/wrapt-2.0.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:3d32794fe940b7000f0519904e247f902f0149edbe6316c710a8562fb6738841", size = 61205, upload-time = "2025-11-07T00:43:50.402Z" }, { url = "https://files.pythonhosted.org/packages/4d/8a/5b4b1e44b791c22046e90d9b175f9a7581a8cc7a0debbb930f81e6ae8e25/wrapt-2.0.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:386fb54d9cd903ee0012c09291336469eb7b244f7183d40dc3e86a16a4bace62", size = 61692, upload-time = "2025-11-07T00:43:51.678Z" }, diff --git a/websites/bitview/index.html b/websites/bitview/index.html index b82511ffe..6f7af19d0 100644 --- a/websites/bitview/index.html +++ b/websites/bitview/index.html @@ -1563,7 +1563,7 @@ - + @@ -1634,7 +1634,7 @@ "/scripts/entry.js": "/scripts/entry.fe229b42.js", "/scripts/lazy.js": "/scripts/lazy.1ae52534.js", "/scripts/main.js": "/scripts/main.22a5bd79.js", - "/scripts/modules/brk-client/index.js": "/scripts/modules/brk-client/index.b24ba2c8.js", + "/scripts/modules/brk-client/index.js": "/scripts/modules/brk-client/index.22379f83.js", "/scripts/modules/brk-client/tests/basic.js": "/scripts/modules/brk-client/tests/basic.b92ff866.js", "/scripts/modules/brk-client/tests/tree.js": "/scripts/modules/brk-client/tests/tree.ba9474f7.js", "/scripts/modules/lean-qr/2.6.1/index.mjs": "/scripts/modules/lean-qr/2.6.1/index.09195c13.mjs",