diff --git a/crates/brk_bindgen/src/analysis/tree.rs b/crates/brk_bindgen/src/analysis/tree.rs index ad2625f58..5fd39ba0f 100644 --- a/crates/brk_bindgen/src/analysis/tree.rs +++ b/crates/brk_bindgen/src/analysis/tree.rs @@ -33,14 +33,6 @@ fn get_shortest_leaf_name(node: &TreeNode) -> Option { } } -/// Get all leaf names from a tree node. -pub fn get_all_leaf_names(node: &TreeNode) -> Vec { - match node { - TreeNode::Leaf(leaf) => vec![leaf.name().to_string()], - TreeNode::Branch(children) => children.values().flat_map(get_all_leaf_names).collect(), - } -} - /// Get the field signature for a branch node's children. pub fn get_node_fields( children: &BTreeMap, @@ -78,11 +70,9 @@ pub fn get_node_fields( } /// Detect index patterns (sets of indexes that appear together on metrics). -pub fn detect_index_patterns(tree: &TreeNode) -> (BTreeSet, Vec) { - let mut used_indexes: BTreeSet = BTreeSet::new(); +pub fn detect_index_patterns(tree: &TreeNode) -> Vec { let mut unique_index_sets: BTreeSet> = BTreeSet::new(); - - collect_indexes_from_tree(tree, &mut used_indexes, &mut unique_index_sets); + collect_index_sets_from_tree(tree, &mut unique_index_sets); // Sort by count (descending) then by first index name for deterministic ordering let mut sorted_sets: Vec<_> = unique_index_sets @@ -96,31 +86,27 @@ pub fn detect_index_patterns(tree: &TreeNode) -> (BTreeSet, Vec = sorted_sets + sorted_sets .into_iter() .enumerate() .map(|(i, indexes)| IndexSetPattern { name: format!("MetricPattern{}", i + 1), indexes, }) - .collect(); - - (used_indexes, patterns) + .collect() } -fn collect_indexes_from_tree( +fn collect_index_sets_from_tree( node: &TreeNode, - used_indexes: &mut BTreeSet, unique_index_sets: &mut BTreeSet>, ) { match node { TreeNode::Leaf(leaf) => { - used_indexes.extend(leaf.indexes().iter().cloned()); unique_index_sets.insert(leaf.indexes().clone()); } TreeNode::Branch(children) => { for child in children.values() { - collect_indexes_from_tree(child, used_indexes, unique_index_sets); + collect_index_sets_from_tree(child, unique_index_sets); } } } @@ -136,17 +122,6 @@ pub struct PatternBaseResult { pub has_outlier: bool, } -impl PatternBaseResult { - /// Returns true if an inline type should be generated instead of using a pattern factory. - /// - /// This is the case when: - /// - The child fields don't match a parameterizable pattern, OR - /// - An outlier was detected during pattern analysis - pub fn should_inline(&self, is_parameterizable: bool) -> bool { - !is_parameterizable || self.has_outlier - } -} - /// Get the metric base for a pattern instance by analyzing direct children. /// /// Uses the shortest leaf names from direct children to find common prefix/suffix. diff --git a/crates/brk_bindgen/src/backends/javascript.rs b/crates/brk_bindgen/src/backends/javascript.rs index 50640eff5..eded7d986 100644 --- a/crates/brk_bindgen/src/backends/javascript.rs +++ b/crates/brk_bindgen/src/backends/javascript.rs @@ -1,6 +1,6 @@ //! JavaScript language syntax implementation. -use crate::{GenericSyntax, LanguageSyntax, to_camel_case, to_pascal_case}; +use crate::{GenericSyntax, LanguageSyntax, to_camel_case}; /// JavaScript-specific code generation syntax. pub struct JavaScriptSyntax; @@ -52,41 +52,6 @@ impl LanguageSyntax for JavaScriptSyntax { GenericSyntax::JAVASCRIPT } - fn struct_header(&self, name: &str, generic_params: &str, doc: Option<&str>) -> String { - let mut result = String::new(); - if let Some(doc) = doc { - result.push_str(&format!("/** {} */\n", doc)); - } - // JavaScript uses factory functions that return object literals - result.push_str(&format!( - "function create{}{}(client, basePath) {{\n return {{\n", - name, generic_params - )); - result - } - - fn struct_footer(&self) -> String { - " };\n}\n".to_string() - } - - fn constructor_header(&self, _params: &str) -> String { - // JavaScript factory functions don't have a separate constructor - String::new() - } - - fn constructor_footer(&self) -> String { - String::new() - } - - fn field_declaration(&self, indent: &str, _name: &str, type_ann: &str) -> String { - // JSDoc property declaration - format!("{}/** @type {{{}}} */\n", indent, type_ann) - } - - fn index_field_name(&self, index_name: &str) -> String { - format!("by{}", to_pascal_case(index_name)) - } - fn string_literal(&self, value: &str) -> String { format!("'{}'", value) } diff --git a/crates/brk_bindgen/src/backends/python.rs b/crates/brk_bindgen/src/backends/python.rs index bf4fca7d1..17d5aff30 100644 --- a/crates/brk_bindgen/src/backends/python.rs +++ b/crates/brk_bindgen/src/backends/python.rs @@ -47,35 +47,6 @@ impl LanguageSyntax for PythonSyntax { GenericSyntax::PYTHON } - fn struct_header(&self, name: &str, generic_params: &str, doc: Option<&str>) -> String { - let mut result = format!("class {}{}:\n", name, generic_params); - if let Some(doc) = doc { - result.push_str(&format!(" \"\"\"{}\"\"\"\n", doc)); - } - result - } - - fn struct_footer(&self) -> String { - String::new() - } - - fn constructor_header(&self, params: &str) -> String { - format!(" def __init__(self{}) -> None:\n", params) - } - - fn constructor_footer(&self) -> String { - String::new() - } - - fn field_declaration(&self, _indent: &str, _name: &str, _type_ann: &str) -> String { - // Python uses __init__ for field declarations, so this is a no-op - String::new() - } - - fn index_field_name(&self, index_name: &str) -> String { - to_snake_case(index_name) - } - fn string_literal(&self, value: &str) -> String { format!("'{}'", value) } diff --git a/crates/brk_bindgen/src/backends/rust.rs b/crates/brk_bindgen/src/backends/rust.rs index 8dc783aa2..ea2acd711 100644 --- a/crates/brk_bindgen/src/backends/rust.rs +++ b/crates/brk_bindgen/src/backends/rust.rs @@ -48,35 +48,6 @@ impl LanguageSyntax for RustSyntax { GenericSyntax::RUST } - fn struct_header(&self, name: &str, generic_params: &str, doc: Option<&str>) -> String { - let mut result = String::new(); - if let Some(doc) = doc { - result.push_str(&format!("/// {}\n", doc)); - } - result.push_str(&format!("pub struct {}{} {{\n", name, generic_params)); - result - } - - fn struct_footer(&self) -> String { - "}\n".to_string() - } - - fn constructor_header(&self, params: &str) -> String { - format!(" pub fn new({}) -> Self {{\n Self {{\n", params) - } - - fn constructor_footer(&self) -> String { - " }\n }\n".to_string() - } - - fn field_declaration(&self, indent: &str, name: &str, type_ann: &str) -> String { - format!("{}pub {}: {},\n", indent, name, type_ann) - } - - fn index_field_name(&self, index_name: &str) -> String { - format!("by_{}", to_snake_case(index_name)) - } - fn string_literal(&self, value: &str) -> String { format!("\"{}\".to_string()", value) } diff --git a/crates/brk_bindgen/src/generate/fields.rs b/crates/brk_bindgen/src/generate/fields.rs index 35a8994ee..9afab1d58 100644 --- a/crates/brk_bindgen/src/generate/fields.rs +++ b/crates/brk_bindgen/src/generate/fields.rs @@ -80,26 +80,6 @@ pub fn generate_parameterized_field( writeln!(output, "{}", syntax.field_init(indent, &field_name, &type_ann, &value)).unwrap(); } -/// Generate a tree-path field using the language syntax. -/// -/// This is the fallback for non-parameterizable patterns where fields -/// use a base path that's extended with the field name. -pub fn generate_tree_path_field( - output: &mut String, - syntax: &S, - field: &PatternField, - pattern: &StructuralPattern, - metadata: &ClientMetadata, - indent: &str, -) { - let field_name = syntax.field_name(&field.name); - let type_ann = metadata.field_type_annotation(field, false, None, syntax.generic_syntax()); - let path_expr = compute_path_expr(syntax, pattern, field, "base_path"); - let value = compute_field_value(syntax, field, metadata, &path_expr); - - writeln!(output, "{}", syntax.field_init(indent, &field_name, &type_ann, &value)).unwrap(); -} - /// Generate a tree node field with a specific child node for pattern instance base detection. /// /// This is used when generating tree nodes where we need to detect the pattern instance diff --git a/crates/brk_bindgen/src/generate/tree.rs b/crates/brk_bindgen/src/generate/tree.rs index 1a781ecfa..b48e467d5 100644 --- a/crates/brk_bindgen/src/generate/tree.rs +++ b/crates/brk_bindgen/src/generate/tree.rs @@ -27,8 +27,6 @@ pub struct ChildContext<'a> { pub should_inline: bool, /// The type name to use for inline branches. pub inline_type_name: String, - /// Whether the pattern is parameterizable (has ::new() constructor). - pub is_parameterizable: bool, } /// Context for generating a tree node, returned by `prepare_tree_node`. @@ -86,11 +84,6 @@ pub fn prepare_tree_node<'a>( .as_ref() .is_some_and(|cf| metadata.matches_pattern(cf)); - // For constructors: only use ::new() if parameterizable - let is_parameterizable = child_fields - .as_ref() - .is_some_and(|cf| metadata.is_parameterizable_fields(cf)); - // should_inline determines if we generate an inline struct type // We inline only if it's a branch AND doesn't match any pattern let should_inline = !is_leaf && !matches_any_pattern; @@ -111,7 +104,6 @@ pub fn prepare_tree_node<'a>( is_leaf, should_inline, inline_type_name, - is_parameterizable, } }) .collect(); diff --git a/crates/brk_bindgen/src/openapi.rs b/crates/brk_bindgen/src/openapi.rs index 263fd4b66..4f10b0e13 100644 --- a/crates/brk_bindgen/src/openapi.rs +++ b/crates/brk_bindgen/src/openapi.rs @@ -21,8 +21,6 @@ pub struct Endpoint { pub summary: Option, /// Detailed description pub description: Option, - /// Tags for grouping - pub tags: Vec, /// Path parameters pub path_params: Vec, /// Query parameters @@ -200,7 +198,6 @@ fn extract_endpoint(path: &str, method: &str, operation: &Operation) -> Option` with default `_` fn generic_syntax(&self) -> GenericSyntax; - /// Generate a struct/class header. - /// - /// # Arguments - /// * `name` - The type name - /// * `generic_params` - Generic parameters (e.g., "" or "[T]"), empty if none - /// * `doc` - Optional documentation string - fn struct_header(&self, name: &str, generic_params: &str, doc: Option<&str>) -> String; - - /// Generate a struct/class footer. - fn struct_footer(&self) -> String; - - /// Generate a constructor/init method header. - /// - /// # Arguments - /// * `params` - Constructor parameters (language-specific format) - fn constructor_header(&self, params: &str) -> String; - - /// Generate a constructor/init method footer. - fn constructor_footer(&self) -> String; - - /// Generate a field declaration (for struct body, not init). - /// - /// # Arguments - /// * `indent` - The indentation string - /// * `name` - The field name - /// * `type_ann` - The type annotation - fn field_declaration(&self, indent: &str, name: &str, type_ann: &str) -> String; - - /// Format an index field name from an Index. - /// - /// E.g., `by_date_height`, `by_date`, etc. - fn index_field_name(&self, index_name: &str) -> String; - /// Format a string literal. /// /// - Python/JavaScript: `'value'` (single quotes) diff --git a/crates/brk_bindgen/src/types/metadata.rs b/crates/brk_bindgen/src/types/metadata.rs index 2332718d7..56b701e7c 100644 --- a/crates/brk_bindgen/src/types/metadata.rs +++ b/crates/brk_bindgen/src/types/metadata.rs @@ -15,8 +15,6 @@ pub struct ClientMetadata { pub catalog: brk_types::TreeNode, /// Structural patterns - tree node shapes that repeat pub structural_patterns: Vec, - /// All indexes used across the catalog - pub used_indexes: BTreeSet, /// Index set patterns - sets of indexes that appear together on metrics pub index_set_patterns: Vec, /// Maps concrete field signatures to pattern names @@ -35,12 +33,11 @@ impl ClientMetadata { pub fn from_catalog(catalog: brk_types::TreeNode) -> Self { let (structural_patterns, concrete_to_pattern, concrete_to_type_param) = analysis::detect_structural_patterns(&catalog); - let (used_indexes, index_set_patterns) = analysis::detect_index_patterns(&catalog); + let index_set_patterns = analysis::detect_index_patterns(&catalog); ClientMetadata { catalog, structural_patterns, - used_indexes, index_set_patterns, concrete_to_pattern, concrete_to_type_param, @@ -98,20 +95,6 @@ impl ClientMetadata { || self.structural_patterns.iter().any(|p| p.fields == fields) } - /// Check if child fields match a parameterizable pattern. - /// Returns true only if the fields match a pattern AND that pattern is parameterizable. - pub fn is_parameterizable_fields(&self, fields: &[PatternField]) -> bool { - self.concrete_to_pattern - .get(fields) - .or_else(|| { - self.structural_patterns - .iter() - .find(|p| p.fields == fields) - .map(|p| &p.name) - }) - .is_some_and(|name| self.is_parameterizable(name)) - } - /// Resolve the type name for a tree field. /// If the field matches ANY pattern (parameterizable or not), returns pattern type. /// Otherwise returns the inline type name (parent_child format). @@ -148,11 +131,6 @@ impl ClientMetadata { lookup } - /// Check if a field should use a shared index accessor. - pub fn field_uses_accessor(&self, field: &PatternField) -> bool { - self.find_index_set_pattern(&field.indexes).is_some() - } - /// Generate type annotation for a field with language-specific syntax. pub fn field_type_annotation( &self, diff --git a/crates/brk_bindgen/src/types/structs.rs b/crates/brk_bindgen/src/types/structs.rs index 0cd358169..c85c43d68 100644 --- a/crates/brk_bindgen/src/types/structs.rs +++ b/crates/brk_bindgen/src/types/structs.rs @@ -29,11 +29,6 @@ pub struct StructuralPattern { } impl StructuralPattern { - /// Returns true if this pattern contains any leaf fields. - pub fn contains_leaves(&self) -> bool { - self.fields.iter().any(|f| f.is_leaf()) - } - /// Returns true if this pattern can be parameterized with an accumulator. pub fn is_parameterizable(&self) -> bool { self.mode.is_some() @@ -52,11 +47,6 @@ impl StructuralPattern { pub fn is_suffix_mode(&self) -> bool { matches!(&self.mode, Some(PatternMode::Suffix { .. })) } - - /// Returns true if this pattern is in prefix mode. - pub fn is_prefix_mode(&self) -> bool { - matches!(&self.mode, Some(PatternMode::Prefix { .. })) - } } /// A field in a structural pattern. diff --git a/crates/brk_bindgen/tests/catalog_test.rs b/crates/brk_bindgen/tests/catalog_test.rs index 843ca5c63..3d663ce5a 100644 --- a/crates/brk_bindgen/tests/catalog_test.rs +++ b/crates/brk_bindgen/tests/catalog_test.rs @@ -269,13 +269,54 @@ fn test_parameterizable_patterns_have_mode() { } } +#[test] +fn test_fee_rate_pattern_relatives() { + let catalog = load_catalog(); + let (patterns, _, _) = brk_bindgen::detect_structural_patterns(&catalog); + + let fee_rate_pattern = patterns + .iter() + .find(|p| p.name == "FeeRatePattern") + .expect("FeeRatePattern should exist"); + + println!("FeeRatePattern mode:"); + if let Some(mode) = &fee_rate_pattern.mode { + match mode { + brk_bindgen::PatternMode::Suffix { relatives } => { + println!(" Suffix mode:"); + for (field, relative) in relatives { + println!(" {} -> '{}'", field, relative); + } + } + brk_bindgen::PatternMode::Prefix { prefixes } => { + println!(" Prefix mode:"); + for (field, prefix) in prefixes { + println!(" {} -> '{}'", field, prefix); + } + } + } + } else { + println!(" No mode (not parameterizable)"); + } + + // Check that relatives are correct - should be "average", "max", etc. + // NOT "tx_weight_average", "tx_weight_max", etc. + if let Some(brk_bindgen::PatternMode::Suffix { relatives }) = &fee_rate_pattern.mode { + assert_eq!( + relatives.get("average"), + Some(&"average".to_string()), + "average relative should be 'average', not 'tx_weight_average'" + ); + } +} + #[test] fn test_index_patterns() { let catalog = load_catalog(); - let (used_indexes, index_patterns) = brk_bindgen::detect_index_patterns(&catalog); + let index_patterns = brk_bindgen::detect_index_patterns(&catalog); - println!("Used indexes: {:?}", used_indexes); + // println!("Used indexes: {:?}", used_indexes); println!("Index set patterns: {}", index_patterns.len()); for pattern in &index_patterns { diff --git a/crates/brk_client/src/lib.rs b/crates/brk_client/src/lib.rs index d10c82a74..a597b79fa 100644 --- a/crates/brk_client/src/lib.rs +++ b/crates/brk_client/src/lib.rs @@ -2642,56 +2642,6 @@ impl Price111dSmaPattern { } } -/// Pattern struct for repeated tree structure. -pub struct ActivePriceRatioPattern { - pub ratio: MetricPattern4, - pub ratio_1m_sma: MetricPattern4, - pub ratio_1w_sma: MetricPattern4, - pub ratio_1y_sd: Ratio1ySdPattern, - pub ratio_2y_sd: Ratio1ySdPattern, - pub ratio_4y_sd: Ratio1ySdPattern, - pub ratio_pct1: MetricPattern4, - pub ratio_pct1_usd: MetricPattern4, - pub ratio_pct2: MetricPattern4, - pub ratio_pct2_usd: MetricPattern4, - pub ratio_pct5: MetricPattern4, - pub ratio_pct5_usd: MetricPattern4, - pub ratio_pct95: MetricPattern4, - pub ratio_pct95_usd: MetricPattern4, - pub ratio_pct98: MetricPattern4, - pub ratio_pct98_usd: MetricPattern4, - pub ratio_pct99: MetricPattern4, - pub ratio_pct99_usd: MetricPattern4, - pub ratio_sd: Ratio1ySdPattern, -} - -impl ActivePriceRatioPattern { - /// Create a new pattern node with accumulated metric name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - ratio: MetricPattern4::new(client.clone(), acc.clone()), - ratio_1m_sma: MetricPattern4::new(client.clone(), _m(&acc, "1m_sma")), - ratio_1w_sma: MetricPattern4::new(client.clone(), _m(&acc, "1w_sma")), - ratio_1y_sd: Ratio1ySdPattern::new(client.clone(), _m(&acc, "1y")), - ratio_2y_sd: Ratio1ySdPattern::new(client.clone(), _m(&acc, "2y")), - ratio_4y_sd: Ratio1ySdPattern::new(client.clone(), _m(&acc, "4y")), - ratio_pct1: MetricPattern4::new(client.clone(), _m(&acc, "pct1")), - ratio_pct1_usd: MetricPattern4::new(client.clone(), _m(&acc, "pct1_usd")), - ratio_pct2: MetricPattern4::new(client.clone(), _m(&acc, "pct2")), - ratio_pct2_usd: MetricPattern4::new(client.clone(), _m(&acc, "pct2_usd")), - ratio_pct5: MetricPattern4::new(client.clone(), _m(&acc, "pct5")), - ratio_pct5_usd: MetricPattern4::new(client.clone(), _m(&acc, "pct5_usd")), - ratio_pct95: MetricPattern4::new(client.clone(), _m(&acc, "pct95")), - ratio_pct95_usd: MetricPattern4::new(client.clone(), _m(&acc, "pct95_usd")), - ratio_pct98: MetricPattern4::new(client.clone(), _m(&acc, "pct98")), - ratio_pct98_usd: MetricPattern4::new(client.clone(), _m(&acc, "pct98_usd")), - ratio_pct99: MetricPattern4::new(client.clone(), _m(&acc, "pct99")), - ratio_pct99_usd: MetricPattern4::new(client.clone(), _m(&acc, "pct99_usd")), - ratio_sd: Ratio1ySdPattern::new(client.clone(), acc.clone()), - } - } -} - /// Pattern struct for repeated tree structure. pub struct PercentilesPattern { pub pct05: MetricPattern4, @@ -2742,6 +2692,56 @@ impl PercentilesPattern { } } +/// Pattern struct for repeated tree structure. +pub struct ActivePriceRatioPattern { + pub ratio: MetricPattern4, + pub ratio_1m_sma: MetricPattern4, + pub ratio_1w_sma: MetricPattern4, + pub ratio_1y_sd: Ratio1ySdPattern, + pub ratio_2y_sd: Ratio1ySdPattern, + pub ratio_4y_sd: Ratio1ySdPattern, + pub ratio_pct1: MetricPattern4, + pub ratio_pct1_usd: MetricPattern4, + pub ratio_pct2: MetricPattern4, + pub ratio_pct2_usd: MetricPattern4, + pub ratio_pct5: MetricPattern4, + pub ratio_pct5_usd: MetricPattern4, + pub ratio_pct95: MetricPattern4, + pub ratio_pct95_usd: MetricPattern4, + pub ratio_pct98: MetricPattern4, + pub ratio_pct98_usd: MetricPattern4, + pub ratio_pct99: MetricPattern4, + pub ratio_pct99_usd: MetricPattern4, + pub ratio_sd: Ratio1ySdPattern, +} + +impl ActivePriceRatioPattern { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + ratio: MetricPattern4::new(client.clone(), acc.clone()), + ratio_1m_sma: MetricPattern4::new(client.clone(), _m(&acc, "1m_sma")), + ratio_1w_sma: MetricPattern4::new(client.clone(), _m(&acc, "1w_sma")), + ratio_1y_sd: Ratio1ySdPattern::new(client.clone(), _m(&acc, "1y")), + ratio_2y_sd: Ratio1ySdPattern::new(client.clone(), _m(&acc, "2y")), + ratio_4y_sd: Ratio1ySdPattern::new(client.clone(), _m(&acc, "4y")), + ratio_pct1: MetricPattern4::new(client.clone(), _m(&acc, "pct1")), + ratio_pct1_usd: MetricPattern4::new(client.clone(), _m(&acc, "pct1_usd")), + ratio_pct2: MetricPattern4::new(client.clone(), _m(&acc, "pct2")), + ratio_pct2_usd: MetricPattern4::new(client.clone(), _m(&acc, "pct2_usd")), + ratio_pct5: MetricPattern4::new(client.clone(), _m(&acc, "pct5")), + ratio_pct5_usd: MetricPattern4::new(client.clone(), _m(&acc, "pct5_usd")), + ratio_pct95: MetricPattern4::new(client.clone(), _m(&acc, "pct95")), + ratio_pct95_usd: MetricPattern4::new(client.clone(), _m(&acc, "pct95_usd")), + ratio_pct98: MetricPattern4::new(client.clone(), _m(&acc, "pct98")), + ratio_pct98_usd: MetricPattern4::new(client.clone(), _m(&acc, "pct98_usd")), + ratio_pct99: MetricPattern4::new(client.clone(), _m(&acc, "pct99")), + ratio_pct99_usd: MetricPattern4::new(client.clone(), _m(&acc, "pct99_usd")), + ratio_sd: Ratio1ySdPattern::new(client.clone(), acc.clone()), + } + } +} + /// Pattern struct for repeated tree structure. pub struct RelativePattern5 { pub neg_unrealized_loss_rel_to_market_cap: MetricPattern1, @@ -3042,38 +3042,6 @@ impl DollarsPattern { } } -/// Pattern struct for repeated tree structure. -pub struct RelativePattern2 { - pub neg_unrealized_loss_rel_to_own_market_cap: MetricPattern1, - pub neg_unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1, - pub net_unrealized_pnl_rel_to_own_market_cap: MetricPattern1, - pub net_unrealized_pnl_rel_to_own_total_unrealized_pnl: MetricPattern1, - pub supply_in_loss_rel_to_own_supply: MetricPattern1, - pub supply_in_profit_rel_to_own_supply: MetricPattern1, - pub unrealized_loss_rel_to_own_market_cap: MetricPattern1, - pub unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1, - pub unrealized_profit_rel_to_own_market_cap: MetricPattern1, - pub unrealized_profit_rel_to_own_total_unrealized_pnl: MetricPattern1, -} - -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")), - } - } -} - /// Pattern struct for repeated tree structure. pub struct RelativePattern { pub neg_unrealized_loss_rel_to_market_cap: MetricPattern1, @@ -3106,6 +3074,38 @@ impl RelativePattern { } } +/// Pattern struct for repeated tree structure. +pub struct RelativePattern2 { + pub neg_unrealized_loss_rel_to_own_market_cap: MetricPattern1, + pub neg_unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1, + pub net_unrealized_pnl_rel_to_own_market_cap: MetricPattern1, + pub net_unrealized_pnl_rel_to_own_total_unrealized_pnl: MetricPattern1, + pub supply_in_loss_rel_to_own_supply: MetricPattern1, + pub supply_in_profit_rel_to_own_supply: MetricPattern1, + pub unrealized_loss_rel_to_own_market_cap: MetricPattern1, + pub unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1, + pub unrealized_profit_rel_to_own_market_cap: MetricPattern1, + pub unrealized_profit_rel_to_own_total_unrealized_pnl: MetricPattern1, +} + +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")), + } + } +} + /// Pattern struct for repeated tree structure. pub struct CountPattern2 { pub average: MetricPattern1, @@ -3257,24 +3257,50 @@ impl _0satsPattern { } /// Pattern struct for repeated tree structure. -pub struct _10yPattern { +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(), _p("10y", &acc)), + _2y: MetricPattern4::new(client.clone(), _p("2y", &acc)), + _3y: MetricPattern4::new(client.clone(), _p("3y", &acc)), + _4y: MetricPattern4::new(client.clone(), _p("4y", &acc)), + _5y: MetricPattern4::new(client.clone(), _p("5y", &acc)), + _6y: MetricPattern4::new(client.clone(), _p("6y", &acc)), + _8y: MetricPattern4::new(client.clone(), _p("8y", &acc)), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct _100btcPattern { pub activity: ActivityPattern2, pub cost_basis: CostBasisPattern, pub outputs: OutputsPattern, - pub realized: RealizedPattern4, + pub realized: RealizedPattern, pub relative: RelativePattern, pub supply: SupplyPattern2, pub unrealized: UnrealizedPattern, } -impl _10yPattern { +impl _100btcPattern { /// 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(), _m(&acc, "utxo_count")), - realized: RealizedPattern4::new(client.clone(), acc.clone()), + realized: RealizedPattern::new(client.clone(), acc.clone()), relative: RelativePattern::new(client.clone(), acc.clone()), supply: SupplyPattern2::new(client.clone(), _m(&acc, "supply")), unrealized: UnrealizedPattern::new(client.clone(), acc.clone()), @@ -3308,32 +3334,6 @@ impl _0satsPattern2 { } } -/// Pattern struct for repeated tree structure. -pub struct _100btcPattern { - pub activity: ActivityPattern2, - pub cost_basis: CostBasisPattern, - pub outputs: OutputsPattern, - pub realized: RealizedPattern, - pub relative: RelativePattern, - pub supply: SupplyPattern2, - pub unrealized: UnrealizedPattern, -} - -impl _100btcPattern { - /// 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(), _m(&acc, "utxo_count")), - realized: RealizedPattern::new(client.clone(), acc.clone()), - relative: RelativePattern::new(client.clone(), acc.clone()), - supply: SupplyPattern2::new(client.clone(), _m(&acc, "supply")), - unrealized: UnrealizedPattern::new(client.clone(), acc.clone()), - } - } -} - /// Pattern struct for repeated tree structure. pub struct UnrealizedPattern { pub neg_unrealized_loss: MetricPattern1, @@ -3387,27 +3387,27 @@ impl _10yTo12yPattern { } /// 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, +pub struct _10yPattern { + pub activity: ActivityPattern2, + pub cost_basis: CostBasisPattern, + pub outputs: OutputsPattern, + pub realized: RealizedPattern4, + pub relative: RelativePattern, + pub supply: SupplyPattern2, + pub unrealized: UnrealizedPattern, } -impl PeriodCagrPattern { +impl _10yPattern { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - _10y: MetricPattern4::new(client.clone(), _p("10y", &acc)), - _2y: MetricPattern4::new(client.clone(), _p("2y", &acc)), - _3y: MetricPattern4::new(client.clone(), _p("3y", &acc)), - _4y: MetricPattern4::new(client.clone(), _p("4y", &acc)), - _5y: MetricPattern4::new(client.clone(), _p("5y", &acc)), - _6y: MetricPattern4::new(client.clone(), _p("6y", &acc)), - _8y: MetricPattern4::new(client.clone(), _p("8y", &acc)), + activity: ActivityPattern2::new(client.clone(), acc.clone()), + cost_basis: CostBasisPattern::new(client.clone(), acc.clone()), + outputs: OutputsPattern::new(client.clone(), _m(&acc, "utxo_count")), + realized: RealizedPattern4::new(client.clone(), acc.clone()), + relative: RelativePattern::new(client.clone(), acc.clone()), + supply: SupplyPattern2::new(client.clone(), _m(&acc, "supply")), + unrealized: UnrealizedPattern::new(client.clone(), acc.clone()), } } } @@ -3454,24 +3454,6 @@ impl SplitPattern2 { } } -/// Pattern struct for repeated tree structure. -pub struct CostBasisPattern2 { - pub max: MetricPattern1, - pub min: MetricPattern1, - pub percentiles: PercentilesPattern, -} - -impl CostBasisPattern2 { - /// Create a new pattern node with accumulated metric name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - max: MetricPattern1::new(client.clone(), _m(&acc, "max_cost_basis")), - min: MetricPattern1::new(client.clone(), _m(&acc, "min_cost_basis")), - percentiles: PercentilesPattern::new(client.clone(), _m(&acc, "cost_basis")), - } - } -} - /// Pattern struct for repeated tree structure. pub struct UnclaimedRewardsPattern { pub bitcoin: BitcoinPattern2, @@ -3508,24 +3490,6 @@ impl _2015Pattern { } } -/// 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 CoinbasePattern { pub bitcoin: BitcoinPattern, @@ -3544,6 +3508,24 @@ impl CoinbasePattern { } } +/// Pattern struct for repeated tree structure. +pub struct CostBasisPattern2 { + pub max: MetricPattern1, + pub min: MetricPattern1, + pub percentiles: PercentilesPattern, +} + +impl CostBasisPattern2 { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + max: MetricPattern1::new(client.clone(), _m(&acc, "max_cost_basis")), + min: MetricPattern1::new(client.clone(), _m(&acc, "min_cost_basis")), + percentiles: PercentilesPattern::new(client.clone(), _m(&acc, "cost_basis")), + } + } +} + /// Pattern struct for repeated tree structure. pub struct SegwitAdoptionPattern { pub base: MetricPattern11, @@ -3562,6 +3544,24 @@ impl SegwitAdoptionPattern { } } +/// 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 CoinbasePattern2 { pub bitcoin: BlockCountPattern, @@ -3580,38 +3580,6 @@ impl CoinbasePattern2 { } } -/// Pattern struct for repeated tree structure. -pub struct RelativePattern4 { - pub supply_in_loss_rel_to_own_supply: MetricPattern1, - pub supply_in_profit_rel_to_own_supply: MetricPattern1, -} - -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")), - } - } -} - -/// Pattern struct for repeated tree structure. -pub struct CostBasisPattern { - pub max: MetricPattern1, - pub min: MetricPattern1, -} - -impl CostBasisPattern { - /// Create a new pattern node with accumulated metric name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - max: MetricPattern1::new(client.clone(), _m(&acc, "max_cost_basis")), - min: MetricPattern1::new(client.clone(), _m(&acc, "min_cost_basis")), - } - } -} - /// Pattern struct for repeated tree structure. pub struct _1dReturns1mSdPattern { pub sd: MetricPattern4, @@ -3644,6 +3612,38 @@ impl SupplyPattern2 { } } +/// Pattern struct for repeated tree structure. +pub struct CostBasisPattern { + pub max: MetricPattern1, + pub min: MetricPattern1, +} + +impl CostBasisPattern { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + max: MetricPattern1::new(client.clone(), _m(&acc, "max_cost_basis")), + min: MetricPattern1::new(client.clone(), _m(&acc, "min_cost_basis")), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct RelativePattern4 { + pub supply_in_loss_rel_to_own_supply: MetricPattern1, + pub supply_in_profit_rel_to_own_supply: MetricPattern1, +} + +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")), + } + } +} + /// Pattern struct for repeated tree structure. pub struct SatsPattern { pub ohlc: MetricPattern1, @@ -3654,24 +3654,8 @@ impl SatsPattern { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - ohlc: MetricPattern1::new(client.clone(), _m(&acc, "ohlc")), - split: SplitPattern2::new(client.clone(), acc.clone()), - } - } -} - -/// Pattern struct for repeated tree structure. -pub struct BitcoinPattern2 { - pub cumulative: MetricPattern2, - pub sum: MetricPattern1, -} - -impl BitcoinPattern2 { - /// Create a new pattern node with accumulated metric name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - cumulative: MetricPattern2::new(client.clone(), _m(&acc, "cumulative")), - sum: MetricPattern1::new(client.clone(), acc.clone()), + ohlc: MetricPattern1::new(client.clone(), _m(&acc, "ohlc_sats")), + split: SplitPattern2::new(client.clone(), _m(&acc, "sats")), } } } @@ -3692,6 +3676,22 @@ impl BlockCountPattern { } } +/// Pattern struct for repeated tree structure. +pub struct BitcoinPattern2 { + pub cumulative: MetricPattern2, + pub sum: MetricPattern1, +} + +impl BitcoinPattern2 { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + cumulative: MetricPattern2::new(client.clone(), _m(&acc, "cumulative")), + sum: MetricPattern1::new(client.clone(), acc.clone()), + } + } +} + /// Pattern struct for repeated tree structure. pub struct OutputsPattern { pub utxo_count: MetricPattern1, @@ -6265,17 +6265,17 @@ impl MetricsTree_Price_Cents_Split { /// Metrics tree node. pub struct MetricsTree_Price_Oracle { - pub ohlc: MetricPattern6, - pub price: MetricPattern11, + pub ohlc_cents: MetricPattern6, + pub price_cents: MetricPattern11, pub tx_count: MetricPattern6, } impl MetricsTree_Price_Oracle { pub fn new(client: Arc, base_path: String) -> Self { Self { - ohlc: MetricPattern6::new(client.clone(), "oracle_dateindex_to_ohlc".to_string()), - price: MetricPattern11::new(client.clone(), "oracle_height_to_price".to_string()), - tx_count: MetricPattern6::new(client.clone(), "oracle_dateindex_to_tx_count".to_string()), + ohlc_cents: MetricPattern6::new(client.clone(), "oracle_ohlc_cents".to_string()), + price_cents: MetricPattern11::new(client.clone(), "orange_price_cents".to_string()), + tx_count: MetricPattern6::new(client.clone(), "oracle_tx_count".to_string()), } } } diff --git a/crates/brk_computer/src/price/oracle/compute.rs b/crates/brk_computer/src/price/oracle/compute.rs index ec144c8d7..200f63542 100644 --- a/crates/brk_computer/src/price/oracle/compute.rs +++ b/crates/brk_computer/src/price/oracle/compute.rs @@ -30,13 +30,15 @@ impl Vecs { exit: &Exit, ) -> Result<()> { // Validate versions - self.price + self.price_cents .validate_computed_version_or_reset(indexer.vecs.outputs.value.version())?; - self.ohlc + self.ohlc_cents .validate_computed_version_or_reset(indexes.dateindex.date.version())?; let last_height = Height::from(indexer.vecs.blocks.timestamp.len()); - let start_height = starting_indexes.height.min(Height::from(self.price.len())); + let start_height = starting_indexes + .height + .min(Height::from(self.price_cents.len())); if start_height >= last_height { return Ok(()); @@ -78,7 +80,7 @@ impl Vecs { // Previous price for fallback (default ~$100,000) let mut prev_price = if start_height > Height::ZERO { - self.price + self.price_cents .iter()? .get(start_height.decremented().unwrap()) .unwrap_or(Cents::from(10_000_000i64)) @@ -271,14 +273,14 @@ impl Vecs { prev_price = price_cents; - self.price + self.price_cents .truncate_push_at(height.to_usize(), price_cents)?; } // Write height prices { let _lock = exit.lock(); - self.price.write()?; + self.price_cents.write()?; } info!("Oracle price computation: 100%"); @@ -299,14 +301,14 @@ impl Vecs { let last_dateindex = DateIndex::from(indexes.dateindex.date.len()); let start_dateindex = starting_indexes .dateindex - .min(DateIndex::from(self.ohlc.len())); + .min(DateIndex::from(self.ohlc_cents.len())); if start_dateindex >= last_dateindex { return Ok(()); } - let last_height = Height::from(self.price.len()); - let mut height_to_price_iter = self.price.iter()?; + let last_height = Height::from(self.price_cents.len()); + let mut height_to_price_iter = self.price_cents.iter()?; let mut dateindex_to_first_height_iter = indexes.dateindex.first_height.iter(); let mut height_count_iter = indexes.dateindex.height_count.iter(); @@ -359,7 +361,7 @@ impl Vecs { } else { // No prices for this day, use previous if dateindex > DateIndex::from(0usize) { - self.ohlc + self.ohlc_cents .iter()? .get(dateindex.decremented().unwrap()) .unwrap_or_default() @@ -368,7 +370,8 @@ impl Vecs { } }; - self.ohlc.truncate_push_at(dateindex.to_usize(), ohlc)?; + self.ohlc_cents + .truncate_push_at(dateindex.to_usize(), ohlc)?; self.tx_count .truncate_push_at(dateindex.to_usize(), StoredU32::from(tx_count))?; } @@ -376,7 +379,7 @@ impl Vecs { // Write daily data { let _lock = exit.lock(); - self.ohlc.write()?; + self.ohlc_cents.write()?; self.tx_count.write()?; } diff --git a/crates/brk_computer/src/price/oracle/import.rs b/crates/brk_computer/src/price/oracle/import.rs index 2e00ae197..532db95fd 100644 --- a/crates/brk_computer/src/price/oracle/import.rs +++ b/crates/brk_computer/src/price/oracle/import.rs @@ -6,15 +6,14 @@ use super::Vecs; impl Vecs { pub fn forced_import(db: &Database, version: Version) -> Result { - let height_to_price = PcoVec::forced_import(db, "oracle_height_to_price", version)?; - let dateindex_to_ohlc = BytesVec::forced_import(db, "oracle_dateindex_to_ohlc", version)?; - let dateindex_to_tx_count = - PcoVec::forced_import(db, "oracle_dateindex_to_tx_count", version)?; + let price_cents = PcoVec::forced_import(db, "orange_price_cents", version)?; + let ohlc_cents = BytesVec::forced_import(db, "oracle_ohlc_cents", version)?; + let tx_count = PcoVec::forced_import(db, "oracle_tx_count", version)?; Ok(Self { - price: height_to_price, - ohlc: dateindex_to_ohlc, - tx_count: dateindex_to_tx_count, + price_cents, + ohlc_cents, + tx_count, }) } } diff --git a/crates/brk_computer/src/price/oracle/vecs.rs b/crates/brk_computer/src/price/oracle/vecs.rs index 3d8377aa9..ba2a71059 100644 --- a/crates/brk_computer/src/price/oracle/vecs.rs +++ b/crates/brk_computer/src/price/oracle/vecs.rs @@ -7,11 +7,11 @@ use vecdb::{BytesVec, PcoVec}; pub struct Vecs { /// Per-block price estimate in cents /// This enables OHLC derivation for any time period - pub price: PcoVec, + pub price_cents: PcoVec, /// Daily OHLC derived from height_to_price /// Uses BytesVec because OHLCCents is a complex type - pub ohlc: BytesVec, + pub ohlc_cents: BytesVec, /// Number of qualifying transactions per day (for confidence) pub tx_count: PcoVec, diff --git a/crates/brk_computer/src/transactions/size/import.rs b/crates/brk_computer/src/transactions/size/import.rs index b5d5cc614..c0873c5a7 100644 --- a/crates/brk_computer/src/transactions/size/import.rs +++ b/crates/brk_computer/src/transactions/size/import.rs @@ -14,7 +14,7 @@ impl Vecs { indexes: &indexes::Vecs, ) -> Result { let txindex_to_weight = LazyVecFrom2::init( - "weight", + "tx_weight", version, indexer.vecs.transactions.base_size.boxed_clone(), indexer.vecs.transactions.total_size.boxed_clone(), @@ -28,7 +28,7 @@ impl Vecs { ); let txindex_to_vsize = LazyVecFrom2::init( - "vsize", + "tx_vsize", version, indexer.vecs.transactions.base_size.boxed_clone(), indexer.vecs.transactions.total_size.boxed_clone(), diff --git a/modules/brk-client/index.js b/modules/brk-client/index.js index 3cbb5c4a6..46451c535 100644 --- a/modules/brk-client/index.js +++ b/modules/brk-client/index.js @@ -2902,59 +2902,6 @@ function createPrice111dSmaPattern(client, acc) { }; } -/** - * @typedef {Object} ActivePriceRatioPattern - * @property {MetricPattern4} ratio - * @property {MetricPattern4} ratio1mSma - * @property {MetricPattern4} ratio1wSma - * @property {Ratio1ySdPattern} ratio1ySd - * @property {Ratio1ySdPattern} ratio2ySd - * @property {Ratio1ySdPattern} ratio4ySd - * @property {MetricPattern4} ratioPct1 - * @property {MetricPattern4} ratioPct1Usd - * @property {MetricPattern4} ratioPct2 - * @property {MetricPattern4} ratioPct2Usd - * @property {MetricPattern4} ratioPct5 - * @property {MetricPattern4} ratioPct5Usd - * @property {MetricPattern4} ratioPct95 - * @property {MetricPattern4} ratioPct95Usd - * @property {MetricPattern4} ratioPct98 - * @property {MetricPattern4} ratioPct98Usd - * @property {MetricPattern4} ratioPct99 - * @property {MetricPattern4} ratioPct99Usd - * @property {Ratio1ySdPattern} ratioSd - */ - -/** - * Create a ActivePriceRatioPattern pattern node - * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name - * @returns {ActivePriceRatioPattern} - */ -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")), - ratioSd: createRatio1ySdPattern(client, acc), - }; -} - /** * @typedef {Object} PercentilesPattern * @property {MetricPattern4} pct05 @@ -3008,6 +2955,59 @@ function createPercentilesPattern(client, acc) { }; } +/** + * @typedef {Object} ActivePriceRatioPattern + * @property {MetricPattern4} ratio + * @property {MetricPattern4} ratio1mSma + * @property {MetricPattern4} ratio1wSma + * @property {Ratio1ySdPattern} ratio1ySd + * @property {Ratio1ySdPattern} ratio2ySd + * @property {Ratio1ySdPattern} ratio4ySd + * @property {MetricPattern4} ratioPct1 + * @property {MetricPattern4} ratioPct1Usd + * @property {MetricPattern4} ratioPct2 + * @property {MetricPattern4} ratioPct2Usd + * @property {MetricPattern4} ratioPct5 + * @property {MetricPattern4} ratioPct5Usd + * @property {MetricPattern4} ratioPct95 + * @property {MetricPattern4} ratioPct95Usd + * @property {MetricPattern4} ratioPct98 + * @property {MetricPattern4} ratioPct98Usd + * @property {MetricPattern4} ratioPct99 + * @property {MetricPattern4} ratioPct99Usd + * @property {Ratio1ySdPattern} ratioSd + */ + +/** + * Create a ActivePriceRatioPattern pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {ActivePriceRatioPattern} + */ +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")), + ratioSd: createRatio1ySdPattern(client, acc), + }; +} + /** * @typedef {Object} RelativePattern5 * @property {MetricPattern1} negUnrealizedLossRelToMarketCap @@ -3391,6 +3391,68 @@ function createDollarsPattern(client, acc) { }; } +/** + * @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"), + ), + }; +} + /** * @typedef {Object} RelativePattern2 * @property {MetricPattern1} negUnrealizedLossRelToOwnMarketCap @@ -3456,68 +3518,6 @@ function createRelativePattern2(client, acc) { }; } -/** - * @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"), - ), - }; -} - /** * @template T * @typedef {Object} CountPattern2 @@ -3690,28 +3690,57 @@ function create_0satsPattern(client, acc) { } /** - * @typedef {Object} _10yPattern + * @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, _p("10y", acc)), + _2y: createMetricPattern4(client, _p("2y", acc)), + _3y: createMetricPattern4(client, _p("3y", acc)), + _4y: createMetricPattern4(client, _p("4y", acc)), + _5y: createMetricPattern4(client, _p("5y", acc)), + _6y: createMetricPattern4(client, _p("6y", acc)), + _8y: createMetricPattern4(client, _p("8y", acc)), + }; +} + +/** + * @typedef {Object} _100btcPattern * @property {ActivityPattern2} activity * @property {CostBasisPattern} costBasis * @property {OutputsPattern} outputs - * @property {RealizedPattern4} realized + * @property {RealizedPattern} realized * @property {RelativePattern} relative * @property {SupplyPattern2} supply * @property {UnrealizedPattern} unrealized */ /** - * Create a _10yPattern pattern node + * Create a _100btcPattern pattern node * @param {BrkClientBase} client * @param {string} acc - Accumulated metric name - * @returns {_10yPattern} + * @returns {_100btcPattern} */ -function create_10yPattern(client, acc) { +function create_100btcPattern(client, acc) { return { activity: createActivityPattern2(client, acc), costBasis: createCostBasisPattern(client, acc), outputs: createOutputsPattern(client, _m(acc, "utxo_count")), - realized: createRealizedPattern4(client, acc), + realized: createRealizedPattern(client, acc), relative: createRelativePattern(client, acc), supply: createSupplyPattern2(client, _m(acc, "supply")), unrealized: createUnrealizedPattern(client, acc), @@ -3747,35 +3776,6 @@ function create_0satsPattern2(client, acc) { }; } -/** - * @typedef {Object} _100btcPattern - * @property {ActivityPattern2} activity - * @property {CostBasisPattern} costBasis - * @property {OutputsPattern} outputs - * @property {RealizedPattern} realized - * @property {RelativePattern} relative - * @property {SupplyPattern2} supply - * @property {UnrealizedPattern} unrealized - */ - -/** - * Create a _100btcPattern pattern node - * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name - * @returns {_100btcPattern} - */ -function create_100btcPattern(client, acc) { - return { - activity: createActivityPattern2(client, acc), - costBasis: createCostBasisPattern(client, acc), - outputs: createOutputsPattern(client, _m(acc, "utxo_count")), - realized: createRealizedPattern(client, acc), - relative: createRelativePattern(client, acc), - supply: createSupplyPattern2(client, _m(acc, "supply")), - unrealized: createUnrealizedPattern(client, acc), - }; -} - /** * @typedef {Object} UnrealizedPattern * @property {MetricPattern1} negUnrealizedLoss @@ -3850,31 +3850,31 @@ function create_10yTo12yPattern(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 + * @typedef {Object} _10yPattern + * @property {ActivityPattern2} activity + * @property {CostBasisPattern} costBasis + * @property {OutputsPattern} outputs + * @property {RealizedPattern4} realized + * @property {RelativePattern} relative + * @property {SupplyPattern2} supply + * @property {UnrealizedPattern} unrealized */ /** - * Create a PeriodCagrPattern pattern node + * Create a _10yPattern pattern node * @param {BrkClientBase} client * @param {string} acc - Accumulated metric name - * @returns {PeriodCagrPattern} + * @returns {_10yPattern} */ -function createPeriodCagrPattern(client, acc) { +function create_10yPattern(client, acc) { return { - _10y: createMetricPattern4(client, _p("10y", acc)), - _2y: createMetricPattern4(client, _p("2y", acc)), - _3y: createMetricPattern4(client, _p("3y", acc)), - _4y: createMetricPattern4(client, _p("4y", acc)), - _5y: createMetricPattern4(client, _p("5y", acc)), - _6y: createMetricPattern4(client, _p("6y", acc)), - _8y: createMetricPattern4(client, _p("8y", acc)), + activity: createActivityPattern2(client, acc), + costBasis: createCostBasisPattern(client, acc), + outputs: createOutputsPattern(client, _m(acc, "utxo_count")), + realized: createRealizedPattern4(client, acc), + relative: createRelativePattern(client, acc), + supply: createSupplyPattern2(client, _m(acc, "supply")), + unrealized: createUnrealizedPattern(client, acc), }; } @@ -3940,27 +3940,6 @@ function createSplitPattern2(client, acc) { }; } -/** - * @typedef {Object} CostBasisPattern2 - * @property {MetricPattern1} max - * @property {MetricPattern1} min - * @property {PercentilesPattern} percentiles - */ - -/** - * Create a CostBasisPattern2 pattern node - * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name - * @returns {CostBasisPattern2} - */ -function createCostBasisPattern2(client, acc) { - return { - max: createMetricPattern1(client, _m(acc, "max_cost_basis")), - min: createMetricPattern1(client, _m(acc, "min_cost_basis")), - percentiles: createPercentilesPattern(client, _m(acc, "cost_basis")), - }; -} - /** * @typedef {Object} UnclaimedRewardsPattern * @property {BitcoinPattern2} bitcoin @@ -4003,27 +3982,6 @@ function create_2015Pattern(client, acc) { }; } -/** - * @typedef {Object} ActiveSupplyPattern - * @property {MetricPattern1} bitcoin - * @property {MetricPattern1} dollars - * @property {MetricPattern1} sats - */ - -/** - * Create a ActiveSupplyPattern pattern node - * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name - * @returns {ActiveSupplyPattern} - */ -function createActiveSupplyPattern(client, acc) { - return { - bitcoin: createMetricPattern1(client, _m(acc, "btc")), - dollars: createMetricPattern1(client, _m(acc, "usd")), - sats: createMetricPattern1(client, acc), - }; -} - /** * @typedef {Object} CoinbasePattern * @property {BitcoinPattern} bitcoin @@ -4045,6 +4003,27 @@ function createCoinbasePattern(client, acc) { }; } +/** + * @typedef {Object} CostBasisPattern2 + * @property {MetricPattern1} max + * @property {MetricPattern1} min + * @property {PercentilesPattern} percentiles + */ + +/** + * Create a CostBasisPattern2 pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {CostBasisPattern2} + */ +function createCostBasisPattern2(client, acc) { + return { + max: createMetricPattern1(client, _m(acc, "max_cost_basis")), + min: createMetricPattern1(client, _m(acc, "min_cost_basis")), + percentiles: createPercentilesPattern(client, _m(acc, "cost_basis")), + }; +} + /** * @typedef {Object} SegwitAdoptionPattern * @property {MetricPattern11} base @@ -4066,6 +4045,27 @@ function createSegwitAdoptionPattern(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} CoinbasePattern2 * @property {BlockCountPattern} bitcoin @@ -4087,50 +4087,6 @@ function createCoinbasePattern2(client, acc) { }; } -/** - * @typedef {Object} RelativePattern4 - * @property {MetricPattern1} supplyInLossRelToOwnSupply - * @property {MetricPattern1} supplyInProfitRelToOwnSupply - */ - -/** - * Create a RelativePattern4 pattern node - * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name - * @returns {RelativePattern4} - */ -function createRelativePattern4(client, acc) { - return { - supplyInLossRelToOwnSupply: createMetricPattern1( - client, - _m(acc, "loss_rel_to_own_supply"), - ), - supplyInProfitRelToOwnSupply: createMetricPattern1( - client, - _m(acc, "profit_rel_to_own_supply"), - ), - }; -} - -/** - * @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} _1dReturns1mSdPattern * @property {MetricPattern4} sd @@ -4169,6 +4125,50 @@ function createSupplyPattern2(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 + * @property {MetricPattern1} supplyInProfitRelToOwnSupply + */ + +/** + * Create a RelativePattern4 pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {RelativePattern4} + */ +function createRelativePattern4(client, acc) { + return { + supplyInLossRelToOwnSupply: createMetricPattern1( + client, + _m(acc, "loss_rel_to_own_supply"), + ), + supplyInProfitRelToOwnSupply: createMetricPattern1( + client, + _m(acc, "profit_rel_to_own_supply"), + ), + }; +} + /** * @template T * @typedef {Object} SatsPattern @@ -4185,29 +4185,8 @@ function createSupplyPattern2(client, acc) { */ function createSatsPattern(client, acc) { return { - ohlc: createMetricPattern1(client, _m(acc, "ohlc")), - split: createSplitPattern2(client, acc), - }; -} - -/** - * @template T - * @typedef {Object} BitcoinPattern2 - * @property {MetricPattern2} cumulative - * @property {MetricPattern1} sum - */ - -/** - * Create a BitcoinPattern2 pattern node - * @template T - * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name - * @returns {BitcoinPattern2} - */ -function createBitcoinPattern2(client, acc) { - return { - cumulative: createMetricPattern2(client, _m(acc, "cumulative")), - sum: createMetricPattern1(client, acc), + ohlc: createMetricPattern1(client, _m(acc, "ohlc_sats")), + split: createSplitPattern2(client, _m(acc, "sats")), }; } @@ -4232,6 +4211,27 @@ function createBlockCountPattern(client, acc) { }; } +/** + * @template T + * @typedef {Object} BitcoinPattern2 + * @property {MetricPattern2} cumulative + * @property {MetricPattern1} sum + */ + +/** + * Create a BitcoinPattern2 pattern node + * @template T + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {BitcoinPattern2} + */ +function createBitcoinPattern2(client, acc) { + return { + cumulative: createMetricPattern2(client, _m(acc, "cumulative")), + sum: createMetricPattern1(client, acc), + }; +} + /** * @typedef {Object} OutputsPattern * @property {MetricPattern1} utxoCount @@ -5407,8 +5407,8 @@ function createRealizedPriceExtraPattern(client, acc) { /** * @typedef {Object} MetricsTree_Price_Oracle - * @property {MetricPattern6} ohlc - * @property {MetricPattern11} price + * @property {MetricPattern6} ohlcCents + * @property {MetricPattern11} priceCents * @property {MetricPattern6} txCount */ @@ -7616,9 +7616,9 @@ class BrkClient extends BrkClientBase { }, }, oracle: { - ohlc: createMetricPattern6(this, "oracle_dateindex_to_ohlc"), - price: createMetricPattern11(this, "oracle_height_to_price"), - txCount: createMetricPattern6(this, "oracle_dateindex_to_tx_count"), + ohlcCents: createMetricPattern6(this, "oracle_ohlc_cents"), + priceCents: createMetricPattern11(this, "orange_price_cents"), + txCount: createMetricPattern6(this, "oracle_tx_count"), }, sats: createSatsPattern(this, "price"), usd: createSatsPattern(this, "price"), @@ -7724,28 +7724,8 @@ class BrkClient extends BrkClientBase { isExplicitlyRbf: createMetricPattern27(this, "is_explicitly_rbf"), rawlocktime: createMetricPattern27(this, "rawlocktime"), size: { - vsize: { - average: createMetricPattern1(this, "tx_vsize_average"), - max: createMetricPattern1(this, "tx_vsize_max"), - median: createMetricPattern11(this, "tx_vsize_median"), - min: createMetricPattern1(this, "tx_vsize_min"), - pct10: createMetricPattern11(this, "tx_vsize_pct10"), - pct25: createMetricPattern11(this, "tx_vsize_pct25"), - pct75: createMetricPattern11(this, "tx_vsize_pct75"), - pct90: createMetricPattern11(this, "tx_vsize_pct90"), - txindex: createMetricPattern27(this, "vsize"), - }, - weight: { - average: createMetricPattern1(this, "tx_weight_average"), - max: createMetricPattern1(this, "tx_weight_max"), - median: createMetricPattern11(this, "tx_weight_median"), - min: createMetricPattern1(this, "tx_weight_min"), - pct10: createMetricPattern11(this, "tx_weight_pct10"), - pct25: createMetricPattern11(this, "tx_weight_pct25"), - pct75: createMetricPattern11(this, "tx_weight_pct75"), - pct90: createMetricPattern11(this, "tx_weight_pct90"), - txindex: createMetricPattern27(this, "weight"), - }, + vsize: createFeeRatePattern(this, "tx_vsize"), + weight: createFeeRatePattern(this, "tx_weight"), }, totalSize: createMetricPattern27(this, "total_size"), txid: createMetricPattern27(this, "txid"), diff --git a/packages/brk_client/brk_client/__init__.py b/packages/brk_client/brk_client/__init__.py index 0eb47ca86..b5d0802ef 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 -import json -from http.client import HTTPConnection, HTTPSConnection -from typing import ( - Any, - Generic, - List, - Literal, - Optional, - Protocol, - TypedDict, - TypeVar, - Union, - overload, -) +from typing import TypeVar, Generic, Any, Optional, List, Literal, TypedDict, Union, Protocol, overload +from http.client import HTTPSConnection, HTTPConnection from urllib.parse import urlparse +import json -T = TypeVar("T") +T = TypeVar('T') # Type definitions @@ -82,20 +71,7 @@ Open = Cents OpReturnIndex = TypeIndex OutPoint = int # Type (P2PKH, P2WPKH, P2SH, P2TR, etc.) -OutputType = Literal[ - "p2pk65", - "p2pk33", - "p2pkh", - "p2ms", - "p2sh", - "opreturn", - "p2wpkh", - "p2wsh", - "p2tr", - "p2a", - "empty", - "unknown", -] +OutputType = Literal["p2pk65", "p2pk33", "p2pkh", "p2ms", "p2sh", "opreturn", "p2wpkh", "p2wsh", "p2tr", "p2a", "empty", "unknown"] P2AAddressIndex = TypeIndex U8x2 = List[int] P2ABytes = U8x2 @@ -118,166 +94,7 @@ P2WPKHAddressIndex = TypeIndex P2WPKHBytes = U8x20 P2WSHAddressIndex = TypeIndex P2WSHBytes = U8x32 -PoolSlug = Literal[ - "unknown", - "blockfills", - "ultimuspool", - "terrapool", - "luxor", - "onethash", - "btccom", - "bitfarms", - "huobipool", - "wayicn", - "canoepool", - "btctop", - "bitcoincom", - "pool175btc", - "gbminers", - "axbt", - "asicminer", - "bitminter", - "bitcoinrussia", - "btcserv", - "simplecoinus", - "btcguild", - "eligius", - "ozcoin", - "eclipsemc", - "maxbtc", - "triplemining", - "coinlab", - "pool50btc", - "ghashio", - "stminingcorp", - "bitparking", - "mmpool", - "polmine", - "kncminer", - "bitalo", - "f2pool", - "hhtt", - "megabigpower", - "mtred", - "nmcbit", - "yourbtcnet", - "givemecoins", - "braiinspool", - "antpool", - "multicoinco", - "bcpoolio", - "cointerra", - "kanopool", - "solock", - "ckpool", - "nicehash", - "bitclub", - "bitcoinaffiliatenetwork", - "btcc", - "bwpool", - "exxbw", - "bitsolo", - "bitfury", - "twentyoneinc", - "digitalbtc", - "eightbaochi", - "mybtccoinpool", - "tbdice", - "hashpool", - "nexious", - "bravomining", - "hotpool", - "okexpool", - "bcmonster", - "onehash", - "bixin", - "tatmaspool", - "viabtc", - "connectbtc", - "batpool", - "waterhole", - "dcexploration", - "dcex", - "btpool", - "fiftyeightcoin", - "bitcoinindia", - "shawnp0wers", - "phashio", - "rigpool", - "haozhuzhu", - "sevenpool", - "miningkings", - "hashbx", - "dpool", - "rawpool", - "haominer", - "helix", - "bitcoinukraine", - "poolin", - "secretsuperstar", - "tigerpoolnet", - "sigmapoolcom", - "okpooltop", - "hummerpool", - "tangpool", - "bytepool", - "spiderpool", - "novablock", - "miningcity", - "binancepool", - "minerium", - "lubiancom", - "okkong", - "aaopool", - "emcdpool", - "foundryusa", - "sbicrypto", - "arkpool", - "purebtccom", - "marapool", - "kucoinpool", - "entrustcharitypool", - "okminer", - "titan", - "pegapool", - "btcnuggets", - "cloudhashing", - "digitalxmintsy", - "telco214", - "btcpoolparty", - "multipool", - "transactioncoinmining", - "btcdig", - "trickysbtcpool", - "btcmp", - "eobot", - "unomp", - "patels", - "gogreenlight", - "ekanembtc", - "canoe", - "tiger", - "onem1x", - "zulupool", - "secpool", - "ocean", - "whitepool", - "wk057", - "futurebitapollosolo", - "carbonnegative", - "portlandhodl", - "phoenix", - "neopool", - "maxipool", - "bitfufupool", - "luckypool", - "miningdutch", - "publicpool", - "miningsquared", - "innopolistech", - "btclab", - "parasite", -] +PoolSlug = Literal["unknown", "blockfills", "ultimuspool", "terrapool", "luxor", "onethash", "btccom", "bitfarms", "huobipool", "wayicn", "canoepool", "btctop", "bitcoincom", "pool175btc", "gbminers", "axbt", "asicminer", "bitminter", "bitcoinrussia", "btcserv", "simplecoinus", "btcguild", "eligius", "ozcoin", "eclipsemc", "maxbtc", "triplemining", "coinlab", "pool50btc", "ghashio", "stminingcorp", "bitparking", "mmpool", "polmine", "kncminer", "bitalo", "f2pool", "hhtt", "megabigpower", "mtred", "nmcbit", "yourbtcnet", "givemecoins", "braiinspool", "antpool", "multicoinco", "bcpoolio", "cointerra", "kanopool", "solock", "ckpool", "nicehash", "bitclub", "bitcoinaffiliatenetwork", "btcc", "bwpool", "exxbw", "bitsolo", "bitfury", "twentyoneinc", "digitalbtc", "eightbaochi", "mybtccoinpool", "tbdice", "hashpool", "nexious", "bravomining", "hotpool", "okexpool", "bcmonster", "onehash", "bixin", "tatmaspool", "viabtc", "connectbtc", "batpool", "waterhole", "dcexploration", "dcex", "btpool", "fiftyeightcoin", "bitcoinindia", "shawnp0wers", "phashio", "rigpool", "haozhuzhu", "sevenpool", "miningkings", "hashbx", "dpool", "rawpool", "haominer", "helix", "bitcoinukraine", "poolin", "secretsuperstar", "tigerpoolnet", "sigmapoolcom", "okpooltop", "hummerpool", "tangpool", "bytepool", "spiderpool", "novablock", "miningcity", "binancepool", "minerium", "lubiancom", "okkong", "aaopool", "emcdpool", "foundryusa", "sbicrypto", "arkpool", "purebtccom", "marapool", "kucoinpool", "entrustcharitypool", "okminer", "titan", "pegapool", "btcnuggets", "cloudhashing", "digitalxmintsy", "telco214", "btcpoolparty", "multipool", "transactioncoinmining", "btcdig", "trickysbtcpool", "btcmp", "eobot", "unomp", "patels", "gogreenlight", "ekanembtc", "canoe", "tiger", "onem1x", "zulupool", "secpool", "ocean", "whitepool", "wk057", "futurebitapollosolo", "carbonnegative", "portlandhodl", "phoenix", "neopool", "maxipool", "bitfufupool", "luckypool", "miningdutch", "publicpool", "miningsquared", "innopolistech", "btclab", "parasite"] QuarterIndex = int # Transaction locktime RawLockTime = int @@ -295,7 +112,7 @@ StoredU32 = int # Fixed-size 64-bit unsigned integer optimized for on-disk storage StoredU64 = int # Time period for mining statistics. -# +# # Used to specify the lookback window for pool statistics, hashrate calculations, # and other time-based mining metrics. TimePeriod = Literal["24h", "3d", "1w", "1m", "3m", "6m", "1y", "2y", "3y"] @@ -312,43 +129,13 @@ WeekIndex = int YearIndex = int # Aggregation dimension for querying metrics. Includes time-based (date, week, month, year), # block-based (height, txindex), and address/output type indexes. -Index = Literal[ - "dateindex", - "decadeindex", - "difficultyepoch", - "emptyoutputindex", - "halvingepoch", - "height", - "txinindex", - "monthindex", - "opreturnindex", - "txoutindex", - "p2aaddressindex", - "p2msoutputindex", - "p2pk33addressindex", - "p2pk65addressindex", - "p2pkhaddressindex", - "p2shaddressindex", - "p2traddressindex", - "p2wpkhaddressindex", - "p2wshaddressindex", - "quarterindex", - "semesterindex", - "txindex", - "unknownoutputindex", - "weekindex", - "yearindex", - "loadedaddressindex", - "emptyaddressindex", -] +Index = Literal["dateindex", "decadeindex", "difficultyepoch", "emptyoutputindex", "halvingepoch", "height", "txinindex", "monthindex", "opreturnindex", "txoutindex", "p2aaddressindex", "p2msoutputindex", "p2pk33addressindex", "p2pk65addressindex", "p2pkhaddressindex", "p2shaddressindex", "p2traddressindex", "p2wpkhaddressindex", "p2wshaddressindex", "quarterindex", "semesterindex", "txindex", "unknownoutputindex", "weekindex", "yearindex", "loadedaddressindex", "emptyaddressindex"] # Hierarchical tree node for organizing metrics into categories TreeNode = Union[dict[str, "TreeNode"], "MetricLeafWithSchema"] - - class AddressChainStats(TypedDict): """ Address statistics on the blockchain (confirmed transactions only) - + Based on mempool.space's format with type_index extension. Attributes: @@ -359,7 +146,6 @@ class AddressChainStats(TypedDict): tx_count: Total number of confirmed transactions involving this address type_index: Index of this address within its type on the blockchain """ - funded_txo_count: int funded_txo_sum: Sats spent_txo_count: int @@ -367,11 +153,10 @@ class AddressChainStats(TypedDict): tx_count: int type_index: TypeIndex - class AddressMempoolStats(TypedDict): """ Address statistics in the mempool (unconfirmed transactions only) - + Based on mempool.space's format. Attributes: @@ -381,18 +166,15 @@ class AddressMempoolStats(TypedDict): spent_txo_sum: Total amount in satoshis being spent in unconfirmed transactions tx_count: Number of unconfirmed transactions involving this address """ - funded_txo_count: int funded_txo_sum: Sats spent_txo_count: int spent_txo_sum: Sats tx_count: int - class AddressParam(TypedDict): address: Address - class AddressStats(TypedDict): """ Address information compatible with mempool.space API format @@ -402,23 +184,19 @@ class AddressStats(TypedDict): chain_stats: Statistics for confirmed transactions on the blockchain mempool_stats: Statistics for unconfirmed transactions in the mempool """ - address: Address chain_stats: AddressChainStats mempool_stats: Union[AddressMempoolStats, None] - class AddressTxidsParam(TypedDict): """ Attributes: after_txid: Txid to paginate from (return transactions before this one) limit: Maximum number of results to return. Defaults to 25 if not specified. """ - after_txid: Union[Txid, None] limit: int - class AddressValidation(TypedDict): """ Address validation result @@ -432,7 +210,6 @@ class AddressValidation(TypedDict): witness_version: Witness version (0 for P2WPKH/P2WSH, 1 for P2TR) witness_program: Witness program in hex """ - isvalid: bool address: Optional[str] scriptPubKey: Optional[str] @@ -441,52 +218,42 @@ class AddressValidation(TypedDict): witness_version: Optional[int] witness_program: Optional[str] - class BlockCountParam(TypedDict): """ Attributes: block_count: Number of recent blocks to include """ - block_count: int - class BlockFeesEntry(TypedDict): """ A single block fees data point. """ - avgHeight: Height timestamp: Timestamp avgFees: Sats - class BlockHashParam(TypedDict): hash: BlockHash - class BlockHashStartIndex(TypedDict): """ Attributes: hash: Bitcoin block hash start_index: Starting transaction index within the block (0-based) """ - hash: BlockHash start_index: TxIndex - class BlockHashTxIndex(TypedDict): """ Attributes: hash: Bitcoin block hash index: Transaction index within the block (0-based) """ - hash: BlockHash index: TxIndex - class BlockInfo(TypedDict): """ Block information returned by the API @@ -500,7 +267,6 @@ class BlockInfo(TypedDict): timestamp: Block timestamp (Unix time) difficulty: Block difficulty as a floating point number """ - id: BlockHash height: Height tx_count: int @@ -509,46 +275,37 @@ class BlockInfo(TypedDict): timestamp: Timestamp difficulty: float - class BlockRewardsEntry(TypedDict): """ A single block rewards data point. """ - avgHeight: int timestamp: int avgRewards: int - class BlockSizeEntry(TypedDict): """ A single block size data point. """ - avgHeight: int timestamp: int avgSize: int - class BlockWeightEntry(TypedDict): """ A single block weight data point. """ - avgHeight: int timestamp: int avgWeight: int - class BlockSizesWeights(TypedDict): """ Combined block sizes and weights response. """ - sizes: List[BlockSizeEntry] weights: List[BlockWeightEntry] - class BlockStatus(TypedDict): """ Block status indicating whether block is in the best chain @@ -558,12 +315,10 @@ class BlockStatus(TypedDict): height: Block height (only if in best chain) next_best: Hash of the next block in the best chain (only if in best chain and not tip) """ - in_best_chain: bool height: Union[Height, None] next_best: Union[BlockHash, None] - class BlockTimestamp(TypedDict): """ Block information returned for timestamp queries @@ -573,12 +328,10 @@ class BlockTimestamp(TypedDict): hash: Block hash timestamp: Block timestamp in ISO 8601 format """ - height: Height hash: BlockHash timestamp: str - class DataRangeFormat(TypedDict): """ Data range with output format for API query parameters @@ -589,13 +342,11 @@ class DataRangeFormat(TypedDict): limit: Maximum number of values to return (ignored if `end` is set) format: Format of the output """ - start: Optional[int] end: Optional[int] limit: Union[Limit, None] format: Format - class DifficultyAdjustment(TypedDict): """ Difficulty adjustment information. @@ -612,7 +363,6 @@ class DifficultyAdjustment(TypedDict): adjustedTimeAvg: Time-adjusted average (accounting for timestamp manipulation) timeOffset: Time offset from expected schedule (seconds) """ - progressPercent: float difficultyChange: float estimatedRetargetDate: int @@ -624,19 +374,16 @@ class DifficultyAdjustment(TypedDict): adjustedTimeAvg: int timeOffset: int - class DifficultyAdjustmentEntry(TypedDict): """ A single difficulty adjustment entry. Serializes as array: [timestamp, height, difficulty, change_percent] """ - timestamp: Timestamp height: Height difficulty: float change_percent: float - class DifficultyEntry(TypedDict): """ A single difficulty data point. @@ -646,12 +393,10 @@ class DifficultyEntry(TypedDict): difficulty: Difficulty value. height: Block height of the adjustment. """ - timestamp: Timestamp difficulty: float height: Height - class DiskUsage(TypedDict): """ Disk usage of the indexed data @@ -663,14 +408,12 @@ class DiskUsage(TypedDict): bitcoin_bytes: Bitcoin blocks directory size in bytes ratio: brk as percentage of Bitcoin data """ - brk: str brk_bytes: int bitcoin: str bitcoin_bytes: int ratio: float - class EmptyAddressData(TypedDict): """ Data of an empty address @@ -680,12 +423,10 @@ class EmptyAddressData(TypedDict): funded_txo_count: Total funded/spent transaction output count (equal since address is empty) transfered: Total satoshis transferred """ - tx_count: int funded_txo_count: int transfered: Sats - class HashrateEntry(TypedDict): """ A single hashrate data point. @@ -694,11 +435,9 @@ class HashrateEntry(TypedDict): timestamp: Unix timestamp. avgHashrate: Average hashrate (H/s). """ - timestamp: Timestamp avgHashrate: int - class HashrateSummary(TypedDict): """ Summary of network hashrate and difficulty data. @@ -709,13 +448,11 @@ class HashrateSummary(TypedDict): currentHashrate: Current network hashrate (H/s). currentDifficulty: Current network difficulty. """ - hashrates: List[HashrateEntry] difficulty: List[DifficultyEntry] currentHashrate: int currentDifficulty: float - class Health(TypedDict): """ Server health status @@ -724,18 +461,15 @@ class Health(TypedDict): started_at: Server start time (ISO 8601) uptime_seconds: Uptime in seconds """ - status: str service: str timestamp: str started_at: str uptime_seconds: int - class HeightParam(TypedDict): height: Height - class IndexInfo(TypedDict): """ Information about an available index and its query aliases @@ -744,15 +478,12 @@ class IndexInfo(TypedDict): index: The canonical index name aliases: All Accepted query aliases """ - index: Index aliases: List[str] - class LimitParam(TypedDict): limit: Limit - class LoadedAddressData(TypedDict): """ Data for a loaded (non-empty) address with current balance @@ -765,7 +496,6 @@ class LoadedAddressData(TypedDict): sent: Satoshis sent by this address realized_cap: The realized capitalization of this address """ - tx_count: int funded_txo_count: int spent_txo_count: int @@ -773,7 +503,6 @@ class LoadedAddressData(TypedDict): sent: Sats realized_cap: Dollars - class MempoolBlock(TypedDict): """ Block info in a mempool.space like format for fee estimation. @@ -786,7 +515,6 @@ class MempoolBlock(TypedDict): medianFee: Median fee rate in sat/vB feeRange: Fee rate range: [min, 10%, 25%, 50%, 75%, 90%, max] """ - blockSize: int blockVSize: float nTx: int @@ -794,7 +522,6 @@ class MempoolBlock(TypedDict): medianFee: FeeRate feeRange: List[FeeRate] - class MempoolInfo(TypedDict): """ Mempool statistics @@ -804,12 +531,10 @@ class MempoolInfo(TypedDict): vsize: Total virtual size of all transactions in the mempool (vbytes) total_fee: Total fees of all transactions in the mempool (satoshis) """ - count: int vsize: VSize total_fee: Sats - class MetricCount(TypedDict): """ Metric count statistics - distinct metrics and total metric-index combinations @@ -820,17 +545,14 @@ class MetricCount(TypedDict): lazy_endpoints: Number of lazy (computed on-the-fly) metric-index combinations stored_endpoints: Number of eager (stored on disk) metric-index combinations """ - distinct_metrics: int total_endpoints: int lazy_endpoints: int stored_endpoints: int - class MetricParam(TypedDict): metric: Metric - class MetricSelection(TypedDict): """ Selection of metrics to query @@ -843,7 +565,6 @@ class MetricSelection(TypedDict): limit: Maximum number of values to return (ignored if `end` is set) format: Format of the output """ - metrics: Metrics index: Index start: Optional[int] @@ -851,7 +572,6 @@ class MetricSelection(TypedDict): limit: Union[Limit, None] format: Format - class MetricSelectionLegacy(TypedDict): """ Legacy metric selection parameters (deprecated) @@ -862,7 +582,6 @@ class MetricSelectionLegacy(TypedDict): limit: Maximum number of values to return (ignored if `end` is set) format: Format of the output """ - index: Index ids: Metrics start: Optional[int] @@ -870,51 +589,42 @@ class MetricSelectionLegacy(TypedDict): limit: Union[Limit, None] format: Format - class MetricWithIndex(TypedDict): """ Attributes: metric: Metric name index: Aggregation index """ - metric: Metric index: Index - class OHLCCents(TypedDict): """ OHLC (Open, High, Low, Close) data in cents """ - open: Open high: High low: Low close: Close - class OHLCDollars(TypedDict): """ OHLC (Open, High, Low, Close) data in dollars """ - open: Open high: High low: Low close: Close - class OHLCSats(TypedDict): """ OHLC (Open, High, Low, Close) data in satoshis """ - open: Open high: High low: Low close: Close - class PaginatedMetrics(TypedDict): """ A paginated list of available metric names (1000 per page) @@ -924,12 +634,10 @@ class PaginatedMetrics(TypedDict): max_page: Maximum valid page index (0-indexed) metrics: List of metric names (max 1000 per page) """ - current_page: int max_page: int metrics: List[str] - class Pagination(TypedDict): """ Pagination parameters for paginated API endpoints @@ -937,10 +645,8 @@ class Pagination(TypedDict): Attributes: page: Pagination index """ - page: Optional[int] - class PoolBlockCounts(TypedDict): """ Block counts for different time periods @@ -950,12 +656,10 @@ class PoolBlockCounts(TypedDict): _24h: Blocks mined in last 24 hours _1w: Blocks mined in last week """ - all: int _24h: int _1w: int - class PoolBlockShares(TypedDict): """ Pool's share of total blocks for different time periods @@ -965,12 +669,10 @@ class PoolBlockShares(TypedDict): _24h: Share of blocks in last 24 hours _1w: Share of blocks in last week """ - all: float _24h: float _1w: float - class PoolDetailInfo(TypedDict): """ Pool information for detail view @@ -983,7 +685,6 @@ class PoolDetailInfo(TypedDict): regexes: Coinbase tag patterns (regexes) slug: URL-friendly pool identifier """ - id: int name: str link: str @@ -991,7 +692,6 @@ class PoolDetailInfo(TypedDict): regexes: List[str] slug: PoolSlug - class PoolDetail(TypedDict): """ Detailed pool information with statistics across time periods @@ -1003,14 +703,12 @@ class PoolDetail(TypedDict): estimatedHashrate: Estimated hashrate based on blocks mined reportedHashrate: Self-reported hashrate (if available) """ - pool: PoolDetailInfo blockCount: PoolBlockCounts blockShare: PoolBlockShares estimatedHashrate: int reportedHashrate: Optional[int] - class PoolInfo(TypedDict): """ Basic pool information for listing all pools @@ -1020,16 +718,13 @@ class PoolInfo(TypedDict): slug: URL-friendly pool identifier unique_id: Unique numeric pool identifier """ - name: str slug: PoolSlug unique_id: int - class PoolSlugParam(TypedDict): slug: PoolSlug - class PoolStats(TypedDict): """ Mining pool with block statistics for a time period @@ -1044,7 +739,6 @@ class PoolStats(TypedDict): slug: URL-friendly pool identifier share: Pool's share of total blocks (0.0 - 1.0) """ - poolId: int name: str link: str @@ -1054,7 +748,6 @@ class PoolStats(TypedDict): slug: PoolSlug share: float - class PoolsSummary(TypedDict): """ Mining pools response for a time period @@ -1064,12 +757,10 @@ class PoolsSummary(TypedDict): blockCount: Total blocks in the time period lastEstimatedHashrate: Estimated network hashrate (hashes per second) """ - pools: List[PoolStats] blockCount: int lastEstimatedHashrate: int - class RecommendedFees(TypedDict): """ Recommended fee rates in sat/vB @@ -1081,14 +772,12 @@ class RecommendedFees(TypedDict): economyFee: Fee rate for economical confirmation minimumFee: Minimum relay fee rate """ - fastestFee: FeeRate halfHourFee: FeeRate hourFee: FeeRate economyFee: FeeRate minimumFee: FeeRate - class RewardStats(TypedDict): """ Block reward statistics over a range of blocks @@ -1097,14 +786,12 @@ class RewardStats(TypedDict): startBlock: First block in the range endBlock: Last block in the range """ - startBlock: Height endBlock: Height totalReward: Sats totalFee: Sats totalTx: int - class SupplyState(TypedDict): """ Current supply state tracking UTXO count and total value @@ -1113,11 +800,9 @@ class SupplyState(TypedDict): utxo_count: Number of unspent transaction outputs value: Total value in satoshis """ - utxo_count: int value: Sats - class SyncStatus(TypedDict): """ Sync status of the indexer @@ -1129,22 +814,18 @@ class SyncStatus(TypedDict): last_indexed_at: Human-readable timestamp of the last indexed block (ISO 8601) last_indexed_at_unix: Unix timestamp of the last indexed block """ - indexed_height: Height tip_height: Height blocks_behind: Height last_indexed_at: str last_indexed_at_unix: Timestamp - class TimePeriodParam(TypedDict): time_period: TimePeriod - class TimestampParam(TypedDict): timestamp: Timestamp - class TxOut(TypedDict): """ Transaction output @@ -1153,11 +834,9 @@ class TxOut(TypedDict): scriptpubkey: Script pubkey (locking script) value: Value of the output in satoshis """ - scriptpubkey: str value: Sats - class TxIn(TypedDict): """ Transaction input @@ -1171,7 +850,6 @@ class TxIn(TypedDict): sequence: Input sequence number inner_redeemscript_asm: Inner redeemscript in assembly format (for P2SH-wrapped SegWit) """ - txid: Txid vout: Vout prevout: Union[TxOut, None] @@ -1181,7 +859,6 @@ class TxIn(TypedDict): sequence: int inner_redeemscript_asm: Optional[str] - class TxStatus(TypedDict): """ Transaction confirmation status @@ -1192,13 +869,11 @@ class TxStatus(TypedDict): block_hash: Block hash (only present if confirmed) block_time: Block timestamp (only present if confirmed) """ - confirmed: bool block_height: Union[Height, None] block_hash: Union[BlockHash, None] block_time: Union[Timestamp, None] - class Transaction(TypedDict): """ Transaction information compatible with mempool.space API format @@ -1211,7 +886,6 @@ class Transaction(TypedDict): vin: Transaction inputs vout: Transaction outputs """ - index: Union[TxIndex, None] txid: Txid version: TxVersion @@ -1224,7 +898,6 @@ class Transaction(TypedDict): vout: List[TxOut] status: TxStatus - class TxOutspend(TypedDict): """ Status of an output indicating whether it has been spent @@ -1235,17 +908,14 @@ class TxOutspend(TypedDict): vin: Input index in the spending transaction (only present if spent) status: Status of the spending transaction (only present if spent) """ - spent: bool txid: Union[Txid, None] vin: Union[Vin, None] status: Union[TxStatus, None] - class TxidParam(TypedDict): txid: Txid - class TxidVout(TypedDict): """ Transaction output reference (txid + output index) @@ -1254,31 +924,25 @@ class TxidVout(TypedDict): txid: Transaction ID vout: Output index """ - txid: Txid vout: Vout - class Utxo(TypedDict): """ Unspent transaction output """ - txid: Txid vout: Vout status: TxStatus value: Sats - class ValidateAddressParam(TypedDict): """ Attributes: address: Bitcoin address to validate (can be any string) """ - address: str - class MetricLeafWithSchema(TypedDict): """ MetricLeaf with JSON Schema for client generation @@ -1289,7 +953,6 @@ class MetricLeafWithSchema(TypedDict): indexes: Available indexes for this metric type: JSON Schema type (e.g., "integer", "number", "string", "boolean", "array", "object") """ - name: str kind: str indexes: List[Index] @@ -1310,7 +973,7 @@ class BrkClientBase: def __init__(self, base_url: str, timeout: float = 30.0): parsed = urlparse(base_url) self._host = parsed.netloc - self._secure = parsed.scheme == "https" + self._secure = parsed.scheme == 'https' self._timeout = timeout self._conn: Optional[Union[HTTPSConnection, HTTPConnection]] = None @@ -1360,8 +1023,7 @@ class BrkClientBase: def _m(acc: str, s: str) -> str: """Build metric name with suffix.""" - if not s: - return acc + if not s: return acc return f"{acc}_{s}" if acc else s @@ -1372,7 +1034,6 @@ def _p(prefix: str, acc: str) -> str: class MetricData(TypedDict, Generic[T]): """Metric data with range information.""" - total: int start: int end: int @@ -1385,21 +1046,14 @@ AnyMetricData = MetricData[Any] class _EndpointConfig: """Shared endpoint configuration.""" - client: BrkClientBase name: str index: Index start: Optional[int] end: Optional[int] - def __init__( - self, - client: BrkClientBase, - name: str, - index: Index, - start: Optional[int] = None, - end: Optional[int] = None, - ): + def __init__(self, client: BrkClientBase, name: str, index: Index, + start: Optional[int] = None, end: Optional[int] = None): self.client = client self.name = name self.index = index @@ -1425,7 +1079,7 @@ class _EndpointConfig: return self.client.get_json(self._build_path()) def get_csv(self) -> str: - return self.client.get_text(self._build_path(format="csv")) + return self.client.get_text(self._build_path(format='csv')) class RangeBuilder(Generic[T]): @@ -1467,15 +1121,10 @@ class SkippedBuilder(Generic[T]): def take(self, n: int) -> RangeBuilder[T]: """Take n items after the skipped position.""" start = self._config.start or 0 - return RangeBuilder( - _EndpointConfig( - self._config.client, - self._config.name, - self._config.index, - start, - start + n, - ) - ) + return RangeBuilder(_EndpointConfig( + self._config.client, self._config.name, self._config.index, + start, start + n + )) def fetch(self) -> MetricData[T]: """Fetch from skipped position to end.""" @@ -1520,9 +1169,7 @@ class MetricEndpointBuilder(Generic[T]): @overload def __getitem__(self, key: slice) -> RangeBuilder[T]: ... - def __getitem__( - self, key: Union[int, slice] - ) -> Union[SingleItemBuilder[T], RangeBuilder[T]]: + def __getitem__(self, key: Union[int, slice]) -> Union[SingleItemBuilder[T], RangeBuilder[T]]: """Access single item or slice. Examples: @@ -1532,49 +1179,36 @@ class MetricEndpointBuilder(Generic[T]): endpoint[100:110] # Range 100-109 """ if isinstance(key, int): - return SingleItemBuilder( - _EndpointConfig( - self._config.client, - self._config.name, - self._config.index, - key, - key + 1, - ) - ) - return RangeBuilder( - _EndpointConfig( - self._config.client, - self._config.name, - self._config.index, - key.start, - key.stop, - ) - ) + return SingleItemBuilder(_EndpointConfig( + self._config.client, self._config.name, self._config.index, + key, key + 1 + )) + return RangeBuilder(_EndpointConfig( + self._config.client, self._config.name, self._config.index, + key.start, key.stop + )) def head(self, n: int = 10) -> RangeBuilder[T]: """Get the first n items (pandas-style).""" - return RangeBuilder( - _EndpointConfig( - self._config.client, self._config.name, self._config.index, None, n - ) - ) + return RangeBuilder(_EndpointConfig( + self._config.client, self._config.name, self._config.index, + None, n + )) def tail(self, n: int = 10) -> RangeBuilder[T]: """Get the last n items (pandas-style).""" start, end = (None, 0) if n == 0 else (-n, None) - return RangeBuilder( - _EndpointConfig( - self._config.client, self._config.name, self._config.index, start, end - ) - ) + return RangeBuilder(_EndpointConfig( + self._config.client, self._config.name, self._config.index, + start, end + )) def skip(self, n: int) -> SkippedBuilder[T]: """Skip the first n items. Chain with take() to get a range.""" - return SkippedBuilder( - _EndpointConfig( - self._config.client, self._config.name, self._config.index, n, None - ) - ) + return SkippedBuilder(_EndpointConfig( + self._config.client, self._config.name, self._config.index, + n, None + )) def fetch(self) -> MetricData[T]: """Fetch all data as parsed JSON.""" @@ -1612,45 +1246,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) -> MetricEndpointBuilder[T]: - return MetricEndpointBuilder(self._client, self._name, "dateindex") + return MetricEndpointBuilder(self._client, self._name, 'dateindex') def decadeindex(self) -> MetricEndpointBuilder[T]: - return MetricEndpointBuilder(self._client, self._name, "decadeindex") + return MetricEndpointBuilder(self._client, self._name, 'decadeindex') def difficultyepoch(self) -> MetricEndpointBuilder[T]: - return MetricEndpointBuilder(self._client, self._name, "difficultyepoch") + return MetricEndpointBuilder(self._client, self._name, 'difficultyepoch') def height(self) -> MetricEndpointBuilder[T]: - return MetricEndpointBuilder(self._client, self._name, "height") + return MetricEndpointBuilder(self._client, self._name, 'height') def monthindex(self) -> MetricEndpointBuilder[T]: - return MetricEndpointBuilder(self._client, self._name, "monthindex") + return MetricEndpointBuilder(self._client, self._name, 'monthindex') def quarterindex(self) -> MetricEndpointBuilder[T]: - return MetricEndpointBuilder(self._client, self._name, "quarterindex") + return MetricEndpointBuilder(self._client, self._name, 'quarterindex') def semesterindex(self) -> MetricEndpointBuilder[T]: - return MetricEndpointBuilder(self._client, self._name, "semesterindex") + return MetricEndpointBuilder(self._client, self._name, 'semesterindex') def weekindex(self) -> MetricEndpointBuilder[T]: - return MetricEndpointBuilder(self._client, self._name, "weekindex") + return MetricEndpointBuilder(self._client, self._name, 'weekindex') def yearindex(self) -> MetricEndpointBuilder[T]: - return MetricEndpointBuilder(self._client, self._name, "yearindex") - + return MetricEndpointBuilder(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 @@ -1663,76 +1295,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: Index) -> Optional[MetricEndpointBuilder[T]]: """Get an endpoint builder 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) -> MetricEndpointBuilder[T]: - return MetricEndpointBuilder(self._client, self._name, "dateindex") + return MetricEndpointBuilder(self._client, self._name, 'dateindex') def decadeindex(self) -> MetricEndpointBuilder[T]: - return MetricEndpointBuilder(self._client, self._name, "decadeindex") + return MetricEndpointBuilder(self._client, self._name, 'decadeindex') def difficultyepoch(self) -> MetricEndpointBuilder[T]: - return MetricEndpointBuilder(self._client, self._name, "difficultyepoch") + return MetricEndpointBuilder(self._client, self._name, 'difficultyepoch') def monthindex(self) -> MetricEndpointBuilder[T]: - return MetricEndpointBuilder(self._client, self._name, "monthindex") + return MetricEndpointBuilder(self._client, self._name, 'monthindex') def quarterindex(self) -> MetricEndpointBuilder[T]: - return MetricEndpointBuilder(self._client, self._name, "quarterindex") + return MetricEndpointBuilder(self._client, self._name, 'quarterindex') def semesterindex(self) -> MetricEndpointBuilder[T]: - return MetricEndpointBuilder(self._client, self._name, "semesterindex") + return MetricEndpointBuilder(self._client, self._name, 'semesterindex') def weekindex(self) -> MetricEndpointBuilder[T]: - return MetricEndpointBuilder(self._client, self._name, "weekindex") + return MetricEndpointBuilder(self._client, self._name, 'weekindex') def yearindex(self) -> MetricEndpointBuilder[T]: - return MetricEndpointBuilder(self._client, self._name, "yearindex") - + return MetricEndpointBuilder(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 @@ -1745,73 +1356,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: Index) -> Optional[MetricEndpointBuilder[T]]: """Get an endpoint builder 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) -> MetricEndpointBuilder[T]: - return MetricEndpointBuilder(self._client, self._name, "dateindex") + return MetricEndpointBuilder(self._client, self._name, 'dateindex') def decadeindex(self) -> MetricEndpointBuilder[T]: - return MetricEndpointBuilder(self._client, self._name, "decadeindex") + return MetricEndpointBuilder(self._client, self._name, 'decadeindex') def height(self) -> MetricEndpointBuilder[T]: - return MetricEndpointBuilder(self._client, self._name, "height") + return MetricEndpointBuilder(self._client, self._name, 'height') def monthindex(self) -> MetricEndpointBuilder[T]: - return MetricEndpointBuilder(self._client, self._name, "monthindex") + return MetricEndpointBuilder(self._client, self._name, 'monthindex') def quarterindex(self) -> MetricEndpointBuilder[T]: - return MetricEndpointBuilder(self._client, self._name, "quarterindex") + return MetricEndpointBuilder(self._client, self._name, 'quarterindex') def semesterindex(self) -> MetricEndpointBuilder[T]: - return MetricEndpointBuilder(self._client, self._name, "semesterindex") + return MetricEndpointBuilder(self._client, self._name, 'semesterindex') def weekindex(self) -> MetricEndpointBuilder[T]: - return MetricEndpointBuilder(self._client, self._name, "weekindex") + return MetricEndpointBuilder(self._client, self._name, 'weekindex') def yearindex(self) -> MetricEndpointBuilder[T]: - return MetricEndpointBuilder(self._client, self._name, "yearindex") - + return MetricEndpointBuilder(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 @@ -1824,70 +1416,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: Index) -> Optional[MetricEndpointBuilder[T]]: """Get an endpoint builder 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) -> MetricEndpointBuilder[T]: - return MetricEndpointBuilder(self._client, self._name, "dateindex") + return MetricEndpointBuilder(self._client, self._name, 'dateindex') def decadeindex(self) -> MetricEndpointBuilder[T]: - return MetricEndpointBuilder(self._client, self._name, "decadeindex") + return MetricEndpointBuilder(self._client, self._name, 'decadeindex') def monthindex(self) -> MetricEndpointBuilder[T]: - return MetricEndpointBuilder(self._client, self._name, "monthindex") + return MetricEndpointBuilder(self._client, self._name, 'monthindex') def quarterindex(self) -> MetricEndpointBuilder[T]: - return MetricEndpointBuilder(self._client, self._name, "quarterindex") + return MetricEndpointBuilder(self._client, self._name, 'quarterindex') def semesterindex(self) -> MetricEndpointBuilder[T]: - return MetricEndpointBuilder(self._client, self._name, "semesterindex") + return MetricEndpointBuilder(self._client, self._name, 'semesterindex') def weekindex(self) -> MetricEndpointBuilder[T]: - return MetricEndpointBuilder(self._client, self._name, "weekindex") + return MetricEndpointBuilder(self._client, self._name, 'weekindex') def yearindex(self) -> MetricEndpointBuilder[T]: - return MetricEndpointBuilder(self._client, self._name, "yearindex") - + return MetricEndpointBuilder(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 @@ -1900,52 +1473,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: Index) -> Optional[MetricEndpointBuilder[T]]: """Get an endpoint builder 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) -> MetricEndpointBuilder[T]: - return MetricEndpointBuilder(self._client, self._name, "dateindex") + return MetricEndpointBuilder(self._client, self._name, 'dateindex') def height(self) -> MetricEndpointBuilder[T]: - return MetricEndpointBuilder(self._client, self._name, "height") - + return MetricEndpointBuilder(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 @@ -1958,31 +1514,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: Index) -> Optional[MetricEndpointBuilder[T]]: """Get an endpoint builder 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) -> MetricEndpointBuilder[T]: - return MetricEndpointBuilder(self._client, self._name, "dateindex") - + return MetricEndpointBuilder(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 @@ -1995,29 +1547,26 @@ class MetricPattern6(Generic[T]): def indexes(self) -> List[str]: """Get the list of available indexes.""" - return ["dateindex"] + return ['dateindex'] def get(self, index: Index) -> Optional[MetricEndpointBuilder[T]]: """Get an endpoint builder 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) -> MetricEndpointBuilder[T]: - return MetricEndpointBuilder(self._client, self._name, "decadeindex") - + return MetricEndpointBuilder(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 @@ -2030,29 +1579,26 @@ class MetricPattern7(Generic[T]): def indexes(self) -> List[str]: """Get the list of available indexes.""" - return ["decadeindex"] + return ['decadeindex'] def get(self, index: Index) -> Optional[MetricEndpointBuilder[T]]: """Get an endpoint builder 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) -> MetricEndpointBuilder[T]: - return MetricEndpointBuilder(self._client, self._name, "difficultyepoch") - + return MetricEndpointBuilder(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 @@ -2065,29 +1611,26 @@ class MetricPattern8(Generic[T]): def indexes(self) -> List[str]: """Get the list of available indexes.""" - return ["difficultyepoch"] + return ['difficultyepoch'] def get(self, index: Index) -> Optional[MetricEndpointBuilder[T]]: """Get an endpoint builder 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) -> MetricEndpointBuilder[T]: - return MetricEndpointBuilder(self._client, self._name, "emptyoutputindex") - + return MetricEndpointBuilder(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 @@ -2100,29 +1643,26 @@ class MetricPattern9(Generic[T]): def indexes(self) -> List[str]: """Get the list of available indexes.""" - return ["emptyoutputindex"] + return ['emptyoutputindex'] def get(self, index: Index) -> Optional[MetricEndpointBuilder[T]]: """Get an endpoint builder 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) -> MetricEndpointBuilder[T]: - return MetricEndpointBuilder(self._client, self._name, "halvingepoch") - + return MetricEndpointBuilder(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 @@ -2135,29 +1675,26 @@ class MetricPattern10(Generic[T]): def indexes(self) -> List[str]: """Get the list of available indexes.""" - return ["halvingepoch"] + return ['halvingepoch'] def get(self, index: Index) -> Optional[MetricEndpointBuilder[T]]: """Get an endpoint builder 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) -> MetricEndpointBuilder[T]: - return MetricEndpointBuilder(self._client, self._name, "height") - + return MetricEndpointBuilder(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 @@ -2170,29 +1707,26 @@ class MetricPattern11(Generic[T]): def indexes(self) -> List[str]: """Get the list of available indexes.""" - return ["height"] + return ['height'] def get(self, index: Index) -> Optional[MetricEndpointBuilder[T]]: """Get an endpoint builder 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) -> MetricEndpointBuilder[T]: - return MetricEndpointBuilder(self._client, self._name, "txinindex") - + return MetricEndpointBuilder(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 @@ -2205,29 +1739,26 @@ class MetricPattern12(Generic[T]): def indexes(self) -> List[str]: """Get the list of available indexes.""" - return ["txinindex"] + return ['txinindex'] def get(self, index: Index) -> Optional[MetricEndpointBuilder[T]]: """Get an endpoint builder 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) -> MetricEndpointBuilder[T]: - return MetricEndpointBuilder(self._client, self._name, "monthindex") - + return MetricEndpointBuilder(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 @@ -2240,29 +1771,26 @@ class MetricPattern13(Generic[T]): def indexes(self) -> List[str]: """Get the list of available indexes.""" - return ["monthindex"] + return ['monthindex'] def get(self, index: Index) -> Optional[MetricEndpointBuilder[T]]: """Get an endpoint builder 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) -> MetricEndpointBuilder[T]: - return MetricEndpointBuilder(self._client, self._name, "opreturnindex") - + return MetricEndpointBuilder(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 @@ -2275,29 +1803,26 @@ class MetricPattern14(Generic[T]): def indexes(self) -> List[str]: """Get the list of available indexes.""" - return ["opreturnindex"] + return ['opreturnindex'] def get(self, index: Index) -> Optional[MetricEndpointBuilder[T]]: """Get an endpoint builder 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) -> MetricEndpointBuilder[T]: - return MetricEndpointBuilder(self._client, self._name, "txoutindex") - + return MetricEndpointBuilder(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 @@ -2310,29 +1835,26 @@ class MetricPattern15(Generic[T]): def indexes(self) -> List[str]: """Get the list of available indexes.""" - return ["txoutindex"] + return ['txoutindex'] def get(self, index: Index) -> Optional[MetricEndpointBuilder[T]]: """Get an endpoint builder 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) -> MetricEndpointBuilder[T]: - return MetricEndpointBuilder(self._client, self._name, "p2aaddressindex") - + return MetricEndpointBuilder(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 @@ -2345,29 +1867,26 @@ class MetricPattern16(Generic[T]): def indexes(self) -> List[str]: """Get the list of available indexes.""" - return ["p2aaddressindex"] + return ['p2aaddressindex'] def get(self, index: Index) -> Optional[MetricEndpointBuilder[T]]: """Get an endpoint builder 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) -> MetricEndpointBuilder[T]: - return MetricEndpointBuilder(self._client, self._name, "p2msoutputindex") - + return MetricEndpointBuilder(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 @@ -2380,29 +1899,26 @@ class MetricPattern17(Generic[T]): def indexes(self) -> List[str]: """Get the list of available indexes.""" - return ["p2msoutputindex"] + return ['p2msoutputindex'] def get(self, index: Index) -> Optional[MetricEndpointBuilder[T]]: """Get an endpoint builder 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) -> MetricEndpointBuilder[T]: - return MetricEndpointBuilder(self._client, self._name, "p2pk33addressindex") - + return MetricEndpointBuilder(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 @@ -2415,29 +1931,26 @@ class MetricPattern18(Generic[T]): def indexes(self) -> List[str]: """Get the list of available indexes.""" - return ["p2pk33addressindex"] + return ['p2pk33addressindex'] def get(self, index: Index) -> Optional[MetricEndpointBuilder[T]]: """Get an endpoint builder 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) -> MetricEndpointBuilder[T]: - return MetricEndpointBuilder(self._client, self._name, "p2pk65addressindex") - + return MetricEndpointBuilder(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 @@ -2450,29 +1963,26 @@ class MetricPattern19(Generic[T]): def indexes(self) -> List[str]: """Get the list of available indexes.""" - return ["p2pk65addressindex"] + return ['p2pk65addressindex'] def get(self, index: Index) -> Optional[MetricEndpointBuilder[T]]: """Get an endpoint builder 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) -> MetricEndpointBuilder[T]: - return MetricEndpointBuilder(self._client, self._name, "p2pkhaddressindex") - + return MetricEndpointBuilder(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 @@ -2485,29 +1995,26 @@ class MetricPattern20(Generic[T]): def indexes(self) -> List[str]: """Get the list of available indexes.""" - return ["p2pkhaddressindex"] + return ['p2pkhaddressindex'] def get(self, index: Index) -> Optional[MetricEndpointBuilder[T]]: """Get an endpoint builder 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) -> MetricEndpointBuilder[T]: - return MetricEndpointBuilder(self._client, self._name, "p2shaddressindex") - + return MetricEndpointBuilder(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 @@ -2520,29 +2027,26 @@ class MetricPattern21(Generic[T]): def indexes(self) -> List[str]: """Get the list of available indexes.""" - return ["p2shaddressindex"] + return ['p2shaddressindex'] def get(self, index: Index) -> Optional[MetricEndpointBuilder[T]]: """Get an endpoint builder 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) -> MetricEndpointBuilder[T]: - return MetricEndpointBuilder(self._client, self._name, "p2traddressindex") - + return MetricEndpointBuilder(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 @@ -2555,29 +2059,26 @@ class MetricPattern22(Generic[T]): def indexes(self) -> List[str]: """Get the list of available indexes.""" - return ["p2traddressindex"] + return ['p2traddressindex'] def get(self, index: Index) -> Optional[MetricEndpointBuilder[T]]: """Get an endpoint builder 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) -> MetricEndpointBuilder[T]: - return MetricEndpointBuilder(self._client, self._name, "p2wpkhaddressindex") - + return MetricEndpointBuilder(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 @@ -2590,29 +2091,26 @@ class MetricPattern23(Generic[T]): def indexes(self) -> List[str]: """Get the list of available indexes.""" - return ["p2wpkhaddressindex"] + return ['p2wpkhaddressindex'] def get(self, index: Index) -> Optional[MetricEndpointBuilder[T]]: """Get an endpoint builder 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) -> MetricEndpointBuilder[T]: - return MetricEndpointBuilder(self._client, self._name, "p2wshaddressindex") - + return MetricEndpointBuilder(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 @@ -2625,29 +2123,26 @@ class MetricPattern24(Generic[T]): def indexes(self) -> List[str]: """Get the list of available indexes.""" - return ["p2wshaddressindex"] + return ['p2wshaddressindex'] def get(self, index: Index) -> Optional[MetricEndpointBuilder[T]]: """Get an endpoint builder 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) -> MetricEndpointBuilder[T]: - return MetricEndpointBuilder(self._client, self._name, "quarterindex") - + return MetricEndpointBuilder(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 @@ -2660,29 +2155,26 @@ class MetricPattern25(Generic[T]): def indexes(self) -> List[str]: """Get the list of available indexes.""" - return ["quarterindex"] + return ['quarterindex'] def get(self, index: Index) -> Optional[MetricEndpointBuilder[T]]: """Get an endpoint builder 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) -> MetricEndpointBuilder[T]: - return MetricEndpointBuilder(self._client, self._name, "semesterindex") - + return MetricEndpointBuilder(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 @@ -2695,29 +2187,26 @@ class MetricPattern26(Generic[T]): def indexes(self) -> List[str]: """Get the list of available indexes.""" - return ["semesterindex"] + return ['semesterindex'] def get(self, index: Index) -> Optional[MetricEndpointBuilder[T]]: """Get an endpoint builder 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) -> MetricEndpointBuilder[T]: - return MetricEndpointBuilder(self._client, self._name, "txindex") - + return MetricEndpointBuilder(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 @@ -2730,29 +2219,26 @@ class MetricPattern27(Generic[T]): def indexes(self) -> List[str]: """Get the list of available indexes.""" - return ["txindex"] + return ['txindex'] def get(self, index: Index) -> Optional[MetricEndpointBuilder[T]]: """Get an endpoint builder 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) -> MetricEndpointBuilder[T]: - return MetricEndpointBuilder(self._client, self._name, "unknownoutputindex") - + return MetricEndpointBuilder(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 @@ -2765,29 +2251,26 @@ class MetricPattern28(Generic[T]): def indexes(self) -> List[str]: """Get the list of available indexes.""" - return ["unknownoutputindex"] + return ['unknownoutputindex'] def get(self, index: Index) -> Optional[MetricEndpointBuilder[T]]: """Get an endpoint builder 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) -> MetricEndpointBuilder[T]: - return MetricEndpointBuilder(self._client, self._name, "weekindex") - + return MetricEndpointBuilder(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 @@ -2800,29 +2283,26 @@ class MetricPattern29(Generic[T]): def indexes(self) -> List[str]: """Get the list of available indexes.""" - return ["weekindex"] + return ['weekindex'] def get(self, index: Index) -> Optional[MetricEndpointBuilder[T]]: """Get an endpoint builder 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) -> MetricEndpointBuilder[T]: - return MetricEndpointBuilder(self._client, self._name, "yearindex") - + return MetricEndpointBuilder(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 @@ -2835,29 +2315,26 @@ class MetricPattern30(Generic[T]): def indexes(self) -> List[str]: """Get the list of available indexes.""" - return ["yearindex"] + return ['yearindex'] def get(self, index: Index) -> Optional[MetricEndpointBuilder[T]]: """Get an endpoint builder 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) -> MetricEndpointBuilder[T]: - return MetricEndpointBuilder(self._client, self._name, "loadedaddressindex") - + return MetricEndpointBuilder(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 @@ -2870,29 +2347,26 @@ class MetricPattern31(Generic[T]): def indexes(self) -> List[str]: """Get the list of available indexes.""" - return ["loadedaddressindex"] + return ['loadedaddressindex'] def get(self, index: Index) -> Optional[MetricEndpointBuilder[T]]: """Get an endpoint builder 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) -> MetricEndpointBuilder[T]: - return MetricEndpointBuilder(self._client, self._name, "emptyaddressindex") - + return MetricEndpointBuilder(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 @@ -2905,3656 +2379,2131 @@ class MetricPattern32(Generic[T]): def indexes(self) -> List[str]: """Get the list of available indexes.""" - return ["emptyaddressindex"] + return ['emptyaddressindex'] def get(self, index: Index) -> Optional[MetricEndpointBuilder[T]]: """Get an endpoint builder 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: BitcoinPattern2[Dollars] = BitcoinPattern2( - 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: BitcoinPattern2[Dollars] = BitcoinPattern2(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: BitcoinPattern2[Dollars] = BitcoinPattern2( - 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_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_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: BitcoinPattern2[Dollars] = BitcoinPattern2(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_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_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: BitcoinPattern2[Dollars] = BitcoinPattern2( - 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: BitcoinPattern2[Dollars] = BitcoinPattern2(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: BitcoinPattern2[Dollars] = BitcoinPattern2( - 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_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_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: BitcoinPattern2[Dollars] = BitcoinPattern2(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_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_value: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'realized_value')) + self.sell_side_risk_ratio: MetricPattern6[StoredF32] = MetricPattern6(client, _m(acc, 'sell_side_risk_ratio')) + self.sell_side_risk_ratio_30d_ema: MetricPattern6[StoredF32] = MetricPattern6(client, _m(acc, 'sell_side_risk_ratio_30d_ema')) + self.sell_side_risk_ratio_7d_ema: MetricPattern6[StoredF32] = MetricPattern6(client, _m(acc, 'sell_side_risk_ratio_7d_ema')) + self.sopr: MetricPattern6[StoredF64] = MetricPattern6(client, _m(acc, 'sopr')) + self.sopr_30d_ema: MetricPattern6[StoredF64] = MetricPattern6(client, _m(acc, 'sopr_30d_ema')) + self.sopr_7d_ema: MetricPattern6[StoredF64] = MetricPattern6(client, _m(acc, 'sopr_7d_ema')) + self.total_realized_pnl: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'total_realized_pnl')) + self.value_created: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'value_created')) + self.value_destroyed: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'value_destroyed')) class Price111dSmaPattern: """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" self.price: MetricPattern4[Dollars] = MetricPattern4(client, acc) - self.ratio: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, "ratio")) - self.ratio_1m_sma: MetricPattern4[StoredF32] = MetricPattern4( - client, _m(acc, "ratio_1m_sma") - ) - self.ratio_1w_sma: MetricPattern4[StoredF32] = MetricPattern4( - client, _m(acc, "ratio_1w_sma") - ) - self.ratio_1y_sd: Ratio1ySdPattern = Ratio1ySdPattern( - client, _m(acc, "ratio_1y") - ) - self.ratio_2y_sd: Ratio1ySdPattern = Ratio1ySdPattern( - client, _m(acc, "ratio_2y") - ) - self.ratio_4y_sd: Ratio1ySdPattern = Ratio1ySdPattern( - client, _m(acc, "ratio_4y") - ) - self.ratio_pct1: MetricPattern4[StoredF32] = MetricPattern4( - client, _m(acc, "ratio_pct1") - ) - self.ratio_pct1_usd: MetricPattern4[Dollars] = MetricPattern4( - client, _m(acc, "ratio_pct1_usd") - ) - self.ratio_pct2: MetricPattern4[StoredF32] = MetricPattern4( - client, _m(acc, "ratio_pct2") - ) - self.ratio_pct2_usd: MetricPattern4[Dollars] = MetricPattern4( - client, _m(acc, "ratio_pct2_usd") - ) - self.ratio_pct5: MetricPattern4[StoredF32] = MetricPattern4( - client, _m(acc, "ratio_pct5") - ) - self.ratio_pct5_usd: MetricPattern4[Dollars] = MetricPattern4( - client, _m(acc, "ratio_pct5_usd") - ) - self.ratio_pct95: MetricPattern4[StoredF32] = MetricPattern4( - client, _m(acc, "ratio_pct95") - ) - self.ratio_pct95_usd: MetricPattern4[Dollars] = MetricPattern4( - client, _m(acc, "ratio_pct95_usd") - ) - self.ratio_pct98: MetricPattern4[StoredF32] = MetricPattern4( - client, _m(acc, "ratio_pct98") - ) - self.ratio_pct98_usd: MetricPattern4[Dollars] = MetricPattern4( - client, _m(acc, "ratio_pct98_usd") - ) - self.ratio_pct99: MetricPattern4[StoredF32] = MetricPattern4( - client, _m(acc, "ratio_pct99") - ) - self.ratio_pct99_usd: MetricPattern4[Dollars] = MetricPattern4( - client, _m(acc, "ratio_pct99_usd") - ) - self.ratio_sd: Ratio1ySdPattern = Ratio1ySdPattern(client, _m(acc, "ratio")) - - -class 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_sd: Ratio1ySdPattern = Ratio1ySdPattern(client, acc) - + self.ratio: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'ratio')) + self.ratio_1m_sma: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'ratio_1m_sma')) + self.ratio_1w_sma: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'ratio_1w_sma')) + self.ratio_1y_sd: Ratio1ySdPattern = Ratio1ySdPattern(client, _m(acc, 'ratio_1y')) + self.ratio_2y_sd: Ratio1ySdPattern = Ratio1ySdPattern(client, _m(acc, 'ratio_2y')) + self.ratio_4y_sd: Ratio1ySdPattern = Ratio1ySdPattern(client, _m(acc, 'ratio_4y')) + self.ratio_pct1: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'ratio_pct1')) + self.ratio_pct1_usd: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'ratio_pct1_usd')) + self.ratio_pct2: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'ratio_pct2')) + self.ratio_pct2_usd: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'ratio_pct2_usd')) + self.ratio_pct5: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'ratio_pct5')) + self.ratio_pct5_usd: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'ratio_pct5_usd')) + self.ratio_pct95: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'ratio_pct95')) + self.ratio_pct95_usd: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'ratio_pct95_usd')) + self.ratio_pct98: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'ratio_pct98')) + self.ratio_pct98_usd: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'ratio_pct98_usd')) + self.ratio_pct99: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'ratio_pct99')) + self.ratio_pct99_usd: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'ratio_pct99_usd')) + self.ratio_sd: Ratio1ySdPattern = Ratio1ySdPattern(client, _m(acc, 'ratio')) class PercentilesPattern: """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.pct05: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, "pct05")) - self.pct10: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, "pct10")) - self.pct15: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, "pct15")) - self.pct20: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, "pct20")) - self.pct25: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, "pct25")) - self.pct30: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, "pct30")) - self.pct35: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, "pct35")) - self.pct40: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, "pct40")) - self.pct45: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, "pct45")) - self.pct50: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, "pct50")) - self.pct55: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, "pct55")) - self.pct60: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, "pct60")) - self.pct65: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, "pct65")) - self.pct70: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, "pct70")) - self.pct75: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, "pct75")) - self.pct80: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, "pct80")) - self.pct85: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, "pct85")) - self.pct90: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, "pct90")) - self.pct95: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, "pct95")) + self.pct05: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'pct05')) + self.pct10: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'pct10')) + self.pct15: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'pct15')) + self.pct20: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'pct20')) + self.pct25: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'pct25')) + self.pct30: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'pct30')) + self.pct35: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'pct35')) + self.pct40: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'pct40')) + self.pct45: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'pct45')) + self.pct50: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'pct50')) + self.pct55: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'pct55')) + self.pct60: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'pct60')) + self.pct65: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'pct65')) + self.pct70: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'pct70')) + self.pct75: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'pct75')) + self.pct80: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'pct80')) + self.pct85: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'pct85')) + self.pct90: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'pct90')) + self.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_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, acc: str): """Create pattern node with accumulated metric name.""" - self._10y: MetricPattern4[T] = MetricPattern4(client, _m(acc, "10y_ago")) - self._1d: MetricPattern4[T] = MetricPattern4(client, _m(acc, "1d_ago")) - self._1m: MetricPattern4[T] = MetricPattern4(client, _m(acc, "1m_ago")) - self._1w: MetricPattern4[T] = MetricPattern4(client, _m(acc, "1w_ago")) - self._1y: MetricPattern4[T] = MetricPattern4(client, _m(acc, "1y_ago")) - self._2y: MetricPattern4[T] = MetricPattern4(client, _m(acc, "2y_ago")) - self._3m: MetricPattern4[T] = MetricPattern4(client, _m(acc, "3m_ago")) - self._3y: MetricPattern4[T] = MetricPattern4(client, _m(acc, "3y_ago")) - self._4y: MetricPattern4[T] = MetricPattern4(client, _m(acc, "4y_ago")) - self._5y: MetricPattern4[T] = MetricPattern4(client, _m(acc, "5y_ago")) - self._6m: MetricPattern4[T] = MetricPattern4(client, _m(acc, "6m_ago")) - self._6y: MetricPattern4[T] = MetricPattern4(client, _m(acc, "6y_ago")) - self._8y: MetricPattern4[T] = MetricPattern4(client, _m(acc, "8y_ago")) - + self._10y: MetricPattern4[T] = MetricPattern4(client, _m(acc, '10y_ago')) + self._1d: MetricPattern4[T] = MetricPattern4(client, _m(acc, '1d_ago')) + self._1m: MetricPattern4[T] = MetricPattern4(client, _m(acc, '1m_ago')) + self._1w: MetricPattern4[T] = MetricPattern4(client, _m(acc, '1w_ago')) + self._1y: MetricPattern4[T] = MetricPattern4(client, _m(acc, '1y_ago')) + self._2y: MetricPattern4[T] = MetricPattern4(client, _m(acc, '2y_ago')) + self._3m: MetricPattern4[T] = MetricPattern4(client, _m(acc, '3m_ago')) + self._3y: MetricPattern4[T] = MetricPattern4(client, _m(acc, '3y_ago')) + self._4y: MetricPattern4[T] = MetricPattern4(client, _m(acc, '4y_ago')) + self._5y: MetricPattern4[T] = MetricPattern4(client, _m(acc, '5y_ago')) + self._6m: MetricPattern4[T] = MetricPattern4(client, _m(acc, '6m_ago')) + self._6y: MetricPattern4[T] = MetricPattern4(client, _m(acc, '6y_ago')) + self._8y: MetricPattern4[T] = MetricPattern4(client, _m(acc, '8y_ago')) 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, _p("10y", acc)) - self._1m: _2015Pattern = _2015Pattern(client, _p("1m", acc)) - self._1w: _2015Pattern = _2015Pattern(client, _p("1w", acc)) - self._1y: _2015Pattern = _2015Pattern(client, _p("1y", acc)) - self._2y: _2015Pattern = _2015Pattern(client, _p("2y", acc)) - self._3m: _2015Pattern = _2015Pattern(client, _p("3m", acc)) - self._3y: _2015Pattern = _2015Pattern(client, _p("3y", acc)) - self._4y: _2015Pattern = _2015Pattern(client, _p("4y", acc)) - self._5y: _2015Pattern = _2015Pattern(client, _p("5y", acc)) - self._6m: _2015Pattern = _2015Pattern(client, _p("6m", acc)) - self._6y: _2015Pattern = _2015Pattern(client, _p("6y", acc)) - self._8y: _2015Pattern = _2015Pattern(client, _p("8y", acc)) - + self._10y: _2015Pattern = _2015Pattern(client, _p('10y', acc)) + self._1m: _2015Pattern = _2015Pattern(client, _p('1m', acc)) + self._1w: _2015Pattern = _2015Pattern(client, _p('1w', acc)) + self._1y: _2015Pattern = _2015Pattern(client, _p('1y', acc)) + self._2y: _2015Pattern = _2015Pattern(client, _p('2y', acc)) + self._3m: _2015Pattern = _2015Pattern(client, _p('3m', acc)) + self._3y: _2015Pattern = _2015Pattern(client, _p('3y', acc)) + self._4y: _2015Pattern = _2015Pattern(client, _p('4y', acc)) + self._5y: _2015Pattern = _2015Pattern(client, _p('5y', acc)) + self._6m: _2015Pattern = _2015Pattern(client, _p('6m', acc)) + self._6y: _2015Pattern = _2015Pattern(client, _p('6y', acc)) + self._8y: _2015Pattern = _2015Pattern(client, _p('8y', acc)) 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, _p("10y", acc)) - self._1m: MetricPattern4[T] = MetricPattern4(client, _p("1m", acc)) - self._1w: MetricPattern4[T] = MetricPattern4(client, _p("1w", acc)) - self._1y: MetricPattern4[T] = MetricPattern4(client, _p("1y", acc)) - self._2y: MetricPattern4[T] = MetricPattern4(client, _p("2y", acc)) - self._3m: MetricPattern4[T] = MetricPattern4(client, _p("3m", acc)) - self._3y: MetricPattern4[T] = MetricPattern4(client, _p("3y", acc)) - self._4y: MetricPattern4[T] = MetricPattern4(client, _p("4y", acc)) - self._5y: MetricPattern4[T] = MetricPattern4(client, _p("5y", acc)) - self._6m: MetricPattern4[T] = MetricPattern4(client, _p("6m", acc)) - self._6y: MetricPattern4[T] = MetricPattern4(client, _p("6y", acc)) - self._8y: MetricPattern4[T] = MetricPattern4(client, _p("8y", acc)) - + self._10y: MetricPattern4[T] = MetricPattern4(client, _p('10y', acc)) + self._1m: MetricPattern4[T] = MetricPattern4(client, _p('1m', acc)) + self._1w: MetricPattern4[T] = MetricPattern4(client, _p('1w', acc)) + self._1y: MetricPattern4[T] = MetricPattern4(client, _p('1y', acc)) + self._2y: MetricPattern4[T] = MetricPattern4(client, _p('2y', acc)) + self._3m: MetricPattern4[T] = MetricPattern4(client, _p('3m', acc)) + self._3y: MetricPattern4[T] = MetricPattern4(client, _p('3y', acc)) + self._4y: MetricPattern4[T] = MetricPattern4(client, _p('4y', acc)) + self._5y: MetricPattern4[T] = MetricPattern4(client, _p('5y', acc)) + self._6m: MetricPattern4[T] = MetricPattern4(client, _p('6m', acc)) + self._6y: MetricPattern4[T] = MetricPattern4(client, _p('6y', acc)) + self._8y: MetricPattern4[T] = MetricPattern4(client, _p('8y', acc)) class BitcoinPattern: """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.average: MetricPattern2[Bitcoin] = MetricPattern2( - client, _m(acc, "average") - ) + self.average: MetricPattern2[Bitcoin] = MetricPattern2(client, _m(acc, 'average')) self.base: MetricPattern11[Bitcoin] = MetricPattern11(client, acc) - self.cumulative: MetricPattern2[Bitcoin] = MetricPattern2( - client, _m(acc, "cumulative") - ) - self.max: MetricPattern2[Bitcoin] = MetricPattern2(client, _m(acc, "max")) - self.median: MetricPattern6[Bitcoin] = MetricPattern6(client, _m(acc, "median")) - self.min: MetricPattern2[Bitcoin] = MetricPattern2(client, _m(acc, "min")) - self.pct10: MetricPattern6[Bitcoin] = MetricPattern6(client, _m(acc, "pct10")) - self.pct25: MetricPattern6[Bitcoin] = MetricPattern6(client, _m(acc, "pct25")) - self.pct75: MetricPattern6[Bitcoin] = MetricPattern6(client, _m(acc, "pct75")) - self.pct90: MetricPattern6[Bitcoin] = MetricPattern6(client, _m(acc, "pct90")) - self.sum: MetricPattern2[Bitcoin] = MetricPattern2(client, _m(acc, "sum")) - + self.cumulative: MetricPattern2[Bitcoin] = MetricPattern2(client, _m(acc, 'cumulative')) + self.max: MetricPattern2[Bitcoin] = MetricPattern2(client, _m(acc, 'max')) + self.median: MetricPattern6[Bitcoin] = MetricPattern6(client, _m(acc, 'median')) + self.min: MetricPattern2[Bitcoin] = MetricPattern2(client, _m(acc, 'min')) + self.pct10: MetricPattern6[Bitcoin] = MetricPattern6(client, _m(acc, 'pct10')) + self.pct25: MetricPattern6[Bitcoin] = MetricPattern6(client, _m(acc, 'pct25')) + self.pct75: MetricPattern6[Bitcoin] = MetricPattern6(client, _m(acc, 'pct75')) + self.pct90: MetricPattern6[Bitcoin] = MetricPattern6(client, _m(acc, 'pct90')) + self.sum: MetricPattern2[Bitcoin] = MetricPattern2(client, _m(acc, 'sum')) class ClassAveragePricePattern(Generic[T]): """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self._2015: MetricPattern4[T] = MetricPattern4( - client, _m(acc, "2015_average_price") - ) - self._2016: MetricPattern4[T] = MetricPattern4( - client, _m(acc, "2016_average_price") - ) - self._2017: MetricPattern4[T] = MetricPattern4( - client, _m(acc, "2017_average_price") - ) - self._2018: MetricPattern4[T] = MetricPattern4( - client, _m(acc, "2018_average_price") - ) - self._2019: MetricPattern4[T] = MetricPattern4( - client, _m(acc, "2019_average_price") - ) - self._2020: MetricPattern4[T] = MetricPattern4( - client, _m(acc, "2020_average_price") - ) - self._2021: MetricPattern4[T] = MetricPattern4( - client, _m(acc, "2021_average_price") - ) - self._2022: MetricPattern4[T] = MetricPattern4( - client, _m(acc, "2022_average_price") - ) - self._2023: MetricPattern4[T] = MetricPattern4( - client, _m(acc, "2023_average_price") - ) - self._2024: MetricPattern4[T] = MetricPattern4( - client, _m(acc, "2024_average_price") - ) - self._2025: MetricPattern4[T] = MetricPattern4( - client, _m(acc, "2025_average_price") - ) - + self._2015: MetricPattern4[T] = MetricPattern4(client, _m(acc, '2015_average_price')) + self._2016: MetricPattern4[T] = MetricPattern4(client, _m(acc, '2016_average_price')) + self._2017: MetricPattern4[T] = MetricPattern4(client, _m(acc, '2017_average_price')) + self._2018: MetricPattern4[T] = MetricPattern4(client, _m(acc, '2018_average_price')) + self._2019: MetricPattern4[T] = MetricPattern4(client, _m(acc, '2019_average_price')) + self._2020: MetricPattern4[T] = MetricPattern4(client, _m(acc, '2020_average_price')) + self._2021: MetricPattern4[T] = MetricPattern4(client, _m(acc, '2021_average_price')) + self._2022: MetricPattern4[T] = MetricPattern4(client, _m(acc, '2022_average_price')) + self._2023: MetricPattern4[T] = MetricPattern4(client, _m(acc, '2023_average_price')) + self._2024: MetricPattern4[T] = MetricPattern4(client, _m(acc, '2024_average_price')) + self._2025: MetricPattern4[T] = MetricPattern4(client, _m(acc, '2025_average_price')) 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")) - - -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.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: """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.neg_unrealized_loss_rel_to_market_cap: MetricPattern1[StoredF32] = ( - MetricPattern1(client, _m(acc, "neg_unrealized_loss_rel_to_market_cap")) - ) - self.net_unrealized_pnl_rel_to_market_cap: MetricPattern1[StoredF32] = ( - MetricPattern1(client, _m(acc, "net_unrealized_pnl_rel_to_market_cap")) - ) - self.nupl: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, "nupl")) - self.supply_in_loss_rel_to_circulating_supply: MetricPattern1[StoredF64] = ( - MetricPattern1(client, _m(acc, "supply_in_loss_rel_to_circulating_supply")) - ) - self.supply_in_loss_rel_to_own_supply: MetricPattern1[StoredF64] = ( - MetricPattern1(client, _m(acc, "supply_in_loss_rel_to_own_supply")) - ) - self.supply_in_profit_rel_to_circulating_supply: MetricPattern1[StoredF64] = ( - MetricPattern1( - client, _m(acc, "supply_in_profit_rel_to_circulating_supply") - ) - ) - self.supply_in_profit_rel_to_own_supply: MetricPattern1[StoredF64] = ( - MetricPattern1(client, _m(acc, "supply_in_profit_rel_to_own_supply")) - ) - self.supply_rel_to_circulating_supply: MetricPattern4[StoredF64] = ( - MetricPattern4(client, _m(acc, "supply_rel_to_circulating_supply")) - ) - self.unrealized_loss_rel_to_market_cap: MetricPattern1[StoredF32] = ( - MetricPattern1(client, _m(acc, "unrealized_loss_rel_to_market_cap")) - ) - self.unrealized_profit_rel_to_market_cap: MetricPattern1[StoredF32] = ( - MetricPattern1(client, _m(acc, "unrealized_profit_rel_to_market_cap")) - ) + self.neg_unrealized_loss_rel_to_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'neg_unrealized_loss_rel_to_market_cap')) + self.net_unrealized_pnl_rel_to_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'net_unrealized_pnl_rel_to_market_cap')) + self.nupl: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'nupl')) + self.supply_in_loss_rel_to_circulating_supply: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'supply_in_loss_rel_to_circulating_supply')) + self.supply_in_loss_rel_to_own_supply: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'supply_in_loss_rel_to_own_supply')) + self.supply_in_profit_rel_to_circulating_supply: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'supply_in_profit_rel_to_circulating_supply')) + self.supply_in_profit_rel_to_own_supply: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'supply_in_profit_rel_to_own_supply')) + self.supply_rel_to_circulating_supply: MetricPattern4[StoredF64] = MetricPattern4(client, _m(acc, 'supply_rel_to_circulating_supply')) + self.unrealized_loss_rel_to_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'unrealized_loss_rel_to_market_cap')) + self.unrealized_profit_rel_to_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'unrealized_profit_rel_to_market_cap')) +class 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')) 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, acc: str): """Create pattern node with accumulated metric name.""" self.all: MetricPattern1[StoredU64] = MetricPattern1(client, acc) - self.p2a: MetricPattern1[StoredU64] = MetricPattern1(client, _p("p2a", acc)) - self.p2pk33: MetricPattern1[StoredU64] = MetricPattern1( - client, _p("p2pk33", acc) - ) - self.p2pk65: MetricPattern1[StoredU64] = MetricPattern1( - client, _p("p2pk65", acc) - ) - self.p2pkh: MetricPattern1[StoredU64] = MetricPattern1(client, _p("p2pkh", acc)) - self.p2sh: MetricPattern1[StoredU64] = MetricPattern1(client, _p("p2sh", acc)) - self.p2tr: MetricPattern1[StoredU64] = MetricPattern1(client, _p("p2tr", acc)) - self.p2wpkh: MetricPattern1[StoredU64] = MetricPattern1( - client, _p("p2wpkh", acc) - ) - self.p2wsh: MetricPattern1[StoredU64] = MetricPattern1(client, _p("p2wsh", acc)) - + self.p2a: MetricPattern1[StoredU64] = MetricPattern1(client, _p('p2a', acc)) + self.p2pk33: MetricPattern1[StoredU64] = MetricPattern1(client, _p('p2pk33', acc)) + self.p2pk65: MetricPattern1[StoredU64] = MetricPattern1(client, _p('p2pk65', acc)) + self.p2pkh: MetricPattern1[StoredU64] = MetricPattern1(client, _p('p2pkh', acc)) + self.p2sh: MetricPattern1[StoredU64] = MetricPattern1(client, _p('p2sh', acc)) + self.p2tr: MetricPattern1[StoredU64] = MetricPattern1(client, _p('p2tr', acc)) + self.p2wpkh: MetricPattern1[StoredU64] = MetricPattern1(client, _p('p2wpkh', acc)) + self.p2wsh: MetricPattern1[StoredU64] = MetricPattern1(client, _p('p2wsh', acc)) class FullnessPattern(Generic[T]): """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.average: MetricPattern2[T] = MetricPattern2(client, _m(acc, "average")) + self.average: MetricPattern2[T] = MetricPattern2(client, _m(acc, 'average')) self.base: MetricPattern11[T] = MetricPattern11(client, acc) - self.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.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')) 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, _m(acc, "utxo_count")) + self.outputs: OutputsPattern = OutputsPattern(client, _m(acc, 'utxo_count')) 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 _10yPattern: +class PeriodCagrPattern: """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, _m(acc, "utxo_count")) - self.realized: RealizedPattern4 = RealizedPattern4(client, acc) - self.relative: RelativePattern = RelativePattern(client, acc) - self.supply: SupplyPattern2 = SupplyPattern2(client, _m(acc, "supply")) - self.unrealized: UnrealizedPattern = UnrealizedPattern(client, acc) - - -class _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, _m(acc, "utxo_count")) - 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) - + self._10y: MetricPattern4[StoredF32] = MetricPattern4(client, _p('10y', acc)) + self._2y: MetricPattern4[StoredF32] = MetricPattern4(client, _p('2y', acc)) + self._3y: MetricPattern4[StoredF32] = MetricPattern4(client, _p('3y', acc)) + self._4y: MetricPattern4[StoredF32] = MetricPattern4(client, _p('4y', acc)) + self._5y: MetricPattern4[StoredF32] = MetricPattern4(client, _p('5y', acc)) + self._6y: MetricPattern4[StoredF32] = MetricPattern4(client, _p('6y', acc)) + self._8y: MetricPattern4[StoredF32] = MetricPattern4(client, _p('8y', acc)) class _100btcPattern: """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" self.activity: ActivityPattern2 = ActivityPattern2(client, acc) self.cost_basis: CostBasisPattern = CostBasisPattern(client, acc) - self.outputs: OutputsPattern = OutputsPattern(client, _m(acc, "utxo_count")) + self.outputs: OutputsPattern = OutputsPattern(client, _m(acc, 'utxo_count')) self.realized: RealizedPattern = RealizedPattern(client, acc) self.relative: RelativePattern = RelativePattern(client, acc) - self.supply: SupplyPattern2 = SupplyPattern2(client, _m(acc, "supply")) + self.supply: SupplyPattern2 = SupplyPattern2(client, _m(acc, 'supply')) self.unrealized: UnrealizedPattern = UnrealizedPattern(client, acc) +class _0satsPattern2: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self.activity: ActivityPattern2 = ActivityPattern2(client, acc) + self.cost_basis: CostBasisPattern = CostBasisPattern(client, acc) + self.outputs: OutputsPattern = OutputsPattern(client, _m(acc, 'utxo_count')) + 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 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 _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) self.cost_basis: CostBasisPattern2 = CostBasisPattern2(client, acc) - self.outputs: OutputsPattern = OutputsPattern(client, _m(acc, "utxo_count")) + self.outputs: OutputsPattern = OutputsPattern(client, _m(acc, 'utxo_count')) 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 PeriodCagrPattern: +class _10yPattern: """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, _p("10y", acc)) - self._2y: MetricPattern4[StoredF32] = MetricPattern4(client, _p("2y", acc)) - self._3y: MetricPattern4[StoredF32] = MetricPattern4(client, _p("3y", acc)) - self._4y: MetricPattern4[StoredF32] = MetricPattern4(client, _p("4y", acc)) - self._5y: MetricPattern4[StoredF32] = MetricPattern4(client, _p("5y", acc)) - self._6y: MetricPattern4[StoredF32] = MetricPattern4(client, _p("6y", acc)) - self._8y: MetricPattern4[StoredF32] = MetricPattern4(client, _p("8y", acc)) - + self.activity: ActivityPattern2 = ActivityPattern2(client, acc) + self.cost_basis: CostBasisPattern = CostBasisPattern(client, acc) + self.outputs: OutputsPattern = OutputsPattern(client, _m(acc, 'utxo_count')) + self.realized: RealizedPattern4 = RealizedPattern4(client, acc) + self.relative: RelativePattern = RelativePattern(client, acc) + self.supply: SupplyPattern2 = SupplyPattern2(client, _m(acc, 'supply')) + self.unrealized: UnrealizedPattern = UnrealizedPattern(client, acc) class ActivityPattern2: """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.coinblocks_destroyed: BlockCountPattern[StoredF64] = BlockCountPattern( - client, _m(acc, "coinblocks_destroyed") - ) - self.coindays_destroyed: BlockCountPattern[StoredF64] = BlockCountPattern( - client, _m(acc, "coindays_destroyed") - ) - self.satblocks_destroyed: MetricPattern11[Sats] = MetricPattern11( - client, _m(acc, "satblocks_destroyed") - ) - self.satdays_destroyed: MetricPattern11[Sats] = MetricPattern11( - client, _m(acc, "satdays_destroyed") - ) - self.sent: UnclaimedRewardsPattern = UnclaimedRewardsPattern( - client, _m(acc, "sent") - ) - + self.coinblocks_destroyed: BlockCountPattern[StoredF64] = BlockCountPattern(client, _m(acc, 'coinblocks_destroyed')) + self.coindays_destroyed: BlockCountPattern[StoredF64] = BlockCountPattern(client, _m(acc, 'coindays_destroyed')) + self.satblocks_destroyed: MetricPattern11[Sats] = MetricPattern11(client, _m(acc, 'satblocks_destroyed')) + self.satdays_destroyed: MetricPattern11[Sats] = MetricPattern11(client, _m(acc, 'satdays_destroyed')) + self.sent: UnclaimedRewardsPattern = UnclaimedRewardsPattern(client, _m(acc, 'sent')) class SplitPattern2(Generic[T]): """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.close: MetricPattern1[T] = MetricPattern1(client, _m(acc, "close")) - self.high: MetricPattern1[T] = MetricPattern1(client, _m(acc, "high")) - self.low: MetricPattern1[T] = MetricPattern1(client, _m(acc, "low")) - self.open: MetricPattern1[T] = MetricPattern1(client, _m(acc, "open")) - - -class CostBasisPattern2: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClientBase, 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.percentiles: PercentilesPattern = PercentilesPattern( - client, _m(acc, "cost_basis") - ) - + 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: BitcoinPattern2[Bitcoin] = BitcoinPattern2(client, _m(acc, "btc")) - self.dollars: BlockCountPattern[Dollars] = BlockCountPattern( - client, _m(acc, "usd") - ) + self.bitcoin: BitcoinPattern2[Bitcoin] = BitcoinPattern2(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.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 ActiveSupplyPattern: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.bitcoin: MetricPattern1[Bitcoin] = MetricPattern1(client, _m(acc, "btc")) - self.dollars: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, "usd")) - self.sats: MetricPattern1[Sats] = MetricPattern1(client, acc) - - class CoinbasePattern: """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.bitcoin: BitcoinPattern = BitcoinPattern(client, _m(acc, "btc")) - self.dollars: DollarsPattern[Dollars] = DollarsPattern(client, _m(acc, "usd")) + self.bitcoin: BitcoinPattern = BitcoinPattern(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, 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.percentiles: PercentilesPattern = PercentilesPattern(client, _m(acc, 'cost_basis')) class SegwitAdoptionPattern: """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" self.base: MetricPattern11[StoredF32] = MetricPattern11(client, acc) - self.cumulative: MetricPattern2[StoredF32] = MetricPattern2( - client, _m(acc, "cumulative") - ) - self.sum: MetricPattern2[StoredF32] = MetricPattern2(client, _m(acc, "sum")) + self.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.sats: MetricPattern1[Sats] = MetricPattern1(client, acc) class CoinbasePattern2: """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.bitcoin: BlockCountPattern[Bitcoin] = BlockCountPattern( - client, _m(acc, "btc") - ) - self.dollars: BlockCountPattern[Dollars] = BlockCountPattern( - client, _m(acc, "usd") - ) + self.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 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")) - ) - - -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 _1dReturns1mSdPattern: """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.sd: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, "sd")) - self.sma: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, "sma")) - + self.sd: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'sd')) + self.sma: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'sma')) class SupplyPattern2: """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.halved: ActiveSupplyPattern = ActiveSupplyPattern( - client, _m(acc, "halved") - ) + self.halved: ActiveSupplyPattern = ActiveSupplyPattern(client, _m(acc, 'halved')) 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')) class SatsPattern(Generic[T]): """Pattern struct for repeated tree structure.""" - + def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.ohlc: MetricPattern1[T] = MetricPattern1(client, _m(acc, "ohlc")) - self.split: SplitPattern2[T] = SplitPattern2(client, acc) - - -class BitcoinPattern2(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.sum: MetricPattern1[T] = MetricPattern1(client, acc) - + self.ohlc: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'ohlc_sats')) + self.split: SplitPattern2[T] = SplitPattern2(client, _m(acc, 'sats')) 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 BitcoinPattern2(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.sum: MetricPattern1[T] = MetricPattern1(client, acc) 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, acc) - 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, acc) - # Metrics tree classes - class MetricsTree_Addresses: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.first_p2aaddressindex: MetricPattern11[P2AAddressIndex] = MetricPattern11( - client, "first_p2aaddressindex" - ) - self.first_p2pk33addressindex: MetricPattern11[P2PK33AddressIndex] = ( - MetricPattern11(client, "first_p2pk33addressindex") - ) - self.first_p2pk65addressindex: MetricPattern11[P2PK65AddressIndex] = ( - MetricPattern11(client, "first_p2pk65addressindex") - ) - self.first_p2pkhaddressindex: MetricPattern11[P2PKHAddressIndex] = ( - MetricPattern11(client, "first_p2pkhaddressindex") - ) - self.first_p2shaddressindex: MetricPattern11[P2SHAddressIndex] = ( - MetricPattern11(client, "first_p2shaddressindex") - ) - self.first_p2traddressindex: MetricPattern11[P2TRAddressIndex] = ( - MetricPattern11(client, "first_p2traddressindex") - ) - self.first_p2wpkhaddressindex: MetricPattern11[P2WPKHAddressIndex] = ( - MetricPattern11(client, "first_p2wpkhaddressindex") - ) - self.first_p2wshaddressindex: MetricPattern11[P2WSHAddressIndex] = ( - MetricPattern11(client, "first_p2wshaddressindex") - ) - self.p2abytes: MetricPattern16[P2ABytes] = MetricPattern16(client, "p2abytes") - self.p2pk33bytes: MetricPattern18[P2PK33Bytes] = MetricPattern18( - client, "p2pk33bytes" - ) - self.p2pk65bytes: MetricPattern19[P2PK65Bytes] = MetricPattern19( - client, "p2pk65bytes" - ) - self.p2pkhbytes: MetricPattern20[P2PKHBytes] = MetricPattern20( - client, "p2pkhbytes" - ) - self.p2shbytes: MetricPattern21[P2SHBytes] = MetricPattern21( - client, "p2shbytes" - ) - self.p2trbytes: MetricPattern22[P2TRBytes] = MetricPattern22( - client, "p2trbytes" - ) - self.p2wpkhbytes: MetricPattern23[P2WPKHBytes] = MetricPattern23( - client, "p2wpkhbytes" - ) - self.p2wshbytes: MetricPattern24[P2WSHBytes] = MetricPattern24( - client, "p2wshbytes" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.first_p2aaddressindex: MetricPattern11[P2AAddressIndex] = MetricPattern11(client, 'first_p2aaddressindex') + self.first_p2pk33addressindex: MetricPattern11[P2PK33AddressIndex] = MetricPattern11(client, 'first_p2pk33addressindex') + self.first_p2pk65addressindex: MetricPattern11[P2PK65AddressIndex] = MetricPattern11(client, 'first_p2pk65addressindex') + self.first_p2pkhaddressindex: MetricPattern11[P2PKHAddressIndex] = MetricPattern11(client, 'first_p2pkhaddressindex') + self.first_p2shaddressindex: MetricPattern11[P2SHAddressIndex] = MetricPattern11(client, 'first_p2shaddressindex') + self.first_p2traddressindex: MetricPattern11[P2TRAddressIndex] = MetricPattern11(client, 'first_p2traddressindex') + self.first_p2wpkhaddressindex: MetricPattern11[P2WPKHAddressIndex] = MetricPattern11(client, 'first_p2wpkhaddressindex') + self.first_p2wshaddressindex: MetricPattern11[P2WSHAddressIndex] = MetricPattern11(client, 'first_p2wshaddressindex') + self.p2abytes: MetricPattern16[P2ABytes] = MetricPattern16(client, 'p2abytes') + self.p2pk33bytes: MetricPattern18[P2PK33Bytes] = MetricPattern18(client, 'p2pk33bytes') + self.p2pk65bytes: MetricPattern19[P2PK65Bytes] = MetricPattern19(client, 'p2pk65bytes') + self.p2pkhbytes: MetricPattern20[P2PKHBytes] = MetricPattern20(client, 'p2pkhbytes') + self.p2shbytes: MetricPattern21[P2SHBytes] = MetricPattern21(client, 'p2shbytes') + self.p2trbytes: MetricPattern22[P2TRBytes] = MetricPattern22(client, 'p2trbytes') + self.p2wpkhbytes: MetricPattern23[P2WPKHBytes] = MetricPattern23(client, 'p2wpkhbytes') + self.p2wshbytes: MetricPattern24[P2WSHBytes] = MetricPattern24(client, 'p2wshbytes') class MetricsTree_Blocks_Count: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self._1m_block_count: MetricPattern1[StoredU32] = MetricPattern1( - client, "1m_block_count" - ) - self._1m_start: MetricPattern11[Height] = MetricPattern11(client, "1m_start") - self._1w_block_count: MetricPattern1[StoredU32] = MetricPattern1( - client, "1w_block_count" - ) - self._1w_start: MetricPattern11[Height] = MetricPattern11(client, "1w_start") - self._1y_block_count: MetricPattern1[StoredU32] = MetricPattern1( - client, "1y_block_count" - ) - self._1y_start: MetricPattern11[Height] = MetricPattern11(client, "1y_start") - self._24h_block_count: MetricPattern1[StoredU32] = MetricPattern1( - client, "24h_block_count" - ) - self._24h_start: MetricPattern11[Height] = MetricPattern11(client, "24h_start") - self.block_count: BlockCountPattern[StoredU32] = BlockCountPattern( - client, "block_count" - ) - self.block_count_target: MetricPattern4[StoredU64] = MetricPattern4( - client, "block_count_target" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self._1m_block_count: MetricPattern1[StoredU32] = MetricPattern1(client, '1m_block_count') + self._1m_start: MetricPattern11[Height] = MetricPattern11(client, '1m_start') + self._1w_block_count: MetricPattern1[StoredU32] = MetricPattern1(client, '1w_block_count') + self._1w_start: MetricPattern11[Height] = MetricPattern11(client, '1w_start') + self._1y_block_count: MetricPattern1[StoredU32] = MetricPattern1(client, '1y_block_count') + self._1y_start: MetricPattern11[Height] = MetricPattern11(client, '1y_start') + self._24h_block_count: MetricPattern1[StoredU32] = MetricPattern1(client, '24h_block_count') + self._24h_start: MetricPattern11[Height] = MetricPattern11(client, '24h_start') + self.block_count: BlockCountPattern[StoredU32] = BlockCountPattern(client, 'block_count') + self.block_count_target: MetricPattern4[StoredU64] = MetricPattern4(client, 'block_count_target') class MetricsTree_Blocks_Difficulty: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.adjustment: MetricPattern1[StoredF32] = MetricPattern1( - client, "difficulty_adjustment" - ) - self.as_hash: MetricPattern1[StoredF32] = MetricPattern1( - client, "difficulty_as_hash" - ) - self.blocks_before_next_adjustment: MetricPattern1[StoredU32] = MetricPattern1( - client, "blocks_before_next_difficulty_adjustment" - ) - self.days_before_next_adjustment: MetricPattern1[StoredF32] = MetricPattern1( - client, "days_before_next_difficulty_adjustment" - ) - self.epoch: MetricPattern4[DifficultyEpoch] = MetricPattern4( - client, "difficultyepoch" - ) - self.raw: MetricPattern1[StoredF64] = MetricPattern1(client, "difficulty") - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.adjustment: MetricPattern1[StoredF32] = MetricPattern1(client, 'difficulty_adjustment') + self.as_hash: MetricPattern1[StoredF32] = MetricPattern1(client, 'difficulty_as_hash') + self.blocks_before_next_adjustment: MetricPattern1[StoredU32] = MetricPattern1(client, 'blocks_before_next_difficulty_adjustment') + self.days_before_next_adjustment: MetricPattern1[StoredF32] = MetricPattern1(client, 'days_before_next_difficulty_adjustment') + self.epoch: MetricPattern4[DifficultyEpoch] = MetricPattern4(client, 'difficultyepoch') + self.raw: MetricPattern1[StoredF64] = MetricPattern1(client, 'difficulty') class MetricsTree_Blocks_Halving: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.blocks_before_next_halving: MetricPattern1[StoredU32] = MetricPattern1( - client, "blocks_before_next_halving" - ) - self.days_before_next_halving: MetricPattern1[StoredF32] = MetricPattern1( - client, "days_before_next_halving" - ) - self.epoch: MetricPattern4[HalvingEpoch] = MetricPattern4( - client, "halvingepoch" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.blocks_before_next_halving: MetricPattern1[StoredU32] = MetricPattern1(client, 'blocks_before_next_halving') + self.days_before_next_halving: MetricPattern1[StoredF32] = MetricPattern1(client, 'days_before_next_halving') + self.epoch: MetricPattern4[HalvingEpoch] = MetricPattern4(client, 'halvingepoch') class MetricsTree_Blocks_Mining: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.hash_price_phs: MetricPattern1[StoredF32] = MetricPattern1( - client, "hash_price_phs" - ) - self.hash_price_phs_min: MetricPattern1[StoredF32] = MetricPattern1( - client, "hash_price_phs_min" - ) - self.hash_price_rebound: MetricPattern1[StoredF32] = MetricPattern1( - client, "hash_price_rebound" - ) - self.hash_price_ths: MetricPattern1[StoredF32] = MetricPattern1( - client, "hash_price_ths" - ) - self.hash_price_ths_min: MetricPattern1[StoredF32] = MetricPattern1( - client, "hash_price_ths_min" - ) - self.hash_rate: MetricPattern1[StoredF64] = MetricPattern1(client, "hash_rate") - self.hash_rate_1m_sma: MetricPattern4[StoredF32] = MetricPattern4( - client, "hash_rate_1m_sma" - ) - self.hash_rate_1w_sma: MetricPattern4[StoredF64] = MetricPattern4( - client, "hash_rate_1w_sma" - ) - self.hash_rate_1y_sma: MetricPattern4[StoredF32] = MetricPattern4( - client, "hash_rate_1y_sma" - ) - self.hash_rate_2m_sma: MetricPattern4[StoredF32] = MetricPattern4( - client, "hash_rate_2m_sma" - ) - self.hash_value_phs: MetricPattern1[StoredF32] = MetricPattern1( - client, "hash_value_phs" - ) - self.hash_value_phs_min: MetricPattern1[StoredF32] = MetricPattern1( - client, "hash_value_phs_min" - ) - self.hash_value_rebound: MetricPattern1[StoredF32] = MetricPattern1( - client, "hash_value_rebound" - ) - self.hash_value_ths: MetricPattern1[StoredF32] = MetricPattern1( - client, "hash_value_ths" - ) - self.hash_value_ths_min: MetricPattern1[StoredF32] = MetricPattern1( - client, "hash_value_ths_min" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.hash_price_phs: MetricPattern1[StoredF32] = MetricPattern1(client, 'hash_price_phs') + self.hash_price_phs_min: MetricPattern1[StoredF32] = MetricPattern1(client, 'hash_price_phs_min') + self.hash_price_rebound: MetricPattern1[StoredF32] = MetricPattern1(client, 'hash_price_rebound') + self.hash_price_ths: MetricPattern1[StoredF32] = MetricPattern1(client, 'hash_price_ths') + self.hash_price_ths_min: MetricPattern1[StoredF32] = MetricPattern1(client, 'hash_price_ths_min') + self.hash_rate: MetricPattern1[StoredF64] = MetricPattern1(client, 'hash_rate') + self.hash_rate_1m_sma: MetricPattern4[StoredF32] = MetricPattern4(client, 'hash_rate_1m_sma') + self.hash_rate_1w_sma: MetricPattern4[StoredF64] = MetricPattern4(client, 'hash_rate_1w_sma') + self.hash_rate_1y_sma: MetricPattern4[StoredF32] = MetricPattern4(client, 'hash_rate_1y_sma') + self.hash_rate_2m_sma: MetricPattern4[StoredF32] = MetricPattern4(client, 'hash_rate_2m_sma') + self.hash_value_phs: MetricPattern1[StoredF32] = MetricPattern1(client, 'hash_value_phs') + self.hash_value_phs_min: MetricPattern1[StoredF32] = MetricPattern1(client, 'hash_value_phs_min') + self.hash_value_rebound: MetricPattern1[StoredF32] = MetricPattern1(client, 'hash_value_rebound') + self.hash_value_ths: MetricPattern1[StoredF32] = MetricPattern1(client, 'hash_value_ths') + self.hash_value_ths_min: MetricPattern1[StoredF32] = MetricPattern1(client, 'hash_value_ths_min') class MetricsTree_Blocks_Rewards_24hCoinbaseSum: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.bitcoin: MetricPattern11[Bitcoin] = MetricPattern11( - client, "24h_coinbase_sum_btc" - ) - self.dollars: MetricPattern11[Dollars] = MetricPattern11( - client, "24h_coinbase_sum_usd" - ) - self.sats: MetricPattern11[Sats] = MetricPattern11(client, "24h_coinbase_sum") - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.bitcoin: MetricPattern11[Bitcoin] = MetricPattern11(client, '24h_coinbase_sum_btc') + self.dollars: MetricPattern11[Dollars] = MetricPattern11(client, '24h_coinbase_sum_usd') + self.sats: MetricPattern11[Sats] = MetricPattern11(client, '24h_coinbase_sum') class MetricsTree_Blocks_Rewards: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self._24h_coinbase_sum: MetricsTree_Blocks_Rewards_24hCoinbaseSum = ( - MetricsTree_Blocks_Rewards_24hCoinbaseSum(client) - ) - self.coinbase: CoinbasePattern = CoinbasePattern(client, "coinbase") - self.fee_dominance: MetricPattern6[StoredF32] = MetricPattern6( - client, "fee_dominance" - ) - self.subsidy: CoinbasePattern = CoinbasePattern(client, "subsidy") - self.subsidy_dominance: MetricPattern6[StoredF32] = MetricPattern6( - client, "subsidy_dominance" - ) - self.subsidy_usd_1y_sma: MetricPattern4[Dollars] = MetricPattern4( - client, "subsidy_usd_1y_sma" - ) - self.unclaimed_rewards: UnclaimedRewardsPattern = UnclaimedRewardsPattern( - client, "unclaimed_rewards" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self._24h_coinbase_sum: MetricsTree_Blocks_Rewards_24hCoinbaseSum = MetricsTree_Blocks_Rewards_24hCoinbaseSum(client) + self.coinbase: CoinbasePattern = CoinbasePattern(client, 'coinbase') + self.fee_dominance: MetricPattern6[StoredF32] = MetricPattern6(client, 'fee_dominance') + self.subsidy: CoinbasePattern = CoinbasePattern(client, 'subsidy') + self.subsidy_dominance: MetricPattern6[StoredF32] = MetricPattern6(client, 'subsidy_dominance') + self.subsidy_usd_1y_sma: MetricPattern4[Dollars] = MetricPattern4(client, 'subsidy_usd_1y_sma') + self.unclaimed_rewards: UnclaimedRewardsPattern = UnclaimedRewardsPattern(client, 'unclaimed_rewards') class MetricsTree_Blocks_Size: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.average: MetricPattern2[StoredU64] = MetricPattern2( - client, "block_size_average" - ) - self.cumulative: MetricPattern1[StoredU64] = MetricPattern1( - client, "block_size_cumulative" - ) - self.max: MetricPattern2[StoredU64] = MetricPattern2(client, "block_size_max") - self.median: MetricPattern6[StoredU64] = MetricPattern6( - client, "block_size_median" - ) - self.min: MetricPattern2[StoredU64] = MetricPattern2(client, "block_size_min") - self.pct10: MetricPattern6[StoredU64] = MetricPattern6( - client, "block_size_pct10" - ) - self.pct25: MetricPattern6[StoredU64] = MetricPattern6( - client, "block_size_pct25" - ) - self.pct75: MetricPattern6[StoredU64] = MetricPattern6( - client, "block_size_pct75" - ) - self.pct90: MetricPattern6[StoredU64] = MetricPattern6( - client, "block_size_pct90" - ) - self.sum: MetricPattern2[StoredU64] = MetricPattern2(client, "block_size_sum") - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.average: MetricPattern2[StoredU64] = MetricPattern2(client, 'block_size_average') + self.cumulative: MetricPattern1[StoredU64] = MetricPattern1(client, 'block_size_cumulative') + self.max: MetricPattern2[StoredU64] = MetricPattern2(client, 'block_size_max') + self.median: MetricPattern6[StoredU64] = MetricPattern6(client, 'block_size_median') + self.min: MetricPattern2[StoredU64] = MetricPattern2(client, 'block_size_min') + self.pct10: MetricPattern6[StoredU64] = MetricPattern6(client, 'block_size_pct10') + self.pct25: MetricPattern6[StoredU64] = MetricPattern6(client, 'block_size_pct25') + self.pct75: MetricPattern6[StoredU64] = MetricPattern6(client, 'block_size_pct75') + self.pct90: MetricPattern6[StoredU64] = MetricPattern6(client, 'block_size_pct90') + self.sum: MetricPattern2[StoredU64] = MetricPattern2(client, 'block_size_sum') class MetricsTree_Blocks_Time: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.date: MetricPattern11[Date] = MetricPattern11(client, "date") - self.timestamp: MetricPattern1[Timestamp] = MetricPattern1(client, "timestamp") - self.timestamp_monotonic: MetricPattern11[Timestamp] = MetricPattern11( - client, "timestamp_monotonic" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.date: MetricPattern11[Date] = MetricPattern11(client, 'date') + self.timestamp: MetricPattern1[Timestamp] = MetricPattern1(client, 'timestamp') + self.timestamp_monotonic: MetricPattern11[Timestamp] = MetricPattern11(client, 'timestamp_monotonic') class MetricsTree_Blocks: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.blockhash: MetricPattern11[BlockHash] = MetricPattern11( - client, "blockhash" - ) + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.blockhash: MetricPattern11[BlockHash] = MetricPattern11(client, 'blockhash') self.count: MetricsTree_Blocks_Count = MetricsTree_Blocks_Count(client) - self.difficulty: MetricsTree_Blocks_Difficulty = MetricsTree_Blocks_Difficulty( - client - ) - self.fullness: FullnessPattern[StoredF32] = FullnessPattern( - client, "block_fullness" - ) + self.difficulty: MetricsTree_Blocks_Difficulty = MetricsTree_Blocks_Difficulty(client) + self.fullness: FullnessPattern[StoredF32] = FullnessPattern(client, 'block_fullness') self.halving: MetricsTree_Blocks_Halving = MetricsTree_Blocks_Halving(client) - self.interval: FullnessPattern[Timestamp] = FullnessPattern( - client, "block_interval" - ) + self.interval: FullnessPattern[Timestamp] = FullnessPattern(client, 'block_interval') 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") - + 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') class MetricsTree_Cointime_Activity: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.activity_to_vaultedness_ratio: MetricPattern1[StoredF64] = MetricPattern1( - client, "activity_to_vaultedness_ratio" - ) - self.coinblocks_created: BlockCountPattern[StoredF64] = BlockCountPattern( - client, "coinblocks_created" - ) - self.coinblocks_stored: BlockCountPattern[StoredF64] = BlockCountPattern( - client, "coinblocks_stored" - ) - self.liveliness: MetricPattern1[StoredF64] = MetricPattern1( - client, "liveliness" - ) - self.vaultedness: MetricPattern1[StoredF64] = MetricPattern1( - client, "vaultedness" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.activity_to_vaultedness_ratio: MetricPattern1[StoredF64] = MetricPattern1(client, 'activity_to_vaultedness_ratio') + self.coinblocks_created: BlockCountPattern[StoredF64] = BlockCountPattern(client, 'coinblocks_created') + self.coinblocks_stored: BlockCountPattern[StoredF64] = BlockCountPattern(client, 'coinblocks_stored') + self.liveliness: MetricPattern1[StoredF64] = MetricPattern1(client, 'liveliness') + self.vaultedness: MetricPattern1[StoredF64] = MetricPattern1(client, 'vaultedness') class MetricsTree_Cointime_Adjusted: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.cointime_adj_inflation_rate: MetricPattern4[StoredF32] = MetricPattern4( - client, "cointime_adj_inflation_rate" - ) - self.cointime_adj_tx_btc_velocity: MetricPattern4[StoredF64] = MetricPattern4( - client, "cointime_adj_tx_btc_velocity" - ) - self.cointime_adj_tx_usd_velocity: MetricPattern4[StoredF64] = MetricPattern4( - client, "cointime_adj_tx_usd_velocity" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.cointime_adj_inflation_rate: MetricPattern4[StoredF32] = MetricPattern4(client, 'cointime_adj_inflation_rate') + self.cointime_adj_tx_btc_velocity: MetricPattern4[StoredF64] = MetricPattern4(client, 'cointime_adj_tx_btc_velocity') + self.cointime_adj_tx_usd_velocity: MetricPattern4[StoredF64] = MetricPattern4(client, 'cointime_adj_tx_usd_velocity') class MetricsTree_Cointime_Cap: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.active_cap: MetricPattern1[Dollars] = MetricPattern1(client, "active_cap") - self.cointime_cap: MetricPattern1[Dollars] = MetricPattern1( - client, "cointime_cap" - ) - self.investor_cap: MetricPattern1[Dollars] = MetricPattern1( - client, "investor_cap" - ) - self.thermo_cap: MetricPattern1[Dollars] = MetricPattern1(client, "thermo_cap") - self.vaulted_cap: MetricPattern1[Dollars] = MetricPattern1( - client, "vaulted_cap" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.active_cap: MetricPattern1[Dollars] = MetricPattern1(client, 'active_cap') + self.cointime_cap: MetricPattern1[Dollars] = MetricPattern1(client, 'cointime_cap') + self.investor_cap: MetricPattern1[Dollars] = MetricPattern1(client, 'investor_cap') + self.thermo_cap: MetricPattern1[Dollars] = MetricPattern1(client, 'thermo_cap') + self.vaulted_cap: MetricPattern1[Dollars] = MetricPattern1(client, 'vaulted_cap') class MetricsTree_Cointime_Pricing: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.active_price: MetricPattern1[Dollars] = MetricPattern1( - client, "active_price" - ) - self.active_price_ratio: ActivePriceRatioPattern = ActivePriceRatioPattern( - client, "active_price_ratio" - ) - self.cointime_price: MetricPattern1[Dollars] = MetricPattern1( - client, "cointime_price" - ) - self.cointime_price_ratio: ActivePriceRatioPattern = ActivePriceRatioPattern( - client, "cointime_price_ratio" - ) - self.true_market_mean: MetricPattern1[Dollars] = MetricPattern1( - client, "true_market_mean" - ) - self.true_market_mean_ratio: ActivePriceRatioPattern = ActivePriceRatioPattern( - client, "true_market_mean_ratio" - ) - self.vaulted_price: MetricPattern1[Dollars] = MetricPattern1( - client, "vaulted_price" - ) - self.vaulted_price_ratio: ActivePriceRatioPattern = ActivePriceRatioPattern( - client, "vaulted_price_ratio" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.active_price: MetricPattern1[Dollars] = MetricPattern1(client, 'active_price') + self.active_price_ratio: ActivePriceRatioPattern = ActivePriceRatioPattern(client, 'active_price_ratio') + self.cointime_price: MetricPattern1[Dollars] = MetricPattern1(client, 'cointime_price') + self.cointime_price_ratio: ActivePriceRatioPattern = ActivePriceRatioPattern(client, 'cointime_price_ratio') + self.true_market_mean: MetricPattern1[Dollars] = MetricPattern1(client, 'true_market_mean') + self.true_market_mean_ratio: ActivePriceRatioPattern = ActivePriceRatioPattern(client, 'true_market_mean_ratio') + self.vaulted_price: MetricPattern1[Dollars] = MetricPattern1(client, 'vaulted_price') + self.vaulted_price_ratio: ActivePriceRatioPattern = ActivePriceRatioPattern(client, 'vaulted_price_ratio') class MetricsTree_Cointime_Supply: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.active_supply: ActiveSupplyPattern = ActiveSupplyPattern( - client, "active_supply" - ) - self.vaulted_supply: ActiveSupplyPattern = ActiveSupplyPattern( - client, "vaulted_supply" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.active_supply: ActiveSupplyPattern = ActiveSupplyPattern(client, 'active_supply') + self.vaulted_supply: ActiveSupplyPattern = ActiveSupplyPattern(client, 'vaulted_supply') class MetricsTree_Cointime_Value: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.cointime_value_created: BlockCountPattern[StoredF64] = BlockCountPattern( - client, "cointime_value_created" - ) - self.cointime_value_destroyed: BlockCountPattern[StoredF64] = BlockCountPattern( - client, "cointime_value_destroyed" - ) - self.cointime_value_stored: BlockCountPattern[StoredF64] = BlockCountPattern( - client, "cointime_value_stored" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.cointime_value_created: BlockCountPattern[StoredF64] = BlockCountPattern(client, 'cointime_value_created') + self.cointime_value_destroyed: BlockCountPattern[StoredF64] = BlockCountPattern(client, 'cointime_value_destroyed') + self.cointime_value_stored: BlockCountPattern[StoredF64] = BlockCountPattern(client, 'cointime_value_stored') class MetricsTree_Cointime: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.activity: MetricsTree_Cointime_Activity = MetricsTree_Cointime_Activity( - client - ) - self.adjusted: MetricsTree_Cointime_Adjusted = MetricsTree_Cointime_Adjusted( - client - ) + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.activity: MetricsTree_Cointime_Activity = MetricsTree_Cointime_Activity(client) + self.adjusted: MetricsTree_Cointime_Adjusted = MetricsTree_Cointime_Adjusted(client) self.cap: MetricsTree_Cointime_Cap = MetricsTree_Cointime_Cap(client) - self.pricing: MetricsTree_Cointime_Pricing = MetricsTree_Cointime_Pricing( - client - ) + self.pricing: MetricsTree_Cointime_Pricing = MetricsTree_Cointime_Pricing(client) self.supply: MetricsTree_Cointime_Supply = MetricsTree_Cointime_Supply(client) self.value: MetricsTree_Cointime_Value = MetricsTree_Cointime_Value(client) - class MetricsTree_Constants: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.constant_0: MetricPattern1[StoredU16] = MetricPattern1( - client, "constant_0" - ) - self.constant_1: MetricPattern1[StoredU16] = MetricPattern1( - client, "constant_1" - ) - self.constant_100: MetricPattern1[StoredU16] = MetricPattern1( - client, "constant_100" - ) - self.constant_2: MetricPattern1[StoredU16] = MetricPattern1( - client, "constant_2" - ) - self.constant_20: MetricPattern1[StoredU16] = MetricPattern1( - client, "constant_20" - ) - self.constant_3: MetricPattern1[StoredU16] = MetricPattern1( - client, "constant_3" - ) - self.constant_30: MetricPattern1[StoredU16] = MetricPattern1( - client, "constant_30" - ) - self.constant_38_2: MetricPattern1[StoredF32] = MetricPattern1( - client, "constant_38_2" - ) - self.constant_4: MetricPattern1[StoredU16] = MetricPattern1( - client, "constant_4" - ) - self.constant_50: MetricPattern1[StoredU16] = MetricPattern1( - client, "constant_50" - ) - self.constant_600: MetricPattern1[StoredU16] = MetricPattern1( - client, "constant_600" - ) - self.constant_61_8: MetricPattern1[StoredF32] = MetricPattern1( - client, "constant_61_8" - ) - self.constant_70: MetricPattern1[StoredU16] = MetricPattern1( - client, "constant_70" - ) - self.constant_80: MetricPattern1[StoredU16] = MetricPattern1( - client, "constant_80" - ) - self.constant_minus_1: MetricPattern1[StoredI16] = MetricPattern1( - client, "constant_minus_1" - ) - self.constant_minus_2: MetricPattern1[StoredI16] = MetricPattern1( - client, "constant_minus_2" - ) - self.constant_minus_3: MetricPattern1[StoredI16] = MetricPattern1( - client, "constant_minus_3" - ) - self.constant_minus_4: MetricPattern1[StoredI16] = MetricPattern1( - client, "constant_minus_4" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.constant_0: MetricPattern1[StoredU16] = MetricPattern1(client, 'constant_0') + self.constant_1: MetricPattern1[StoredU16] = MetricPattern1(client, 'constant_1') + self.constant_100: MetricPattern1[StoredU16] = MetricPattern1(client, 'constant_100') + self.constant_2: MetricPattern1[StoredU16] = MetricPattern1(client, 'constant_2') + self.constant_20: MetricPattern1[StoredU16] = MetricPattern1(client, 'constant_20') + self.constant_3: MetricPattern1[StoredU16] = MetricPattern1(client, 'constant_3') + self.constant_30: MetricPattern1[StoredU16] = MetricPattern1(client, 'constant_30') + self.constant_38_2: MetricPattern1[StoredF32] = MetricPattern1(client, 'constant_38_2') + self.constant_4: MetricPattern1[StoredU16] = MetricPattern1(client, 'constant_4') + self.constant_50: MetricPattern1[StoredU16] = MetricPattern1(client, 'constant_50') + self.constant_600: MetricPattern1[StoredU16] = MetricPattern1(client, 'constant_600') + self.constant_61_8: MetricPattern1[StoredF32] = MetricPattern1(client, 'constant_61_8') + self.constant_70: MetricPattern1[StoredU16] = MetricPattern1(client, 'constant_70') + self.constant_80: MetricPattern1[StoredU16] = MetricPattern1(client, 'constant_80') + self.constant_minus_1: MetricPattern1[StoredI16] = MetricPattern1(client, 'constant_minus_1') + self.constant_minus_2: MetricPattern1[StoredI16] = MetricPattern1(client, 'constant_minus_2') + self.constant_minus_3: MetricPattern1[StoredI16] = MetricPattern1(client, 'constant_minus_3') + self.constant_minus_4: MetricPattern1[StoredI16] = MetricPattern1(client, 'constant_minus_4') class MetricsTree_Distribution_AddressCohorts_AmountRange: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self._0sats: _0satsPattern = _0satsPattern(client, "addrs_with_0sats") - self._100btc_to_1k_btc: _0satsPattern = _0satsPattern( - client, "addrs_above_100btc_under_1k_btc" - ) - self._100k_btc_or_more: _0satsPattern = _0satsPattern( - client, "addrs_above_100k_btc" - ) - self._100k_sats_to_1m_sats: _0satsPattern = _0satsPattern( - client, "addrs_above_100k_sats_under_1m_sats" - ) - self._100sats_to_1k_sats: _0satsPattern = _0satsPattern( - client, "addrs_above_100sats_under_1k_sats" - ) - self._10btc_to_100btc: _0satsPattern = _0satsPattern( - client, "addrs_above_10btc_under_100btc" - ) - self._10k_btc_to_100k_btc: _0satsPattern = _0satsPattern( - client, "addrs_above_10k_btc_under_100k_btc" - ) - self._10k_sats_to_100k_sats: _0satsPattern = _0satsPattern( - client, "addrs_above_10k_sats_under_100k_sats" - ) - self._10m_sats_to_1btc: _0satsPattern = _0satsPattern( - client, "addrs_above_10m_sats_under_1btc" - ) - self._10sats_to_100sats: _0satsPattern = _0satsPattern( - client, "addrs_above_10sats_under_100sats" - ) - self._1btc_to_10btc: _0satsPattern = _0satsPattern( - client, "addrs_above_1btc_under_10btc" - ) - self._1k_btc_to_10k_btc: _0satsPattern = _0satsPattern( - client, "addrs_above_1k_btc_under_10k_btc" - ) - self._1k_sats_to_10k_sats: _0satsPattern = _0satsPattern( - client, "addrs_above_1k_sats_under_10k_sats" - ) - self._1m_sats_to_10m_sats: _0satsPattern = _0satsPattern( - client, "addrs_above_1m_sats_under_10m_sats" - ) - self._1sat_to_10sats: _0satsPattern = _0satsPattern( - client, "addrs_above_1sat_under_10sats" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self._0sats: _0satsPattern = _0satsPattern(client, 'addrs_with_0sats') + self._100btc_to_1k_btc: _0satsPattern = _0satsPattern(client, 'addrs_above_100btc_under_1k_btc') + self._100k_btc_or_more: _0satsPattern = _0satsPattern(client, 'addrs_above_100k_btc') + self._100k_sats_to_1m_sats: _0satsPattern = _0satsPattern(client, 'addrs_above_100k_sats_under_1m_sats') + self._100sats_to_1k_sats: _0satsPattern = _0satsPattern(client, 'addrs_above_100sats_under_1k_sats') + self._10btc_to_100btc: _0satsPattern = _0satsPattern(client, 'addrs_above_10btc_under_100btc') + self._10k_btc_to_100k_btc: _0satsPattern = _0satsPattern(client, 'addrs_above_10k_btc_under_100k_btc') + self._10k_sats_to_100k_sats: _0satsPattern = _0satsPattern(client, 'addrs_above_10k_sats_under_100k_sats') + self._10m_sats_to_1btc: _0satsPattern = _0satsPattern(client, 'addrs_above_10m_sats_under_1btc') + self._10sats_to_100sats: _0satsPattern = _0satsPattern(client, 'addrs_above_10sats_under_100sats') + self._1btc_to_10btc: _0satsPattern = _0satsPattern(client, 'addrs_above_1btc_under_10btc') + self._1k_btc_to_10k_btc: _0satsPattern = _0satsPattern(client, 'addrs_above_1k_btc_under_10k_btc') + self._1k_sats_to_10k_sats: _0satsPattern = _0satsPattern(client, 'addrs_above_1k_sats_under_10k_sats') + self._1m_sats_to_10m_sats: _0satsPattern = _0satsPattern(client, 'addrs_above_1m_sats_under_10m_sats') + self._1sat_to_10sats: _0satsPattern = _0satsPattern(client, 'addrs_above_1sat_under_10sats') class MetricsTree_Distribution_AddressCohorts_GeAmount: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self._100btc: _0satsPattern = _0satsPattern(client, "addrs_above_100btc") - self._100k_sats: _0satsPattern = _0satsPattern(client, "addrs_above_100k_sats") - self._100sats: _0satsPattern = _0satsPattern(client, "addrs_above_100sats") - self._10btc: _0satsPattern = _0satsPattern(client, "addrs_above_10btc") - self._10k_btc: _0satsPattern = _0satsPattern(client, "addrs_above_10k_btc") - self._10k_sats: _0satsPattern = _0satsPattern(client, "addrs_above_10k_sats") - self._10m_sats: _0satsPattern = _0satsPattern(client, "addrs_above_10m_sats") - self._10sats: _0satsPattern = _0satsPattern(client, "addrs_above_10sats") - self._1btc: _0satsPattern = _0satsPattern(client, "addrs_above_1btc") - self._1k_btc: _0satsPattern = _0satsPattern(client, "addrs_above_1k_btc") - self._1k_sats: _0satsPattern = _0satsPattern(client, "addrs_above_1k_sats") - self._1m_sats: _0satsPattern = _0satsPattern(client, "addrs_above_1m_sats") - self._1sat: _0satsPattern = _0satsPattern(client, "addrs_above_1sat") - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self._100btc: _0satsPattern = _0satsPattern(client, 'addrs_above_100btc') + self._100k_sats: _0satsPattern = _0satsPattern(client, 'addrs_above_100k_sats') + self._100sats: _0satsPattern = _0satsPattern(client, 'addrs_above_100sats') + self._10btc: _0satsPattern = _0satsPattern(client, 'addrs_above_10btc') + self._10k_btc: _0satsPattern = _0satsPattern(client, 'addrs_above_10k_btc') + self._10k_sats: _0satsPattern = _0satsPattern(client, 'addrs_above_10k_sats') + self._10m_sats: _0satsPattern = _0satsPattern(client, 'addrs_above_10m_sats') + self._10sats: _0satsPattern = _0satsPattern(client, 'addrs_above_10sats') + self._1btc: _0satsPattern = _0satsPattern(client, 'addrs_above_1btc') + self._1k_btc: _0satsPattern = _0satsPattern(client, 'addrs_above_1k_btc') + self._1k_sats: _0satsPattern = _0satsPattern(client, 'addrs_above_1k_sats') + self._1m_sats: _0satsPattern = _0satsPattern(client, 'addrs_above_1m_sats') + self._1sat: _0satsPattern = _0satsPattern(client, 'addrs_above_1sat') class MetricsTree_Distribution_AddressCohorts_LtAmount: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self._100btc: _0satsPattern = _0satsPattern(client, "addrs_under_100btc") - self._100k_btc: _0satsPattern = _0satsPattern(client, "addrs_under_100k_btc") - self._100k_sats: _0satsPattern = _0satsPattern(client, "addrs_under_100k_sats") - self._100sats: _0satsPattern = _0satsPattern(client, "addrs_under_100sats") - self._10btc: _0satsPattern = _0satsPattern(client, "addrs_under_10btc") - self._10k_btc: _0satsPattern = _0satsPattern(client, "addrs_under_10k_btc") - self._10k_sats: _0satsPattern = _0satsPattern(client, "addrs_under_10k_sats") - self._10m_sats: _0satsPattern = _0satsPattern(client, "addrs_under_10m_sats") - self._10sats: _0satsPattern = _0satsPattern(client, "addrs_under_10sats") - self._1btc: _0satsPattern = _0satsPattern(client, "addrs_under_1btc") - self._1k_btc: _0satsPattern = _0satsPattern(client, "addrs_under_1k_btc") - self._1k_sats: _0satsPattern = _0satsPattern(client, "addrs_under_1k_sats") - self._1m_sats: _0satsPattern = _0satsPattern(client, "addrs_under_1m_sats") - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self._100btc: _0satsPattern = _0satsPattern(client, 'addrs_under_100btc') + self._100k_btc: _0satsPattern = _0satsPattern(client, 'addrs_under_100k_btc') + self._100k_sats: _0satsPattern = _0satsPattern(client, 'addrs_under_100k_sats') + self._100sats: _0satsPattern = _0satsPattern(client, 'addrs_under_100sats') + self._10btc: _0satsPattern = _0satsPattern(client, 'addrs_under_10btc') + self._10k_btc: _0satsPattern = _0satsPattern(client, 'addrs_under_10k_btc') + self._10k_sats: _0satsPattern = _0satsPattern(client, 'addrs_under_10k_sats') + self._10m_sats: _0satsPattern = _0satsPattern(client, 'addrs_under_10m_sats') + self._10sats: _0satsPattern = _0satsPattern(client, 'addrs_under_10sats') + self._1btc: _0satsPattern = _0satsPattern(client, 'addrs_under_1btc') + self._1k_btc: _0satsPattern = _0satsPattern(client, 'addrs_under_1k_btc') + self._1k_sats: _0satsPattern = _0satsPattern(client, 'addrs_under_1k_sats') + self._1m_sats: _0satsPattern = _0satsPattern(client, 'addrs_under_1m_sats') class MetricsTree_Distribution_AddressCohorts: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.amount_range: MetricsTree_Distribution_AddressCohorts_AmountRange = ( - MetricsTree_Distribution_AddressCohorts_AmountRange(client) - ) - self.ge_amount: MetricsTree_Distribution_AddressCohorts_GeAmount = ( - MetricsTree_Distribution_AddressCohorts_GeAmount(client) - ) - self.lt_amount: MetricsTree_Distribution_AddressCohorts_LtAmount = ( - MetricsTree_Distribution_AddressCohorts_LtAmount(client) - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.amount_range: MetricsTree_Distribution_AddressCohorts_AmountRange = MetricsTree_Distribution_AddressCohorts_AmountRange(client) + self.ge_amount: MetricsTree_Distribution_AddressCohorts_GeAmount = MetricsTree_Distribution_AddressCohorts_GeAmount(client) + self.lt_amount: MetricsTree_Distribution_AddressCohorts_LtAmount = MetricsTree_Distribution_AddressCohorts_LtAmount(client) class MetricsTree_Distribution_AddressesData: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.empty: MetricPattern32[EmptyAddressData] = MetricPattern32( - client, "emptyaddressdata" - ) - self.loaded: MetricPattern31[LoadedAddressData] = MetricPattern31( - client, "loadedaddressdata" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.empty: MetricPattern32[EmptyAddressData] = MetricPattern32(client, 'emptyaddressdata') + self.loaded: MetricPattern31[LoadedAddressData] = MetricPattern31(client, 'loadedaddressdata') class MetricsTree_Distribution_AnyAddressIndexes: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.p2a: MetricPattern16[AnyAddressIndex] = MetricPattern16( - client, "anyaddressindex" - ) - self.p2pk33: MetricPattern18[AnyAddressIndex] = MetricPattern18( - client, "anyaddressindex" - ) - self.p2pk65: MetricPattern19[AnyAddressIndex] = MetricPattern19( - client, "anyaddressindex" - ) - self.p2pkh: MetricPattern20[AnyAddressIndex] = MetricPattern20( - client, "anyaddressindex" - ) - self.p2sh: MetricPattern21[AnyAddressIndex] = MetricPattern21( - client, "anyaddressindex" - ) - self.p2tr: MetricPattern22[AnyAddressIndex] = MetricPattern22( - client, "anyaddressindex" - ) - self.p2wpkh: MetricPattern23[AnyAddressIndex] = MetricPattern23( - client, "anyaddressindex" - ) - self.p2wsh: MetricPattern24[AnyAddressIndex] = MetricPattern24( - client, "anyaddressindex" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.p2a: MetricPattern16[AnyAddressIndex] = MetricPattern16(client, 'anyaddressindex') + self.p2pk33: MetricPattern18[AnyAddressIndex] = MetricPattern18(client, 'anyaddressindex') + self.p2pk65: MetricPattern19[AnyAddressIndex] = MetricPattern19(client, 'anyaddressindex') + self.p2pkh: MetricPattern20[AnyAddressIndex] = MetricPattern20(client, 'anyaddressindex') + self.p2sh: MetricPattern21[AnyAddressIndex] = MetricPattern21(client, 'anyaddressindex') + self.p2tr: MetricPattern22[AnyAddressIndex] = MetricPattern22(client, 'anyaddressindex') + self.p2wpkh: MetricPattern23[AnyAddressIndex] = MetricPattern23(client, 'anyaddressindex') + self.p2wsh: MetricPattern24[AnyAddressIndex] = MetricPattern24(client, 'anyaddressindex') class MetricsTree_Distribution_UtxoCohorts_AgeRange: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self._10y_to_12y: _10yTo12yPattern = _10yTo12yPattern( - client, "utxos_at_least_10y_up_to_12y_old" - ) - self._12y_to_15y: _10yTo12yPattern = _10yTo12yPattern( - client, "utxos_at_least_12y_up_to_15y_old" - ) - self._1d_to_1w: _10yTo12yPattern = _10yTo12yPattern( - client, "utxos_at_least_1d_up_to_1w_old" - ) - self._1h_to_1d: _10yTo12yPattern = _10yTo12yPattern( - client, "utxos_at_least_1h_up_to_1d_old" - ) - self._1m_to_2m: _10yTo12yPattern = _10yTo12yPattern( - client, "utxos_at_least_1m_up_to_2m_old" - ) - self._1w_to_1m: _10yTo12yPattern = _10yTo12yPattern( - client, "utxos_at_least_1w_up_to_1m_old" - ) - self._1y_to_2y: _10yTo12yPattern = _10yTo12yPattern( - client, "utxos_at_least_1y_up_to_2y_old" - ) - self._2m_to_3m: _10yTo12yPattern = _10yTo12yPattern( - client, "utxos_at_least_2m_up_to_3m_old" - ) - self._2y_to_3y: _10yTo12yPattern = _10yTo12yPattern( - client, "utxos_at_least_2y_up_to_3y_old" - ) - self._3m_to_4m: _10yTo12yPattern = _10yTo12yPattern( - client, "utxos_at_least_3m_up_to_4m_old" - ) - self._3y_to_4y: _10yTo12yPattern = _10yTo12yPattern( - client, "utxos_at_least_3y_up_to_4y_old" - ) - self._4m_to_5m: _10yTo12yPattern = _10yTo12yPattern( - client, "utxos_at_least_4m_up_to_5m_old" - ) - self._4y_to_5y: _10yTo12yPattern = _10yTo12yPattern( - client, "utxos_at_least_4y_up_to_5y_old" - ) - self._5m_to_6m: _10yTo12yPattern = _10yTo12yPattern( - client, "utxos_at_least_5m_up_to_6m_old" - ) - self._5y_to_6y: _10yTo12yPattern = _10yTo12yPattern( - client, "utxos_at_least_5y_up_to_6y_old" - ) - self._6m_to_1y: _10yTo12yPattern = _10yTo12yPattern( - client, "utxos_at_least_6m_up_to_1y_old" - ) - self._6y_to_7y: _10yTo12yPattern = _10yTo12yPattern( - client, "utxos_at_least_6y_up_to_7y_old" - ) - self._7y_to_8y: _10yTo12yPattern = _10yTo12yPattern( - client, "utxos_at_least_7y_up_to_8y_old" - ) - self._8y_to_10y: _10yTo12yPattern = _10yTo12yPattern( - client, "utxos_at_least_8y_up_to_10y_old" - ) - self.from_15y: _10yTo12yPattern = _10yTo12yPattern( - client, "utxos_at_least_15y_old" - ) - self.up_to_1h: _10yTo12yPattern = _10yTo12yPattern(client, "utxos_up_to_1h_old") - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self._10y_to_12y: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_at_least_10y_up_to_12y_old') + self._12y_to_15y: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_at_least_12y_up_to_15y_old') + self._1d_to_1w: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_at_least_1d_up_to_1w_old') + self._1h_to_1d: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_at_least_1h_up_to_1d_old') + self._1m_to_2m: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_at_least_1m_up_to_2m_old') + self._1w_to_1m: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_at_least_1w_up_to_1m_old') + self._1y_to_2y: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_at_least_1y_up_to_2y_old') + self._2m_to_3m: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_at_least_2m_up_to_3m_old') + self._2y_to_3y: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_at_least_2y_up_to_3y_old') + self._3m_to_4m: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_at_least_3m_up_to_4m_old') + self._3y_to_4y: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_at_least_3y_up_to_4y_old') + self._4m_to_5m: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_at_least_4m_up_to_5m_old') + self._4y_to_5y: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_at_least_4y_up_to_5y_old') + self._5m_to_6m: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_at_least_5m_up_to_6m_old') + self._5y_to_6y: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_at_least_5y_up_to_6y_old') + self._6m_to_1y: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_at_least_6m_up_to_1y_old') + self._6y_to_7y: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_at_least_6y_up_to_7y_old') + self._7y_to_8y: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_at_least_7y_up_to_8y_old') + self._8y_to_10y: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_at_least_8y_up_to_10y_old') + self.from_15y: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_at_least_15y_old') + self.up_to_1h: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_up_to_1h_old') class MetricsTree_Distribution_UtxoCohorts_All_Relative: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.neg_unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1[ - StoredF32 - ] = MetricPattern1( - client, "neg_unrealized_loss_rel_to_own_total_unrealized_pnl" - ) - self.net_unrealized_pnl_rel_to_own_total_unrealized_pnl: MetricPattern1[ - StoredF32 - ] = MetricPattern1(client, "net_unrealized_pnl_rel_to_own_total_unrealized_pnl") - self.supply_in_loss_rel_to_own_supply: MetricPattern1[StoredF64] = ( - MetricPattern1(client, "supply_in_loss_rel_to_own_supply") - ) - self.supply_in_profit_rel_to_own_supply: MetricPattern1[StoredF64] = ( - MetricPattern1(client, "supply_in_profit_rel_to_own_supply") - ) - self.unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1[ - StoredF32 - ] = MetricPattern1(client, "unrealized_loss_rel_to_own_total_unrealized_pnl") - self.unrealized_profit_rel_to_own_total_unrealized_pnl: MetricPattern1[ - StoredF32 - ] = MetricPattern1(client, "unrealized_profit_rel_to_own_total_unrealized_pnl") - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.neg_unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1[StoredF32] = MetricPattern1(client, 'neg_unrealized_loss_rel_to_own_total_unrealized_pnl') + self.net_unrealized_pnl_rel_to_own_total_unrealized_pnl: MetricPattern1[StoredF32] = MetricPattern1(client, 'net_unrealized_pnl_rel_to_own_total_unrealized_pnl') + self.supply_in_loss_rel_to_own_supply: MetricPattern1[StoredF64] = MetricPattern1(client, 'supply_in_loss_rel_to_own_supply') + self.supply_in_profit_rel_to_own_supply: MetricPattern1[StoredF64] = MetricPattern1(client, 'supply_in_profit_rel_to_own_supply') + self.unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1[StoredF32] = MetricPattern1(client, 'unrealized_loss_rel_to_own_total_unrealized_pnl') + self.unrealized_profit_rel_to_own_total_unrealized_pnl: MetricPattern1[StoredF32] = MetricPattern1(client, 'unrealized_profit_rel_to_own_total_unrealized_pnl') class MetricsTree_Distribution_UtxoCohorts_All: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.activity: ActivityPattern2 = ActivityPattern2(client, "destroyed") - self.cost_basis: CostBasisPattern2 = CostBasisPattern2(client, "cost_basis") - self.outputs: OutputsPattern = OutputsPattern(client, "utxo_count") - self.realized: RealizedPattern3 = RealizedPattern3(client, "") - self.relative: MetricsTree_Distribution_UtxoCohorts_All_Relative = ( - MetricsTree_Distribution_UtxoCohorts_All_Relative(client) - ) - self.supply: SupplyPattern2 = SupplyPattern2(client, "supply") - self.unrealized: UnrealizedPattern = UnrealizedPattern(client, "") - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.activity: ActivityPattern2 = ActivityPattern2(client, 'destroyed') + self.cost_basis: CostBasisPattern2 = CostBasisPattern2(client, 'cost_basis') + self.outputs: OutputsPattern = OutputsPattern(client, 'utxo_count') + self.realized: RealizedPattern3 = RealizedPattern3(client, '') + self.relative: MetricsTree_Distribution_UtxoCohorts_All_Relative = MetricsTree_Distribution_UtxoCohorts_All_Relative(client) + self.supply: SupplyPattern2 = SupplyPattern2(client, 'supply') + self.unrealized: UnrealizedPattern = UnrealizedPattern(client, '') class MetricsTree_Distribution_UtxoCohorts_AmountRange: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self._0sats: _0satsPattern2 = _0satsPattern2(client, "utxos_with_0sats") - self._100btc_to_1k_btc: _0satsPattern2 = _0satsPattern2( - client, "utxos_above_100btc_under_1k_btc" - ) - self._100k_btc_or_more: _0satsPattern2 = _0satsPattern2( - client, "utxos_above_100k_btc" - ) - self._100k_sats_to_1m_sats: _0satsPattern2 = _0satsPattern2( - client, "utxos_above_100k_sats_under_1m_sats" - ) - self._100sats_to_1k_sats: _0satsPattern2 = _0satsPattern2( - client, "utxos_above_100sats_under_1k_sats" - ) - self._10btc_to_100btc: _0satsPattern2 = _0satsPattern2( - client, "utxos_above_10btc_under_100btc" - ) - self._10k_btc_to_100k_btc: _0satsPattern2 = _0satsPattern2( - client, "utxos_above_10k_btc_under_100k_btc" - ) - self._10k_sats_to_100k_sats: _0satsPattern2 = _0satsPattern2( - client, "utxos_above_10k_sats_under_100k_sats" - ) - self._10m_sats_to_1btc: _0satsPattern2 = _0satsPattern2( - client, "utxos_above_10m_sats_under_1btc" - ) - self._10sats_to_100sats: _0satsPattern2 = _0satsPattern2( - client, "utxos_above_10sats_under_100sats" - ) - self._1btc_to_10btc: _0satsPattern2 = _0satsPattern2( - client, "utxos_above_1btc_under_10btc" - ) - self._1k_btc_to_10k_btc: _0satsPattern2 = _0satsPattern2( - client, "utxos_above_1k_btc_under_10k_btc" - ) - self._1k_sats_to_10k_sats: _0satsPattern2 = _0satsPattern2( - client, "utxos_above_1k_sats_under_10k_sats" - ) - self._1m_sats_to_10m_sats: _0satsPattern2 = _0satsPattern2( - client, "utxos_above_1m_sats_under_10m_sats" - ) - self._1sat_to_10sats: _0satsPattern2 = _0satsPattern2( - client, "utxos_above_1sat_under_10sats" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self._0sats: _0satsPattern2 = _0satsPattern2(client, 'utxos_with_0sats') + self._100btc_to_1k_btc: _0satsPattern2 = _0satsPattern2(client, 'utxos_above_100btc_under_1k_btc') + self._100k_btc_or_more: _0satsPattern2 = _0satsPattern2(client, 'utxos_above_100k_btc') + self._100k_sats_to_1m_sats: _0satsPattern2 = _0satsPattern2(client, 'utxos_above_100k_sats_under_1m_sats') + self._100sats_to_1k_sats: _0satsPattern2 = _0satsPattern2(client, 'utxos_above_100sats_under_1k_sats') + self._10btc_to_100btc: _0satsPattern2 = _0satsPattern2(client, 'utxos_above_10btc_under_100btc') + self._10k_btc_to_100k_btc: _0satsPattern2 = _0satsPattern2(client, 'utxos_above_10k_btc_under_100k_btc') + self._10k_sats_to_100k_sats: _0satsPattern2 = _0satsPattern2(client, 'utxos_above_10k_sats_under_100k_sats') + self._10m_sats_to_1btc: _0satsPattern2 = _0satsPattern2(client, 'utxos_above_10m_sats_under_1btc') + self._10sats_to_100sats: _0satsPattern2 = _0satsPattern2(client, 'utxos_above_10sats_under_100sats') + self._1btc_to_10btc: _0satsPattern2 = _0satsPattern2(client, 'utxos_above_1btc_under_10btc') + self._1k_btc_to_10k_btc: _0satsPattern2 = _0satsPattern2(client, 'utxos_above_1k_btc_under_10k_btc') + self._1k_sats_to_10k_sats: _0satsPattern2 = _0satsPattern2(client, 'utxos_above_1k_sats_under_10k_sats') + self._1m_sats_to_10m_sats: _0satsPattern2 = _0satsPattern2(client, 'utxos_above_1m_sats_under_10m_sats') + self._1sat_to_10sats: _0satsPattern2 = _0satsPattern2(client, 'utxos_above_1sat_under_10sats') class MetricsTree_Distribution_UtxoCohorts_Epoch: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self._0: _0satsPattern2 = _0satsPattern2(client, "epoch_0") - self._1: _0satsPattern2 = _0satsPattern2(client, "epoch_1") - self._2: _0satsPattern2 = _0satsPattern2(client, "epoch_2") - self._3: _0satsPattern2 = _0satsPattern2(client, "epoch_3") - self._4: _0satsPattern2 = _0satsPattern2(client, "epoch_4") - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self._0: _0satsPattern2 = _0satsPattern2(client, 'epoch_0') + self._1: _0satsPattern2 = _0satsPattern2(client, 'epoch_1') + self._2: _0satsPattern2 = _0satsPattern2(client, 'epoch_2') + self._3: _0satsPattern2 = _0satsPattern2(client, 'epoch_3') + self._4: _0satsPattern2 = _0satsPattern2(client, 'epoch_4') class MetricsTree_Distribution_UtxoCohorts_GeAmount: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self._100btc: _100btcPattern = _100btcPattern(client, "utxos_above_100btc") - self._100k_sats: _100btcPattern = _100btcPattern( - client, "utxos_above_100k_sats" - ) - self._100sats: _100btcPattern = _100btcPattern(client, "utxos_above_100sats") - self._10btc: _100btcPattern = _100btcPattern(client, "utxos_above_10btc") - self._10k_btc: _100btcPattern = _100btcPattern(client, "utxos_above_10k_btc") - self._10k_sats: _100btcPattern = _100btcPattern(client, "utxos_above_10k_sats") - self._10m_sats: _100btcPattern = _100btcPattern(client, "utxos_above_10m_sats") - self._10sats: _100btcPattern = _100btcPattern(client, "utxos_above_10sats") - self._1btc: _100btcPattern = _100btcPattern(client, "utxos_above_1btc") - self._1k_btc: _100btcPattern = _100btcPattern(client, "utxos_above_1k_btc") - self._1k_sats: _100btcPattern = _100btcPattern(client, "utxos_above_1k_sats") - self._1m_sats: _100btcPattern = _100btcPattern(client, "utxos_above_1m_sats") - self._1sat: _100btcPattern = _100btcPattern(client, "utxos_above_1sat") - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self._100btc: _100btcPattern = _100btcPattern(client, 'utxos_above_100btc') + self._100k_sats: _100btcPattern = _100btcPattern(client, 'utxos_above_100k_sats') + self._100sats: _100btcPattern = _100btcPattern(client, 'utxos_above_100sats') + self._10btc: _100btcPattern = _100btcPattern(client, 'utxos_above_10btc') + self._10k_btc: _100btcPattern = _100btcPattern(client, 'utxos_above_10k_btc') + self._10k_sats: _100btcPattern = _100btcPattern(client, 'utxos_above_10k_sats') + self._10m_sats: _100btcPattern = _100btcPattern(client, 'utxos_above_10m_sats') + self._10sats: _100btcPattern = _100btcPattern(client, 'utxos_above_10sats') + self._1btc: _100btcPattern = _100btcPattern(client, 'utxos_above_1btc') + self._1k_btc: _100btcPattern = _100btcPattern(client, 'utxos_above_1k_btc') + self._1k_sats: _100btcPattern = _100btcPattern(client, 'utxos_above_1k_sats') + self._1m_sats: _100btcPattern = _100btcPattern(client, 'utxos_above_1m_sats') + self._1sat: _100btcPattern = _100btcPattern(client, 'utxos_above_1sat') class MetricsTree_Distribution_UtxoCohorts_LtAmount: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self._100btc: _100btcPattern = _100btcPattern(client, "utxos_under_100btc") - self._100k_btc: _100btcPattern = _100btcPattern(client, "utxos_under_100k_btc") - self._100k_sats: _100btcPattern = _100btcPattern( - client, "utxos_under_100k_sats" - ) - self._100sats: _100btcPattern = _100btcPattern(client, "utxos_under_100sats") - self._10btc: _100btcPattern = _100btcPattern(client, "utxos_under_10btc") - self._10k_btc: _100btcPattern = _100btcPattern(client, "utxos_under_10k_btc") - self._10k_sats: _100btcPattern = _100btcPattern(client, "utxos_under_10k_sats") - self._10m_sats: _100btcPattern = _100btcPattern(client, "utxos_under_10m_sats") - self._10sats: _100btcPattern = _100btcPattern(client, "utxos_under_10sats") - self._1btc: _100btcPattern = _100btcPattern(client, "utxos_under_1btc") - self._1k_btc: _100btcPattern = _100btcPattern(client, "utxos_under_1k_btc") - self._1k_sats: _100btcPattern = _100btcPattern(client, "utxos_under_1k_sats") - self._1m_sats: _100btcPattern = _100btcPattern(client, "utxos_under_1m_sats") - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self._100btc: _100btcPattern = _100btcPattern(client, 'utxos_under_100btc') + self._100k_btc: _100btcPattern = _100btcPattern(client, 'utxos_under_100k_btc') + self._100k_sats: _100btcPattern = _100btcPattern(client, 'utxos_under_100k_sats') + self._100sats: _100btcPattern = _100btcPattern(client, 'utxos_under_100sats') + self._10btc: _100btcPattern = _100btcPattern(client, 'utxos_under_10btc') + self._10k_btc: _100btcPattern = _100btcPattern(client, 'utxos_under_10k_btc') + self._10k_sats: _100btcPattern = _100btcPattern(client, 'utxos_under_10k_sats') + self._10m_sats: _100btcPattern = _100btcPattern(client, 'utxos_under_10m_sats') + self._10sats: _100btcPattern = _100btcPattern(client, 'utxos_under_10sats') + self._1btc: _100btcPattern = _100btcPattern(client, 'utxos_under_1btc') + self._1k_btc: _100btcPattern = _100btcPattern(client, 'utxos_under_1k_btc') + self._1k_sats: _100btcPattern = _100btcPattern(client, 'utxos_under_1k_sats') + self._1m_sats: _100btcPattern = _100btcPattern(client, 'utxos_under_1m_sats') class MetricsTree_Distribution_UtxoCohorts_MaxAge: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self._10y: _10yPattern = _10yPattern(client, "utxos_up_to_10y_old") - self._12y: _10yPattern = _10yPattern(client, "utxos_up_to_12y_old") - self._15y: _10yPattern = _10yPattern(client, "utxos_up_to_15y_old") - self._1m: _10yPattern = _10yPattern(client, "utxos_up_to_1m_old") - self._1w: _10yPattern = _10yPattern(client, "utxos_up_to_1w_old") - self._1y: _10yPattern = _10yPattern(client, "utxos_up_to_1y_old") - self._2m: _10yPattern = _10yPattern(client, "utxos_up_to_2m_old") - self._2y: _10yPattern = _10yPattern(client, "utxos_up_to_2y_old") - self._3m: _10yPattern = _10yPattern(client, "utxos_up_to_3m_old") - self._3y: _10yPattern = _10yPattern(client, "utxos_up_to_3y_old") - self._4m: _10yPattern = _10yPattern(client, "utxos_up_to_4m_old") - self._4y: _10yPattern = _10yPattern(client, "utxos_up_to_4y_old") - self._5m: _10yPattern = _10yPattern(client, "utxos_up_to_5m_old") - self._5y: _10yPattern = _10yPattern(client, "utxos_up_to_5y_old") - self._6m: _10yPattern = _10yPattern(client, "utxos_up_to_6m_old") - self._6y: _10yPattern = _10yPattern(client, "utxos_up_to_6y_old") - self._7y: _10yPattern = _10yPattern(client, "utxos_up_to_7y_old") - self._8y: _10yPattern = _10yPattern(client, "utxos_up_to_8y_old") - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self._10y: _10yPattern = _10yPattern(client, 'utxos_up_to_10y_old') + self._12y: _10yPattern = _10yPattern(client, 'utxos_up_to_12y_old') + self._15y: _10yPattern = _10yPattern(client, 'utxos_up_to_15y_old') + self._1m: _10yPattern = _10yPattern(client, 'utxos_up_to_1m_old') + self._1w: _10yPattern = _10yPattern(client, 'utxos_up_to_1w_old') + self._1y: _10yPattern = _10yPattern(client, 'utxos_up_to_1y_old') + self._2m: _10yPattern = _10yPattern(client, 'utxos_up_to_2m_old') + self._2y: _10yPattern = _10yPattern(client, 'utxos_up_to_2y_old') + self._3m: _10yPattern = _10yPattern(client, 'utxos_up_to_3m_old') + self._3y: _10yPattern = _10yPattern(client, 'utxos_up_to_3y_old') + self._4m: _10yPattern = _10yPattern(client, 'utxos_up_to_4m_old') + self._4y: _10yPattern = _10yPattern(client, 'utxos_up_to_4y_old') + self._5m: _10yPattern = _10yPattern(client, 'utxos_up_to_5m_old') + self._5y: _10yPattern = _10yPattern(client, 'utxos_up_to_5y_old') + self._6m: _10yPattern = _10yPattern(client, 'utxos_up_to_6m_old') + self._6y: _10yPattern = _10yPattern(client, 'utxos_up_to_6y_old') + self._7y: _10yPattern = _10yPattern(client, 'utxos_up_to_7y_old') + self._8y: _10yPattern = _10yPattern(client, 'utxos_up_to_8y_old') class MetricsTree_Distribution_UtxoCohorts_MinAge: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self._10y: _100btcPattern = _100btcPattern(client, "utxos_at_least_10y_old") - self._12y: _100btcPattern = _100btcPattern(client, "utxos_at_least_12y_old") - self._1d: _100btcPattern = _100btcPattern(client, "utxos_at_least_1d_old") - self._1m: _100btcPattern = _100btcPattern(client, "utxos_at_least_1m_old") - self._1w: _100btcPattern = _100btcPattern(client, "utxos_at_least_1w_old") - self._1y: _100btcPattern = _100btcPattern(client, "utxos_at_least_1y_old") - self._2m: _100btcPattern = _100btcPattern(client, "utxos_at_least_2m_old") - self._2y: _100btcPattern = _100btcPattern(client, "utxos_at_least_2y_old") - self._3m: _100btcPattern = _100btcPattern(client, "utxos_at_least_3m_old") - self._3y: _100btcPattern = _100btcPattern(client, "utxos_at_least_3y_old") - self._4m: _100btcPattern = _100btcPattern(client, "utxos_at_least_4m_old") - self._4y: _100btcPattern = _100btcPattern(client, "utxos_at_least_4y_old") - self._5m: _100btcPattern = _100btcPattern(client, "utxos_at_least_5m_old") - self._5y: _100btcPattern = _100btcPattern(client, "utxos_at_least_5y_old") - self._6m: _100btcPattern = _100btcPattern(client, "utxos_at_least_6m_old") - self._6y: _100btcPattern = _100btcPattern(client, "utxos_at_least_6y_old") - self._7y: _100btcPattern = _100btcPattern(client, "utxos_at_least_7y_old") - self._8y: _100btcPattern = _100btcPattern(client, "utxos_at_least_8y_old") - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self._10y: _100btcPattern = _100btcPattern(client, 'utxos_at_least_10y_old') + self._12y: _100btcPattern = _100btcPattern(client, 'utxos_at_least_12y_old') + self._1d: _100btcPattern = _100btcPattern(client, 'utxos_at_least_1d_old') + self._1m: _100btcPattern = _100btcPattern(client, 'utxos_at_least_1m_old') + self._1w: _100btcPattern = _100btcPattern(client, 'utxos_at_least_1w_old') + self._1y: _100btcPattern = _100btcPattern(client, 'utxos_at_least_1y_old') + self._2m: _100btcPattern = _100btcPattern(client, 'utxos_at_least_2m_old') + self._2y: _100btcPattern = _100btcPattern(client, 'utxos_at_least_2y_old') + self._3m: _100btcPattern = _100btcPattern(client, 'utxos_at_least_3m_old') + self._3y: _100btcPattern = _100btcPattern(client, 'utxos_at_least_3y_old') + self._4m: _100btcPattern = _100btcPattern(client, 'utxos_at_least_4m_old') + self._4y: _100btcPattern = _100btcPattern(client, 'utxos_at_least_4y_old') + self._5m: _100btcPattern = _100btcPattern(client, 'utxos_at_least_5m_old') + self._5y: _100btcPattern = _100btcPattern(client, 'utxos_at_least_5y_old') + self._6m: _100btcPattern = _100btcPattern(client, 'utxos_at_least_6m_old') + self._6y: _100btcPattern = _100btcPattern(client, 'utxos_at_least_6y_old') + self._7y: _100btcPattern = _100btcPattern(client, 'utxos_at_least_7y_old') + self._8y: _100btcPattern = _100btcPattern(client, 'utxos_at_least_8y_old') class MetricsTree_Distribution_UtxoCohorts_Term_Long: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.activity: ActivityPattern2 = ActivityPattern2(client, "lth") - self.cost_basis: CostBasisPattern2 = CostBasisPattern2(client, "lth") - self.outputs: OutputsPattern = OutputsPattern(client, "lth_utxo_count") - self.realized: RealizedPattern2 = RealizedPattern2(client, "lth") - self.relative: RelativePattern5 = RelativePattern5(client, "lth") - self.supply: SupplyPattern2 = SupplyPattern2(client, "lth_supply") - self.unrealized: UnrealizedPattern = UnrealizedPattern(client, "lth") - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.activity: ActivityPattern2 = ActivityPattern2(client, 'lth') + self.cost_basis: CostBasisPattern2 = CostBasisPattern2(client, 'lth') + self.outputs: OutputsPattern = OutputsPattern(client, 'lth_utxo_count') + 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: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.activity: ActivityPattern2 = ActivityPattern2(client, "sth") - self.cost_basis: CostBasisPattern2 = CostBasisPattern2(client, "sth") - self.outputs: OutputsPattern = OutputsPattern(client, "sth_utxo_count") - self.realized: RealizedPattern3 = RealizedPattern3(client, "sth") - self.relative: RelativePattern5 = RelativePattern5(client, "sth") - self.supply: SupplyPattern2 = SupplyPattern2(client, "sth_supply") - self.unrealized: UnrealizedPattern = UnrealizedPattern(client, "sth") - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.activity: ActivityPattern2 = ActivityPattern2(client, 'sth') + self.cost_basis: CostBasisPattern2 = CostBasisPattern2(client, 'sth') + self.outputs: OutputsPattern = OutputsPattern(client, 'sth_utxo_count') + self.realized: RealizedPattern3 = RealizedPattern3(client, 'sth') + self.relative: RelativePattern5 = RelativePattern5(client, 'sth') + self.supply: SupplyPattern2 = SupplyPattern2(client, 'sth_supply') + self.unrealized: UnrealizedPattern = UnrealizedPattern(client, 'sth') class MetricsTree_Distribution_UtxoCohorts_Term: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.long: MetricsTree_Distribution_UtxoCohorts_Term_Long = ( - MetricsTree_Distribution_UtxoCohorts_Term_Long(client) - ) - self.short: MetricsTree_Distribution_UtxoCohorts_Term_Short = ( - MetricsTree_Distribution_UtxoCohorts_Term_Short(client) - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.long: MetricsTree_Distribution_UtxoCohorts_Term_Long = MetricsTree_Distribution_UtxoCohorts_Term_Long(client) + self.short: MetricsTree_Distribution_UtxoCohorts_Term_Short = MetricsTree_Distribution_UtxoCohorts_Term_Short(client) class MetricsTree_Distribution_UtxoCohorts_Type: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.empty: _0satsPattern2 = _0satsPattern2(client, "empty_outputs") - self.p2a: _0satsPattern2 = _0satsPattern2(client, "p2a") - self.p2ms: _0satsPattern2 = _0satsPattern2(client, "p2ms") - self.p2pk33: _0satsPattern2 = _0satsPattern2(client, "p2pk33") - self.p2pk65: _0satsPattern2 = _0satsPattern2(client, "p2pk65") - self.p2pkh: _0satsPattern2 = _0satsPattern2(client, "p2pkh") - self.p2sh: _0satsPattern2 = _0satsPattern2(client, "p2sh") - self.p2tr: _0satsPattern2 = _0satsPattern2(client, "p2tr") - self.p2wpkh: _0satsPattern2 = _0satsPattern2(client, "p2wpkh") - self.p2wsh: _0satsPattern2 = _0satsPattern2(client, "p2wsh") - self.unknown: _0satsPattern2 = _0satsPattern2(client, "unknown_outputs") - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.empty: _0satsPattern2 = _0satsPattern2(client, 'empty_outputs') + self.p2a: _0satsPattern2 = _0satsPattern2(client, 'p2a') + self.p2ms: _0satsPattern2 = _0satsPattern2(client, 'p2ms') + self.p2pk33: _0satsPattern2 = _0satsPattern2(client, 'p2pk33') + self.p2pk65: _0satsPattern2 = _0satsPattern2(client, 'p2pk65') + self.p2pkh: _0satsPattern2 = _0satsPattern2(client, 'p2pkh') + self.p2sh: _0satsPattern2 = _0satsPattern2(client, 'p2sh') + self.p2tr: _0satsPattern2 = _0satsPattern2(client, 'p2tr') + self.p2wpkh: _0satsPattern2 = _0satsPattern2(client, 'p2wpkh') + self.p2wsh: _0satsPattern2 = _0satsPattern2(client, 'p2wsh') + self.unknown: _0satsPattern2 = _0satsPattern2(client, 'unknown_outputs') class MetricsTree_Distribution_UtxoCohorts_Year: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self._2009: _0satsPattern2 = _0satsPattern2(client, "year_2009") - self._2010: _0satsPattern2 = _0satsPattern2(client, "year_2010") - self._2011: _0satsPattern2 = _0satsPattern2(client, "year_2011") - self._2012: _0satsPattern2 = _0satsPattern2(client, "year_2012") - self._2013: _0satsPattern2 = _0satsPattern2(client, "year_2013") - self._2014: _0satsPattern2 = _0satsPattern2(client, "year_2014") - self._2015: _0satsPattern2 = _0satsPattern2(client, "year_2015") - self._2016: _0satsPattern2 = _0satsPattern2(client, "year_2016") - self._2017: _0satsPattern2 = _0satsPattern2(client, "year_2017") - self._2018: _0satsPattern2 = _0satsPattern2(client, "year_2018") - self._2019: _0satsPattern2 = _0satsPattern2(client, "year_2019") - self._2020: _0satsPattern2 = _0satsPattern2(client, "year_2020") - self._2021: _0satsPattern2 = _0satsPattern2(client, "year_2021") - self._2022: _0satsPattern2 = _0satsPattern2(client, "year_2022") - self._2023: _0satsPattern2 = _0satsPattern2(client, "year_2023") - self._2024: _0satsPattern2 = _0satsPattern2(client, "year_2024") - self._2025: _0satsPattern2 = _0satsPattern2(client, "year_2025") - self._2026: _0satsPattern2 = _0satsPattern2(client, "year_2026") - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self._2009: _0satsPattern2 = _0satsPattern2(client, 'year_2009') + self._2010: _0satsPattern2 = _0satsPattern2(client, 'year_2010') + self._2011: _0satsPattern2 = _0satsPattern2(client, 'year_2011') + self._2012: _0satsPattern2 = _0satsPattern2(client, 'year_2012') + self._2013: _0satsPattern2 = _0satsPattern2(client, 'year_2013') + self._2014: _0satsPattern2 = _0satsPattern2(client, 'year_2014') + self._2015: _0satsPattern2 = _0satsPattern2(client, 'year_2015') + self._2016: _0satsPattern2 = _0satsPattern2(client, 'year_2016') + self._2017: _0satsPattern2 = _0satsPattern2(client, 'year_2017') + self._2018: _0satsPattern2 = _0satsPattern2(client, 'year_2018') + self._2019: _0satsPattern2 = _0satsPattern2(client, 'year_2019') + self._2020: _0satsPattern2 = _0satsPattern2(client, 'year_2020') + self._2021: _0satsPattern2 = _0satsPattern2(client, 'year_2021') + self._2022: _0satsPattern2 = _0satsPattern2(client, 'year_2022') + self._2023: _0satsPattern2 = _0satsPattern2(client, 'year_2023') + self._2024: _0satsPattern2 = _0satsPattern2(client, 'year_2024') + self._2025: _0satsPattern2 = _0satsPattern2(client, 'year_2025') + self._2026: _0satsPattern2 = _0satsPattern2(client, 'year_2026') class MetricsTree_Distribution_UtxoCohorts: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.age_range: MetricsTree_Distribution_UtxoCohorts_AgeRange = ( - MetricsTree_Distribution_UtxoCohorts_AgeRange(client) - ) - self.all: MetricsTree_Distribution_UtxoCohorts_All = ( - MetricsTree_Distribution_UtxoCohorts_All(client) - ) - self.amount_range: MetricsTree_Distribution_UtxoCohorts_AmountRange = ( - MetricsTree_Distribution_UtxoCohorts_AmountRange(client) - ) - self.epoch: MetricsTree_Distribution_UtxoCohorts_Epoch = ( - MetricsTree_Distribution_UtxoCohorts_Epoch(client) - ) - self.ge_amount: MetricsTree_Distribution_UtxoCohorts_GeAmount = ( - MetricsTree_Distribution_UtxoCohorts_GeAmount(client) - ) - self.lt_amount: MetricsTree_Distribution_UtxoCohorts_LtAmount = ( - MetricsTree_Distribution_UtxoCohorts_LtAmount(client) - ) - self.max_age: MetricsTree_Distribution_UtxoCohorts_MaxAge = ( - MetricsTree_Distribution_UtxoCohorts_MaxAge(client) - ) - self.min_age: MetricsTree_Distribution_UtxoCohorts_MinAge = ( - MetricsTree_Distribution_UtxoCohorts_MinAge(client) - ) - self.term: MetricsTree_Distribution_UtxoCohorts_Term = ( - MetricsTree_Distribution_UtxoCohorts_Term(client) - ) - self.type_: MetricsTree_Distribution_UtxoCohorts_Type = ( - MetricsTree_Distribution_UtxoCohorts_Type(client) - ) - self.year: MetricsTree_Distribution_UtxoCohorts_Year = ( - MetricsTree_Distribution_UtxoCohorts_Year(client) - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.age_range: MetricsTree_Distribution_UtxoCohorts_AgeRange = MetricsTree_Distribution_UtxoCohorts_AgeRange(client) + self.all: MetricsTree_Distribution_UtxoCohorts_All = MetricsTree_Distribution_UtxoCohorts_All(client) + self.amount_range: MetricsTree_Distribution_UtxoCohorts_AmountRange = MetricsTree_Distribution_UtxoCohorts_AmountRange(client) + self.epoch: MetricsTree_Distribution_UtxoCohorts_Epoch = MetricsTree_Distribution_UtxoCohorts_Epoch(client) + self.ge_amount: MetricsTree_Distribution_UtxoCohorts_GeAmount = MetricsTree_Distribution_UtxoCohorts_GeAmount(client) + self.lt_amount: MetricsTree_Distribution_UtxoCohorts_LtAmount = MetricsTree_Distribution_UtxoCohorts_LtAmount(client) + self.max_age: MetricsTree_Distribution_UtxoCohorts_MaxAge = MetricsTree_Distribution_UtxoCohorts_MaxAge(client) + self.min_age: MetricsTree_Distribution_UtxoCohorts_MinAge = MetricsTree_Distribution_UtxoCohorts_MinAge(client) + self.term: MetricsTree_Distribution_UtxoCohorts_Term = MetricsTree_Distribution_UtxoCohorts_Term(client) + self.type_: MetricsTree_Distribution_UtxoCohorts_Type = MetricsTree_Distribution_UtxoCohorts_Type(client) + self.year: MetricsTree_Distribution_UtxoCohorts_Year = MetricsTree_Distribution_UtxoCohorts_Year(client) class MetricsTree_Distribution: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.addr_count: AddrCountPattern = AddrCountPattern(client, "addr_count") - 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: AddrCountPattern = AddrCountPattern( - client, "empty_addr_count" - ) - self.emptyaddressindex: MetricPattern32[EmptyAddressIndex] = MetricPattern32( - client, "emptyaddressindex" - ) - self.loadedaddressindex: MetricPattern31[LoadedAddressIndex] = MetricPattern31( - client, "loadedaddressindex" - ) - self.utxo_cohorts: MetricsTree_Distribution_UtxoCohorts = ( - MetricsTree_Distribution_UtxoCohorts(client) - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.addr_count: AddrCountPattern = AddrCountPattern(client, 'addr_count') + 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: AddrCountPattern = AddrCountPattern(client, 'empty_addr_count') + self.emptyaddressindex: MetricPattern32[EmptyAddressIndex] = MetricPattern32(client, 'emptyaddressindex') + self.loadedaddressindex: MetricPattern31[LoadedAddressIndex] = MetricPattern31(client, 'loadedaddressindex') + self.utxo_cohorts: MetricsTree_Distribution_UtxoCohorts = MetricsTree_Distribution_UtxoCohorts(client) class MetricsTree_Indexes_Address_Empty: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.identity: MetricPattern9[EmptyOutputIndex] = MetricPattern9( - client, "emptyoutputindex" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.identity: MetricPattern9[EmptyOutputIndex] = MetricPattern9(client, 'emptyoutputindex') class MetricsTree_Indexes_Address_Opreturn: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.identity: MetricPattern14[OpReturnIndex] = MetricPattern14( - client, "opreturnindex" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.identity: MetricPattern14[OpReturnIndex] = MetricPattern14(client, 'opreturnindex') class MetricsTree_Indexes_Address_P2a: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.identity: MetricPattern16[P2AAddressIndex] = MetricPattern16( - client, "p2aaddressindex" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.identity: MetricPattern16[P2AAddressIndex] = MetricPattern16(client, 'p2aaddressindex') class MetricsTree_Indexes_Address_P2ms: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.identity: MetricPattern17[P2MSOutputIndex] = MetricPattern17( - client, "p2msoutputindex" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.identity: MetricPattern17[P2MSOutputIndex] = MetricPattern17(client, 'p2msoutputindex') class MetricsTree_Indexes_Address_P2pk33: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.identity: MetricPattern18[P2PK33AddressIndex] = MetricPattern18( - client, "p2pk33addressindex" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.identity: MetricPattern18[P2PK33AddressIndex] = MetricPattern18(client, 'p2pk33addressindex') class MetricsTree_Indexes_Address_P2pk65: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.identity: MetricPattern19[P2PK65AddressIndex] = MetricPattern19( - client, "p2pk65addressindex" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.identity: MetricPattern19[P2PK65AddressIndex] = MetricPattern19(client, 'p2pk65addressindex') class MetricsTree_Indexes_Address_P2pkh: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.identity: MetricPattern20[P2PKHAddressIndex] = MetricPattern20( - client, "p2pkhaddressindex" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.identity: MetricPattern20[P2PKHAddressIndex] = MetricPattern20(client, 'p2pkhaddressindex') class MetricsTree_Indexes_Address_P2sh: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.identity: MetricPattern21[P2SHAddressIndex] = MetricPattern21( - client, "p2shaddressindex" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.identity: MetricPattern21[P2SHAddressIndex] = MetricPattern21(client, 'p2shaddressindex') class MetricsTree_Indexes_Address_P2tr: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.identity: MetricPattern22[P2TRAddressIndex] = MetricPattern22( - client, "p2traddressindex" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.identity: MetricPattern22[P2TRAddressIndex] = MetricPattern22(client, 'p2traddressindex') class MetricsTree_Indexes_Address_P2wpkh: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.identity: MetricPattern23[P2WPKHAddressIndex] = MetricPattern23( - client, "p2wpkhaddressindex" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.identity: MetricPattern23[P2WPKHAddressIndex] = MetricPattern23(client, 'p2wpkhaddressindex') class MetricsTree_Indexes_Address_P2wsh: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.identity: MetricPattern24[P2WSHAddressIndex] = MetricPattern24( - client, "p2wshaddressindex" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.identity: MetricPattern24[P2WSHAddressIndex] = MetricPattern24(client, 'p2wshaddressindex') class MetricsTree_Indexes_Address_Unknown: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.identity: MetricPattern28[UnknownOutputIndex] = MetricPattern28( - client, "unknownoutputindex" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.identity: MetricPattern28[UnknownOutputIndex] = MetricPattern28(client, 'unknownoutputindex') class MetricsTree_Indexes_Address: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.empty: MetricsTree_Indexes_Address_Empty = ( - MetricsTree_Indexes_Address_Empty(client) - ) - self.opreturn: MetricsTree_Indexes_Address_Opreturn = ( - MetricsTree_Indexes_Address_Opreturn(client) - ) - self.p2a: MetricsTree_Indexes_Address_P2a = MetricsTree_Indexes_Address_P2a( - client - ) - self.p2ms: MetricsTree_Indexes_Address_P2ms = MetricsTree_Indexes_Address_P2ms( - client - ) - self.p2pk33: MetricsTree_Indexes_Address_P2pk33 = ( - MetricsTree_Indexes_Address_P2pk33(client) - ) - self.p2pk65: MetricsTree_Indexes_Address_P2pk65 = ( - MetricsTree_Indexes_Address_P2pk65(client) - ) - self.p2pkh: MetricsTree_Indexes_Address_P2pkh = ( - MetricsTree_Indexes_Address_P2pkh(client) - ) - self.p2sh: MetricsTree_Indexes_Address_P2sh = MetricsTree_Indexes_Address_P2sh( - client - ) - self.p2tr: MetricsTree_Indexes_Address_P2tr = MetricsTree_Indexes_Address_P2tr( - client - ) - self.p2wpkh: MetricsTree_Indexes_Address_P2wpkh = ( - MetricsTree_Indexes_Address_P2wpkh(client) - ) - self.p2wsh: MetricsTree_Indexes_Address_P2wsh = ( - MetricsTree_Indexes_Address_P2wsh(client) - ) - self.unknown: MetricsTree_Indexes_Address_Unknown = ( - MetricsTree_Indexes_Address_Unknown(client) - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.empty: MetricsTree_Indexes_Address_Empty = MetricsTree_Indexes_Address_Empty(client) + self.opreturn: MetricsTree_Indexes_Address_Opreturn = MetricsTree_Indexes_Address_Opreturn(client) + self.p2a: MetricsTree_Indexes_Address_P2a = MetricsTree_Indexes_Address_P2a(client) + self.p2ms: MetricsTree_Indexes_Address_P2ms = MetricsTree_Indexes_Address_P2ms(client) + self.p2pk33: MetricsTree_Indexes_Address_P2pk33 = MetricsTree_Indexes_Address_P2pk33(client) + self.p2pk65: MetricsTree_Indexes_Address_P2pk65 = MetricsTree_Indexes_Address_P2pk65(client) + self.p2pkh: MetricsTree_Indexes_Address_P2pkh = MetricsTree_Indexes_Address_P2pkh(client) + self.p2sh: MetricsTree_Indexes_Address_P2sh = MetricsTree_Indexes_Address_P2sh(client) + self.p2tr: MetricsTree_Indexes_Address_P2tr = MetricsTree_Indexes_Address_P2tr(client) + self.p2wpkh: MetricsTree_Indexes_Address_P2wpkh = MetricsTree_Indexes_Address_P2wpkh(client) + self.p2wsh: MetricsTree_Indexes_Address_P2wsh = MetricsTree_Indexes_Address_P2wsh(client) + self.unknown: MetricsTree_Indexes_Address_Unknown = MetricsTree_Indexes_Address_Unknown(client) class MetricsTree_Indexes_Dateindex: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.date: MetricPattern6[Date] = MetricPattern6(client, "date") - self.first_height: MetricPattern6[Height] = MetricPattern6( - client, "first_height" - ) - self.height_count: MetricPattern6[StoredU64] = MetricPattern6( - client, "height_count" - ) - self.identity: MetricPattern6[DateIndex] = MetricPattern6(client, "dateindex") - self.monthindex: MetricPattern6[MonthIndex] = MetricPattern6( - client, "monthindex" - ) - self.weekindex: MetricPattern6[WeekIndex] = MetricPattern6(client, "weekindex") - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.date: MetricPattern6[Date] = MetricPattern6(client, 'date') + self.first_height: MetricPattern6[Height] = MetricPattern6(client, 'first_height') + self.height_count: MetricPattern6[StoredU64] = MetricPattern6(client, 'height_count') + self.identity: MetricPattern6[DateIndex] = MetricPattern6(client, 'dateindex') + self.monthindex: MetricPattern6[MonthIndex] = MetricPattern6(client, 'monthindex') + self.weekindex: MetricPattern6[WeekIndex] = MetricPattern6(client, 'weekindex') class MetricsTree_Indexes_Decadeindex: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.date: MetricPattern7[Date] = MetricPattern7(client, "date") - self.first_yearindex: MetricPattern7[YearIndex] = MetricPattern7( - client, "first_yearindex" - ) - self.identity: MetricPattern7[DecadeIndex] = MetricPattern7( - client, "decadeindex" - ) - self.yearindex_count: MetricPattern7[StoredU64] = MetricPattern7( - client, "yearindex_count" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.date: MetricPattern7[Date] = MetricPattern7(client, 'date') + self.first_yearindex: MetricPattern7[YearIndex] = MetricPattern7(client, 'first_yearindex') + self.identity: MetricPattern7[DecadeIndex] = MetricPattern7(client, 'decadeindex') + self.yearindex_count: MetricPattern7[StoredU64] = MetricPattern7(client, 'yearindex_count') class MetricsTree_Indexes_Difficultyepoch: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.first_height: MetricPattern8[Height] = MetricPattern8( - client, "first_height" - ) - self.height_count: MetricPattern8[StoredU64] = MetricPattern8( - client, "height_count" - ) - self.identity: MetricPattern8[DifficultyEpoch] = MetricPattern8( - client, "difficultyepoch" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.first_height: MetricPattern8[Height] = MetricPattern8(client, 'first_height') + self.height_count: MetricPattern8[StoredU64] = MetricPattern8(client, '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, "first_height" - ) - self.identity: MetricPattern10[HalvingEpoch] = MetricPattern10( - client, "halvingepoch" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.first_height: MetricPattern10[Height] = MetricPattern10(client, '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, "difficultyepoch" - ) - self.halvingepoch: MetricPattern11[HalvingEpoch] = MetricPattern11( - client, "halvingepoch" - ) - self.identity: MetricPattern11[Height] = MetricPattern11(client, "height") - self.txindex_count: MetricPattern11[StoredU64] = MetricPattern11( - client, "txindex_count" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.dateindex: MetricPattern11[DateIndex] = MetricPattern11(client, 'height_dateindex') + self.difficultyepoch: MetricPattern11[DifficultyEpoch] = MetricPattern11(client, 'difficultyepoch') + self.halvingepoch: MetricPattern11[HalvingEpoch] = MetricPattern11(client, 'halvingepoch') + self.identity: MetricPattern11[Height] = MetricPattern11(client, 'height') + self.txindex_count: MetricPattern11[StoredU64] = MetricPattern11(client, 'txindex_count') class MetricsTree_Indexes_Monthindex: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.date: MetricPattern13[Date] = MetricPattern13(client, "date") - self.dateindex_count: MetricPattern13[StoredU64] = MetricPattern13( - client, "dateindex_count" - ) - self.first_dateindex: MetricPattern13[DateIndex] = MetricPattern13( - client, "first_dateindex" - ) - self.identity: MetricPattern13[MonthIndex] = MetricPattern13( - client, "monthindex" - ) - self.quarterindex: MetricPattern13[QuarterIndex] = MetricPattern13( - client, "quarterindex" - ) - self.semesterindex: MetricPattern13[SemesterIndex] = MetricPattern13( - client, "semesterindex" - ) - self.yearindex: MetricPattern13[YearIndex] = MetricPattern13( - client, "yearindex" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.date: MetricPattern13[Date] = MetricPattern13(client, 'date') + self.dateindex_count: MetricPattern13[StoredU64] = MetricPattern13(client, 'dateindex_count') + self.first_dateindex: MetricPattern13[DateIndex] = MetricPattern13(client, 'first_dateindex') + self.identity: MetricPattern13[MonthIndex] = MetricPattern13(client, 'monthindex') + self.quarterindex: MetricPattern13[QuarterIndex] = MetricPattern13(client, 'quarterindex') + self.semesterindex: MetricPattern13[SemesterIndex] = MetricPattern13(client, 'semesterindex') + self.yearindex: MetricPattern13[YearIndex] = MetricPattern13(client, 'yearindex') class MetricsTree_Indexes_Quarterindex: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.date: MetricPattern25[Date] = MetricPattern25(client, "date") - self.first_monthindex: MetricPattern25[MonthIndex] = MetricPattern25( - client, "first_monthindex" - ) - self.identity: MetricPattern25[QuarterIndex] = MetricPattern25( - client, "quarterindex" - ) - self.monthindex_count: MetricPattern25[StoredU64] = MetricPattern25( - client, "monthindex_count" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.date: MetricPattern25[Date] = MetricPattern25(client, 'date') + self.first_monthindex: MetricPattern25[MonthIndex] = MetricPattern25(client, 'first_monthindex') + self.identity: MetricPattern25[QuarterIndex] = MetricPattern25(client, 'quarterindex') + self.monthindex_count: MetricPattern25[StoredU64] = MetricPattern25(client, 'monthindex_count') class MetricsTree_Indexes_Semesterindex: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.date: MetricPattern26[Date] = MetricPattern26(client, "date") - self.first_monthindex: MetricPattern26[MonthIndex] = MetricPattern26( - client, "first_monthindex" - ) - self.identity: MetricPattern26[SemesterIndex] = MetricPattern26( - client, "semesterindex" - ) - self.monthindex_count: MetricPattern26[StoredU64] = MetricPattern26( - client, "monthindex_count" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.date: MetricPattern26[Date] = MetricPattern26(client, 'date') + self.first_monthindex: MetricPattern26[MonthIndex] = MetricPattern26(client, 'first_monthindex') + self.identity: MetricPattern26[SemesterIndex] = MetricPattern26(client, 'semesterindex') + self.monthindex_count: MetricPattern26[StoredU64] = MetricPattern26(client, '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, "input_count" - ) - self.output_count: MetricPattern27[StoredU64] = MetricPattern27( - client, "output_count" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.identity: MetricPattern27[TxIndex] = MetricPattern27(client, 'txindex') + self.input_count: MetricPattern27[StoredU64] = MetricPattern27(client, 'input_count') + self.output_count: MetricPattern27[StoredU64] = MetricPattern27(client, 'output_count') class MetricsTree_Indexes_Txinindex: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.identity: MetricPattern12[TxInIndex] = MetricPattern12(client, "txinindex") - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.identity: MetricPattern12[TxInIndex] = MetricPattern12(client, 'txinindex') class MetricsTree_Indexes_Txoutindex: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.identity: MetricPattern15[TxOutIndex] = MetricPattern15( - client, "txoutindex" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.identity: MetricPattern15[TxOutIndex] = MetricPattern15(client, 'txoutindex') class MetricsTree_Indexes_Weekindex: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.date: MetricPattern29[Date] = MetricPattern29(client, "date") - self.dateindex_count: MetricPattern29[StoredU64] = MetricPattern29( - client, "dateindex_count" - ) - self.first_dateindex: MetricPattern29[DateIndex] = MetricPattern29( - client, "first_dateindex" - ) - self.identity: MetricPattern29[WeekIndex] = MetricPattern29(client, "weekindex") - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.date: MetricPattern29[Date] = MetricPattern29(client, 'date') + self.dateindex_count: MetricPattern29[StoredU64] = MetricPattern29(client, 'dateindex_count') + self.first_dateindex: MetricPattern29[DateIndex] = MetricPattern29(client, '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.date: MetricPattern30[Date] = MetricPattern30(client, "date") - self.decadeindex: MetricPattern30[DecadeIndex] = MetricPattern30( - client, "decadeindex" - ) - self.first_monthindex: MetricPattern30[MonthIndex] = MetricPattern30( - client, "first_monthindex" - ) - self.identity: MetricPattern30[YearIndex] = MetricPattern30(client, "yearindex") - self.monthindex_count: MetricPattern30[StoredU64] = MetricPattern30( - client, "monthindex_count" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.date: MetricPattern30[Date] = MetricPattern30(client, 'date') + self.decadeindex: MetricPattern30[DecadeIndex] = MetricPattern30(client, 'decadeindex') + self.first_monthindex: MetricPattern30[MonthIndex] = MetricPattern30(client, 'first_monthindex') + self.identity: MetricPattern30[YearIndex] = MetricPattern30(client, 'yearindex') + self.monthindex_count: MetricPattern30[StoredU64] = MetricPattern30(client, 'monthindex_count') class MetricsTree_Indexes: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): + + def __init__(self, client: BrkClientBase, base_path: str = ''): self.address: MetricsTree_Indexes_Address = MetricsTree_Indexes_Address(client) - self.dateindex: MetricsTree_Indexes_Dateindex = MetricsTree_Indexes_Dateindex( - client - ) - self.decadeindex: MetricsTree_Indexes_Decadeindex = ( - MetricsTree_Indexes_Decadeindex(client) - ) - self.difficultyepoch: MetricsTree_Indexes_Difficultyepoch = ( - MetricsTree_Indexes_Difficultyepoch(client) - ) - self.halvingepoch: MetricsTree_Indexes_Halvingepoch = ( - MetricsTree_Indexes_Halvingepoch(client) - ) + self.dateindex: MetricsTree_Indexes_Dateindex = MetricsTree_Indexes_Dateindex(client) + self.decadeindex: MetricsTree_Indexes_Decadeindex = MetricsTree_Indexes_Decadeindex(client) + self.difficultyepoch: MetricsTree_Indexes_Difficultyepoch = MetricsTree_Indexes_Difficultyepoch(client) + self.halvingepoch: MetricsTree_Indexes_Halvingepoch = MetricsTree_Indexes_Halvingepoch(client) self.height: MetricsTree_Indexes_Height = MetricsTree_Indexes_Height(client) - self.monthindex: MetricsTree_Indexes_Monthindex = ( - MetricsTree_Indexes_Monthindex(client) - ) - self.quarterindex: MetricsTree_Indexes_Quarterindex = ( - MetricsTree_Indexes_Quarterindex(client) - ) - self.semesterindex: MetricsTree_Indexes_Semesterindex = ( - MetricsTree_Indexes_Semesterindex(client) - ) + self.monthindex: MetricsTree_Indexes_Monthindex = MetricsTree_Indexes_Monthindex(client) + self.quarterindex: MetricsTree_Indexes_Quarterindex = MetricsTree_Indexes_Quarterindex(client) + self.semesterindex: MetricsTree_Indexes_Semesterindex = MetricsTree_Indexes_Semesterindex(client) self.txindex: MetricsTree_Indexes_Txindex = MetricsTree_Indexes_Txindex(client) - self.txinindex: MetricsTree_Indexes_Txinindex = MetricsTree_Indexes_Txinindex( - client - ) - self.txoutindex: MetricsTree_Indexes_Txoutindex = ( - MetricsTree_Indexes_Txoutindex(client) - ) - self.weekindex: MetricsTree_Indexes_Weekindex = MetricsTree_Indexes_Weekindex( - client - ) - self.yearindex: MetricsTree_Indexes_Yearindex = MetricsTree_Indexes_Yearindex( - client - ) - + self.txinindex: MetricsTree_Indexes_Txinindex = MetricsTree_Indexes_Txinindex(client) + self.txoutindex: MetricsTree_Indexes_Txoutindex = MetricsTree_Indexes_Txoutindex(client) + self.weekindex: MetricsTree_Indexes_Weekindex = MetricsTree_Indexes_Weekindex(client) + self.yearindex: MetricsTree_Indexes_Yearindex = MetricsTree_Indexes_Yearindex(client) class MetricsTree_Inputs_Spent: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.txoutindex: MetricPattern12[TxOutIndex] = MetricPattern12( - client, "txoutindex" - ) - self.value: MetricPattern12[Sats] = MetricPattern12(client, "value") - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.txoutindex: MetricPattern12[TxOutIndex] = MetricPattern12(client, 'txoutindex') + self.value: MetricPattern12[Sats] = MetricPattern12(client, 'value') class MetricsTree_Inputs: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.count: CountPattern2[StoredU64] = CountPattern2(client, "input_count") - self.first_txinindex: MetricPattern11[TxInIndex] = MetricPattern11( - client, "first_txinindex" - ) - self.outpoint: MetricPattern12[OutPoint] = MetricPattern12(client, "outpoint") - self.outputtype: MetricPattern12[OutputType] = MetricPattern12( - client, "outputtype" - ) + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.count: CountPattern2[StoredU64] = CountPattern2(client, 'input_count') + self.first_txinindex: MetricPattern11[TxInIndex] = MetricPattern11(client, 'first_txinindex') + self.outpoint: MetricPattern12[OutPoint] = MetricPattern12(client, 'outpoint') + self.outputtype: MetricPattern12[OutputType] = MetricPattern12(client, 'outputtype') self.spent: MetricsTree_Inputs_Spent = MetricsTree_Inputs_Spent(client) - self.txindex: MetricPattern12[TxIndex] = MetricPattern12(client, "txindex") - self.typeindex: MetricPattern12[TypeIndex] = MetricPattern12( - client, "typeindex" - ) - + self.txindex: MetricPattern12[TxIndex] = MetricPattern12(client, 'txindex') + self.typeindex: MetricPattern12[TypeIndex] = MetricPattern12(client, 'typeindex') class MetricsTree_Market_Ath: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.days_since_price_ath: MetricPattern4[StoredU16] = MetricPattern4( - client, "days_since_price_ath" - ) - self.max_days_between_price_aths: MetricPattern4[StoredU16] = MetricPattern4( - client, "max_days_between_price_aths" - ) - self.max_years_between_price_aths: MetricPattern4[StoredF32] = MetricPattern4( - client, "max_years_between_price_aths" - ) - self.price_ath: MetricPattern1[Dollars] = MetricPattern1(client, "price_ath") - self.price_drawdown: MetricPattern3[StoredF32] = MetricPattern3( - client, "price_drawdown" - ) - self.years_since_price_ath: MetricPattern4[StoredF32] = MetricPattern4( - client, "years_since_price_ath" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.days_since_price_ath: MetricPattern4[StoredU16] = MetricPattern4(client, 'days_since_price_ath') + self.max_days_between_price_aths: MetricPattern4[StoredU16] = MetricPattern4(client, 'max_days_between_price_aths') + self.max_years_between_price_aths: MetricPattern4[StoredF32] = MetricPattern4(client, 'max_years_between_price_aths') + self.price_ath: MetricPattern1[Dollars] = MetricPattern1(client, 'price_ath') + self.price_drawdown: MetricPattern3[StoredF32] = MetricPattern3(client, 'price_drawdown') + self.years_since_price_ath: MetricPattern4[StoredF32] = MetricPattern4(client, 'years_since_price_ath') class MetricsTree_Market_Dca_ClassStack: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self._2015: _2015Pattern = _2015Pattern(client, "dca_class_2015_stack") - self._2016: _2015Pattern = _2015Pattern(client, "dca_class_2016_stack") - self._2017: _2015Pattern = _2015Pattern(client, "dca_class_2017_stack") - self._2018: _2015Pattern = _2015Pattern(client, "dca_class_2018_stack") - self._2019: _2015Pattern = _2015Pattern(client, "dca_class_2019_stack") - self._2020: _2015Pattern = _2015Pattern(client, "dca_class_2020_stack") - self._2021: _2015Pattern = _2015Pattern(client, "dca_class_2021_stack") - self._2022: _2015Pattern = _2015Pattern(client, "dca_class_2022_stack") - self._2023: _2015Pattern = _2015Pattern(client, "dca_class_2023_stack") - self._2024: _2015Pattern = _2015Pattern(client, "dca_class_2024_stack") - self._2025: _2015Pattern = _2015Pattern(client, "dca_class_2025_stack") - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self._2015: _2015Pattern = _2015Pattern(client, 'dca_class_2015_stack') + self._2016: _2015Pattern = _2015Pattern(client, 'dca_class_2016_stack') + self._2017: _2015Pattern = _2015Pattern(client, 'dca_class_2017_stack') + self._2018: _2015Pattern = _2015Pattern(client, 'dca_class_2018_stack') + self._2019: _2015Pattern = _2015Pattern(client, 'dca_class_2019_stack') + self._2020: _2015Pattern = _2015Pattern(client, 'dca_class_2020_stack') + self._2021: _2015Pattern = _2015Pattern(client, 'dca_class_2021_stack') + self._2022: _2015Pattern = _2015Pattern(client, 'dca_class_2022_stack') + self._2023: _2015Pattern = _2015Pattern(client, 'dca_class_2023_stack') + self._2024: _2015Pattern = _2015Pattern(client, 'dca_class_2024_stack') + self._2025: _2015Pattern = _2015Pattern(client, 'dca_class_2025_stack') class MetricsTree_Market_Dca: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.class_average_price: ClassAveragePricePattern[Dollars] = ( - ClassAveragePricePattern(client, "dca_class") - ) - self.class_returns: ClassAveragePricePattern[StoredF32] = ( - ClassAveragePricePattern(client, "dca_class") - ) - self.class_stack: MetricsTree_Market_Dca_ClassStack = ( - MetricsTree_Market_Dca_ClassStack(client) - ) - self.period_average_price: PeriodAveragePricePattern[Dollars] = ( - PeriodAveragePricePattern(client, "dca_average_price") - ) - self.period_cagr: PeriodCagrPattern = PeriodCagrPattern(client, "dca_cagr") - self.period_lump_sum_stack: PeriodLumpSumStackPattern = ( - PeriodLumpSumStackPattern(client, "lump_sum_stack") - ) - self.period_returns: PeriodAveragePricePattern[StoredF32] = ( - PeriodAveragePricePattern(client, "dca_returns") - ) - self.period_stack: PeriodLumpSumStackPattern = PeriodLumpSumStackPattern( - client, "dca_stack" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.class_average_price: ClassAveragePricePattern[Dollars] = ClassAveragePricePattern(client, 'dca_class') + self.class_returns: ClassAveragePricePattern[StoredF32] = ClassAveragePricePattern(client, 'dca_class') + self.class_stack: MetricsTree_Market_Dca_ClassStack = MetricsTree_Market_Dca_ClassStack(client) + self.period_average_price: PeriodAveragePricePattern[Dollars] = PeriodAveragePricePattern(client, 'dca_average_price') + self.period_cagr: PeriodCagrPattern = PeriodCagrPattern(client, 'dca_cagr') + self.period_lump_sum_stack: PeriodLumpSumStackPattern = PeriodLumpSumStackPattern(client, 'lump_sum_stack') + self.period_returns: PeriodAveragePricePattern[StoredF32] = PeriodAveragePricePattern(client, 'dca_returns') + self.period_stack: PeriodLumpSumStackPattern = PeriodLumpSumStackPattern(client, 'dca_stack') class MetricsTree_Market_Indicators: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.gini: MetricPattern6[StoredF32] = MetricPattern6(client, "gini") - self.macd_histogram: MetricPattern6[StoredF32] = MetricPattern6( - client, "macd_histogram" - ) - self.macd_line: MetricPattern6[StoredF32] = MetricPattern6(client, "macd_line") - self.macd_signal: MetricPattern6[StoredF32] = MetricPattern6( - client, "macd_signal" - ) - self.nvt: MetricPattern4[StoredF32] = MetricPattern4(client, "nvt") - self.pi_cycle: MetricPattern6[StoredF32] = MetricPattern6(client, "pi_cycle") - self.puell_multiple: MetricPattern4[StoredF32] = MetricPattern4( - client, "puell_multiple" - ) - self.rsi_14d: MetricPattern6[StoredF32] = MetricPattern6(client, "rsi_14d") - self.rsi_14d_max: MetricPattern6[StoredF32] = MetricPattern6( - client, "rsi_14d_max" - ) - self.rsi_14d_min: MetricPattern6[StoredF32] = MetricPattern6( - client, "rsi_14d_min" - ) - self.rsi_average_gain_14d: MetricPattern6[StoredF32] = MetricPattern6( - client, "rsi_average_gain_14d" - ) - self.rsi_average_loss_14d: MetricPattern6[StoredF32] = MetricPattern6( - client, "rsi_average_loss_14d" - ) - self.rsi_gains: MetricPattern6[StoredF32] = MetricPattern6(client, "rsi_gains") - self.rsi_losses: MetricPattern6[StoredF32] = MetricPattern6( - client, "rsi_losses" - ) - self.stoch_d: MetricPattern6[StoredF32] = MetricPattern6(client, "stoch_d") - self.stoch_k: MetricPattern6[StoredF32] = MetricPattern6(client, "stoch_k") - self.stoch_rsi: MetricPattern6[StoredF32] = MetricPattern6(client, "stoch_rsi") - self.stoch_rsi_d: MetricPattern6[StoredF32] = MetricPattern6( - client, "stoch_rsi_d" - ) - self.stoch_rsi_k: MetricPattern6[StoredF32] = MetricPattern6( - client, "stoch_rsi_k" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.gini: MetricPattern6[StoredF32] = MetricPattern6(client, 'gini') + self.macd_histogram: MetricPattern6[StoredF32] = MetricPattern6(client, 'macd_histogram') + self.macd_line: MetricPattern6[StoredF32] = MetricPattern6(client, 'macd_line') + self.macd_signal: MetricPattern6[StoredF32] = MetricPattern6(client, 'macd_signal') + self.nvt: MetricPattern4[StoredF32] = MetricPattern4(client, 'nvt') + self.pi_cycle: MetricPattern6[StoredF32] = MetricPattern6(client, 'pi_cycle') + self.puell_multiple: MetricPattern4[StoredF32] = MetricPattern4(client, 'puell_multiple') + self.rsi_14d: MetricPattern6[StoredF32] = MetricPattern6(client, 'rsi_14d') + self.rsi_14d_max: MetricPattern6[StoredF32] = MetricPattern6(client, 'rsi_14d_max') + self.rsi_14d_min: MetricPattern6[StoredF32] = MetricPattern6(client, 'rsi_14d_min') + self.rsi_average_gain_14d: MetricPattern6[StoredF32] = MetricPattern6(client, 'rsi_average_gain_14d') + self.rsi_average_loss_14d: MetricPattern6[StoredF32] = MetricPattern6(client, 'rsi_average_loss_14d') + self.rsi_gains: MetricPattern6[StoredF32] = MetricPattern6(client, 'rsi_gains') + self.rsi_losses: MetricPattern6[StoredF32] = MetricPattern6(client, 'rsi_losses') + self.stoch_d: MetricPattern6[StoredF32] = MetricPattern6(client, 'stoch_d') + self.stoch_k: MetricPattern6[StoredF32] = MetricPattern6(client, 'stoch_k') + self.stoch_rsi: MetricPattern6[StoredF32] = MetricPattern6(client, 'stoch_rsi') + self.stoch_rsi_d: MetricPattern6[StoredF32] = MetricPattern6(client, 'stoch_rsi_d') + self.stoch_rsi_k: MetricPattern6[StoredF32] = MetricPattern6(client, 'stoch_rsi_k') class MetricsTree_Market_Lookback: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.price_ago: PriceAgoPattern[Dollars] = PriceAgoPattern(client, "price") - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.price_ago: PriceAgoPattern[Dollars] = PriceAgoPattern(client, 'price') class MetricsTree_Market_MovingAverage: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.price_111d_sma: Price111dSmaPattern = Price111dSmaPattern( - client, "price_111d_sma" - ) - self.price_12d_ema: Price111dSmaPattern = Price111dSmaPattern( - client, "price_12d_ema" - ) - self.price_13d_ema: Price111dSmaPattern = Price111dSmaPattern( - client, "price_13d_ema" - ) - self.price_13d_sma: Price111dSmaPattern = Price111dSmaPattern( - client, "price_13d_sma" - ) - self.price_144d_ema: Price111dSmaPattern = Price111dSmaPattern( - client, "price_144d_ema" - ) - self.price_144d_sma: Price111dSmaPattern = Price111dSmaPattern( - client, "price_144d_sma" - ) - self.price_1m_ema: Price111dSmaPattern = Price111dSmaPattern( - client, "price_1m_ema" - ) - self.price_1m_sma: Price111dSmaPattern = Price111dSmaPattern( - client, "price_1m_sma" - ) - self.price_1w_ema: Price111dSmaPattern = Price111dSmaPattern( - client, "price_1w_ema" - ) - self.price_1w_sma: Price111dSmaPattern = Price111dSmaPattern( - client, "price_1w_sma" - ) - self.price_1y_ema: Price111dSmaPattern = Price111dSmaPattern( - client, "price_1y_ema" - ) - self.price_1y_sma: Price111dSmaPattern = Price111dSmaPattern( - client, "price_1y_sma" - ) - self.price_200d_ema: Price111dSmaPattern = Price111dSmaPattern( - client, "price_200d_ema" - ) - self.price_200d_sma: Price111dSmaPattern = Price111dSmaPattern( - client, "price_200d_sma" - ) - self.price_200d_sma_x0_8: MetricPattern4[Dollars] = MetricPattern4( - client, "price_200d_sma_x0_8" - ) - self.price_200d_sma_x2_4: MetricPattern4[Dollars] = MetricPattern4( - client, "price_200d_sma_x2_4" - ) - self.price_200w_ema: Price111dSmaPattern = Price111dSmaPattern( - client, "price_200w_ema" - ) - self.price_200w_sma: Price111dSmaPattern = Price111dSmaPattern( - client, "price_200w_sma" - ) - self.price_21d_ema: Price111dSmaPattern = Price111dSmaPattern( - client, "price_21d_ema" - ) - self.price_21d_sma: Price111dSmaPattern = Price111dSmaPattern( - client, "price_21d_sma" - ) - self.price_26d_ema: Price111dSmaPattern = Price111dSmaPattern( - client, "price_26d_ema" - ) - self.price_2y_ema: Price111dSmaPattern = Price111dSmaPattern( - client, "price_2y_ema" - ) - self.price_2y_sma: Price111dSmaPattern = Price111dSmaPattern( - client, "price_2y_sma" - ) - self.price_34d_ema: Price111dSmaPattern = Price111dSmaPattern( - client, "price_34d_ema" - ) - self.price_34d_sma: Price111dSmaPattern = Price111dSmaPattern( - client, "price_34d_sma" - ) - self.price_350d_sma: Price111dSmaPattern = Price111dSmaPattern( - client, "price_350d_sma" - ) - self.price_350d_sma_x2: MetricPattern4[Dollars] = MetricPattern4( - client, "price_350d_sma_x2" - ) - self.price_4y_ema: Price111dSmaPattern = Price111dSmaPattern( - client, "price_4y_ema" - ) - self.price_4y_sma: Price111dSmaPattern = Price111dSmaPattern( - client, "price_4y_sma" - ) - self.price_55d_ema: Price111dSmaPattern = Price111dSmaPattern( - client, "price_55d_ema" - ) - self.price_55d_sma: Price111dSmaPattern = Price111dSmaPattern( - client, "price_55d_sma" - ) - self.price_89d_ema: Price111dSmaPattern = Price111dSmaPattern( - client, "price_89d_ema" - ) - self.price_89d_sma: Price111dSmaPattern = Price111dSmaPattern( - client, "price_89d_sma" - ) - self.price_8d_ema: Price111dSmaPattern = Price111dSmaPattern( - client, "price_8d_ema" - ) - self.price_8d_sma: Price111dSmaPattern = Price111dSmaPattern( - client, "price_8d_sma" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.price_111d_sma: Price111dSmaPattern = Price111dSmaPattern(client, 'price_111d_sma') + self.price_12d_ema: Price111dSmaPattern = Price111dSmaPattern(client, 'price_12d_ema') + self.price_13d_ema: Price111dSmaPattern = Price111dSmaPattern(client, 'price_13d_ema') + self.price_13d_sma: Price111dSmaPattern = Price111dSmaPattern(client, 'price_13d_sma') + self.price_144d_ema: Price111dSmaPattern = Price111dSmaPattern(client, 'price_144d_ema') + self.price_144d_sma: Price111dSmaPattern = Price111dSmaPattern(client, 'price_144d_sma') + self.price_1m_ema: Price111dSmaPattern = Price111dSmaPattern(client, 'price_1m_ema') + self.price_1m_sma: Price111dSmaPattern = Price111dSmaPattern(client, 'price_1m_sma') + self.price_1w_ema: Price111dSmaPattern = Price111dSmaPattern(client, 'price_1w_ema') + self.price_1w_sma: Price111dSmaPattern = Price111dSmaPattern(client, 'price_1w_sma') + self.price_1y_ema: Price111dSmaPattern = Price111dSmaPattern(client, 'price_1y_ema') + self.price_1y_sma: Price111dSmaPattern = Price111dSmaPattern(client, 'price_1y_sma') + self.price_200d_ema: Price111dSmaPattern = Price111dSmaPattern(client, 'price_200d_ema') + self.price_200d_sma: Price111dSmaPattern = Price111dSmaPattern(client, 'price_200d_sma') + self.price_200d_sma_x0_8: MetricPattern4[Dollars] = MetricPattern4(client, 'price_200d_sma_x0_8') + self.price_200d_sma_x2_4: MetricPattern4[Dollars] = MetricPattern4(client, 'price_200d_sma_x2_4') + self.price_200w_ema: Price111dSmaPattern = Price111dSmaPattern(client, 'price_200w_ema') + self.price_200w_sma: Price111dSmaPattern = Price111dSmaPattern(client, 'price_200w_sma') + self.price_21d_ema: Price111dSmaPattern = Price111dSmaPattern(client, 'price_21d_ema') + self.price_21d_sma: Price111dSmaPattern = Price111dSmaPattern(client, 'price_21d_sma') + self.price_26d_ema: Price111dSmaPattern = Price111dSmaPattern(client, 'price_26d_ema') + self.price_2y_ema: Price111dSmaPattern = Price111dSmaPattern(client, 'price_2y_ema') + self.price_2y_sma: Price111dSmaPattern = Price111dSmaPattern(client, 'price_2y_sma') + self.price_34d_ema: Price111dSmaPattern = Price111dSmaPattern(client, 'price_34d_ema') + self.price_34d_sma: Price111dSmaPattern = Price111dSmaPattern(client, 'price_34d_sma') + self.price_350d_sma: Price111dSmaPattern = Price111dSmaPattern(client, 'price_350d_sma') + self.price_350d_sma_x2: MetricPattern4[Dollars] = MetricPattern4(client, 'price_350d_sma_x2') + self.price_4y_ema: Price111dSmaPattern = Price111dSmaPattern(client, 'price_4y_ema') + self.price_4y_sma: Price111dSmaPattern = Price111dSmaPattern(client, 'price_4y_sma') + self.price_55d_ema: Price111dSmaPattern = Price111dSmaPattern(client, 'price_55d_ema') + self.price_55d_sma: Price111dSmaPattern = Price111dSmaPattern(client, 'price_55d_sma') + self.price_89d_ema: Price111dSmaPattern = Price111dSmaPattern(client, 'price_89d_ema') + self.price_89d_sma: Price111dSmaPattern = Price111dSmaPattern(client, 'price_89d_sma') + self.price_8d_ema: Price111dSmaPattern = Price111dSmaPattern(client, 'price_8d_ema') + self.price_8d_sma: Price111dSmaPattern = Price111dSmaPattern(client, 'price_8d_sma') class MetricsTree_Market_Range: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.price_1m_max: MetricPattern4[Dollars] = MetricPattern4( - client, "price_1m_max" - ) - self.price_1m_min: MetricPattern4[Dollars] = MetricPattern4( - client, "price_1m_min" - ) - self.price_1w_max: MetricPattern4[Dollars] = MetricPattern4( - client, "price_1w_max" - ) - self.price_1w_min: MetricPattern4[Dollars] = MetricPattern4( - client, "price_1w_min" - ) - self.price_1y_max: MetricPattern4[Dollars] = MetricPattern4( - client, "price_1y_max" - ) - self.price_1y_min: MetricPattern4[Dollars] = MetricPattern4( - client, "price_1y_min" - ) - self.price_2w_choppiness_index: MetricPattern4[StoredF32] = MetricPattern4( - client, "price_2w_choppiness_index" - ) - self.price_2w_max: MetricPattern4[Dollars] = MetricPattern4( - client, "price_2w_max" - ) - self.price_2w_min: MetricPattern4[Dollars] = MetricPattern4( - client, "price_2w_min" - ) - self.price_true_range: MetricPattern6[StoredF32] = MetricPattern6( - client, "price_true_range" - ) - self.price_true_range_2w_sum: MetricPattern6[StoredF32] = MetricPattern6( - client, "price_true_range_2w_sum" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.price_1m_max: MetricPattern4[Dollars] = MetricPattern4(client, 'price_1m_max') + self.price_1m_min: MetricPattern4[Dollars] = MetricPattern4(client, 'price_1m_min') + self.price_1w_max: MetricPattern4[Dollars] = MetricPattern4(client, 'price_1w_max') + self.price_1w_min: MetricPattern4[Dollars] = MetricPattern4(client, 'price_1w_min') + self.price_1y_max: MetricPattern4[Dollars] = MetricPattern4(client, 'price_1y_max') + self.price_1y_min: MetricPattern4[Dollars] = MetricPattern4(client, 'price_1y_min') + self.price_2w_choppiness_index: MetricPattern4[StoredF32] = MetricPattern4(client, 'price_2w_choppiness_index') + self.price_2w_max: MetricPattern4[Dollars] = MetricPattern4(client, 'price_2w_max') + self.price_2w_min: MetricPattern4[Dollars] = MetricPattern4(client, 'price_2w_min') + self.price_true_range: MetricPattern6[StoredF32] = MetricPattern6(client, 'price_true_range') + self.price_true_range_2w_sum: MetricPattern6[StoredF32] = MetricPattern6(client, 'price_true_range_2w_sum') class MetricsTree_Market_Returns: """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: PriceAgoPattern[StoredF32] = PriceAgoPattern( - client, "price_returns" - ) - + + 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: PriceAgoPattern[StoredF32] = PriceAgoPattern(client, 'price_returns') class MetricsTree_Market_Volatility: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.price_1m_volatility: MetricPattern4[StoredF32] = MetricPattern4( - client, "price_1m_volatility" - ) - self.price_1w_volatility: MetricPattern4[StoredF32] = MetricPattern4( - client, "price_1w_volatility" - ) - self.price_1y_volatility: MetricPattern4[StoredF32] = MetricPattern4( - client, "price_1y_volatility" - ) - self.sharpe_1m: MetricPattern6[StoredF32] = MetricPattern6(client, "sharpe_1m") - self.sharpe_1w: MetricPattern6[StoredF32] = MetricPattern6(client, "sharpe_1w") - self.sharpe_1y: MetricPattern6[StoredF32] = MetricPattern6(client, "sharpe_1y") - self.sortino_1m: MetricPattern6[StoredF32] = MetricPattern6( - client, "sortino_1m" - ) - self.sortino_1w: MetricPattern6[StoredF32] = MetricPattern6( - client, "sortino_1w" - ) - self.sortino_1y: MetricPattern6[StoredF32] = MetricPattern6( - client, "sortino_1y" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.price_1m_volatility: MetricPattern4[StoredF32] = MetricPattern4(client, 'price_1m_volatility') + self.price_1w_volatility: MetricPattern4[StoredF32] = MetricPattern4(client, 'price_1w_volatility') + self.price_1y_volatility: MetricPattern4[StoredF32] = MetricPattern4(client, 'price_1y_volatility') + self.sharpe_1m: MetricPattern6[StoredF32] = MetricPattern6(client, 'sharpe_1m') + self.sharpe_1w: MetricPattern6[StoredF32] = MetricPattern6(client, 'sharpe_1w') + self.sharpe_1y: MetricPattern6[StoredF32] = MetricPattern6(client, 'sharpe_1y') + self.sortino_1m: MetricPattern6[StoredF32] = MetricPattern6(client, 'sortino_1m') + self.sortino_1w: MetricPattern6[StoredF32] = MetricPattern6(client, 'sortino_1w') + self.sortino_1y: MetricPattern6[StoredF32] = MetricPattern6(client, 'sortino_1y') class MetricsTree_Market: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): + + def __init__(self, client: BrkClientBase, base_path: str = ''): self.ath: MetricsTree_Market_Ath = MetricsTree_Market_Ath(client) self.dca: MetricsTree_Market_Dca = MetricsTree_Market_Dca(client) - self.indicators: MetricsTree_Market_Indicators = MetricsTree_Market_Indicators( - client - ) + self.indicators: MetricsTree_Market_Indicators = MetricsTree_Market_Indicators(client) self.lookback: MetricsTree_Market_Lookback = MetricsTree_Market_Lookback(client) - self.moving_average: MetricsTree_Market_MovingAverage = ( - MetricsTree_Market_MovingAverage(client) - ) + self.moving_average: MetricsTree_Market_MovingAverage = MetricsTree_Market_MovingAverage(client) self.range: MetricsTree_Market_Range = MetricsTree_Market_Range(client) self.returns: MetricsTree_Market_Returns = MetricsTree_Market_Returns(client) - self.volatility: MetricsTree_Market_Volatility = MetricsTree_Market_Volatility( - client - ) - + self.volatility: MetricsTree_Market_Volatility = MetricsTree_Market_Volatility(client) class MetricsTree_Outputs_Count: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.total_count: CountPattern2[StoredU64] = CountPattern2( - client, "output_count" - ) - self.utxo_count: MetricPattern1[StoredU64] = MetricPattern1( - client, "exact_utxo_count" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.total_count: CountPattern2[StoredU64] = CountPattern2(client, 'output_count') + self.utxo_count: MetricPattern1[StoredU64] = MetricPattern1(client, 'exact_utxo_count') class MetricsTree_Outputs_Spent: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.txinindex: MetricPattern15[TxInIndex] = MetricPattern15( - client, "txinindex" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.txinindex: MetricPattern15[TxInIndex] = MetricPattern15(client, 'txinindex') class MetricsTree_Outputs: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): + + def __init__(self, client: BrkClientBase, base_path: str = ''): self.count: MetricsTree_Outputs_Count = MetricsTree_Outputs_Count(client) - self.first_txoutindex: MetricPattern11[TxOutIndex] = MetricPattern11( - client, "first_txoutindex" - ) - self.outputtype: MetricPattern15[OutputType] = MetricPattern15( - client, "outputtype" - ) + self.first_txoutindex: MetricPattern11[TxOutIndex] = MetricPattern11(client, 'first_txoutindex') + self.outputtype: MetricPattern15[OutputType] = MetricPattern15(client, 'outputtype') self.spent: MetricsTree_Outputs_Spent = MetricsTree_Outputs_Spent(client) - self.txindex: MetricPattern15[TxIndex] = MetricPattern15(client, "txindex") - self.typeindex: MetricPattern15[TypeIndex] = MetricPattern15( - client, "typeindex" - ) - self.value: MetricPattern15[Sats] = MetricPattern15(client, "value") - + self.txindex: MetricPattern15[TxIndex] = MetricPattern15(client, 'txindex') + self.typeindex: MetricPattern15[TypeIndex] = MetricPattern15(client, 'typeindex') + self.value: MetricPattern15[Sats] = MetricPattern15(client, 'value') class MetricsTree_Pools_Vecs: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.aaopool: AaopoolPattern = AaopoolPattern(client, "aaopool") - self.antpool: AaopoolPattern = AaopoolPattern(client, "antpool") - self.arkpool: AaopoolPattern = AaopoolPattern(client, "arkpool") - self.asicminer: AaopoolPattern = AaopoolPattern(client, "asicminer") - self.axbt: AaopoolPattern = AaopoolPattern(client, "axbt") - self.batpool: AaopoolPattern = AaopoolPattern(client, "batpool") - self.bcmonster: AaopoolPattern = AaopoolPattern(client, "bcmonster") - self.bcpoolio: AaopoolPattern = AaopoolPattern(client, "bcpoolio") - self.binancepool: AaopoolPattern = AaopoolPattern(client, "binancepool") - self.bitalo: AaopoolPattern = AaopoolPattern(client, "bitalo") - self.bitclub: AaopoolPattern = AaopoolPattern(client, "bitclub") - self.bitcoinaffiliatenetwork: AaopoolPattern = AaopoolPattern( - client, "bitcoinaffiliatenetwork" - ) - self.bitcoincom: AaopoolPattern = AaopoolPattern(client, "bitcoincom") - self.bitcoinindia: AaopoolPattern = AaopoolPattern(client, "bitcoinindia") - self.bitcoinrussia: AaopoolPattern = AaopoolPattern(client, "bitcoinrussia") - self.bitcoinukraine: AaopoolPattern = AaopoolPattern(client, "bitcoinukraine") - self.bitfarms: AaopoolPattern = AaopoolPattern(client, "bitfarms") - self.bitfufupool: AaopoolPattern = AaopoolPattern(client, "bitfufupool") - self.bitfury: AaopoolPattern = AaopoolPattern(client, "bitfury") - self.bitminter: AaopoolPattern = AaopoolPattern(client, "bitminter") - self.bitparking: AaopoolPattern = AaopoolPattern(client, "bitparking") - self.bitsolo: AaopoolPattern = AaopoolPattern(client, "bitsolo") - self.bixin: AaopoolPattern = AaopoolPattern(client, "bixin") - self.blockfills: AaopoolPattern = AaopoolPattern(client, "blockfills") - self.braiinspool: AaopoolPattern = AaopoolPattern(client, "braiinspool") - self.bravomining: AaopoolPattern = AaopoolPattern(client, "bravomining") - self.btcc: AaopoolPattern = AaopoolPattern(client, "btcc") - self.btccom: AaopoolPattern = AaopoolPattern(client, "btccom") - self.btcdig: AaopoolPattern = AaopoolPattern(client, "btcdig") - self.btcguild: AaopoolPattern = AaopoolPattern(client, "btcguild") - self.btclab: AaopoolPattern = AaopoolPattern(client, "btclab") - self.btcmp: AaopoolPattern = AaopoolPattern(client, "btcmp") - self.btcnuggets: AaopoolPattern = AaopoolPattern(client, "btcnuggets") - self.btcpoolparty: AaopoolPattern = AaopoolPattern(client, "btcpoolparty") - self.btcserv: AaopoolPattern = AaopoolPattern(client, "btcserv") - self.btctop: AaopoolPattern = AaopoolPattern(client, "btctop") - self.btpool: AaopoolPattern = AaopoolPattern(client, "btpool") - self.bwpool: AaopoolPattern = AaopoolPattern(client, "bwpool") - self.bytepool: AaopoolPattern = AaopoolPattern(client, "bytepool") - self.canoe: AaopoolPattern = AaopoolPattern(client, "canoe") - self.canoepool: AaopoolPattern = AaopoolPattern(client, "canoepool") - self.carbonnegative: AaopoolPattern = AaopoolPattern(client, "carbonnegative") - self.ckpool: AaopoolPattern = AaopoolPattern(client, "ckpool") - self.cloudhashing: AaopoolPattern = AaopoolPattern(client, "cloudhashing") - self.coinlab: AaopoolPattern = AaopoolPattern(client, "coinlab") - self.cointerra: AaopoolPattern = AaopoolPattern(client, "cointerra") - self.connectbtc: AaopoolPattern = AaopoolPattern(client, "connectbtc") - self.dcex: AaopoolPattern = AaopoolPattern(client, "dcex") - self.dcexploration: AaopoolPattern = AaopoolPattern(client, "dcexploration") - self.digitalbtc: AaopoolPattern = AaopoolPattern(client, "digitalbtc") - self.digitalxmintsy: AaopoolPattern = AaopoolPattern(client, "digitalxmintsy") - self.dpool: AaopoolPattern = AaopoolPattern(client, "dpool") - self.eclipsemc: AaopoolPattern = AaopoolPattern(client, "eclipsemc") - self.eightbaochi: AaopoolPattern = AaopoolPattern(client, "eightbaochi") - self.ekanembtc: AaopoolPattern = AaopoolPattern(client, "ekanembtc") - self.eligius: AaopoolPattern = AaopoolPattern(client, "eligius") - self.emcdpool: AaopoolPattern = AaopoolPattern(client, "emcdpool") - self.entrustcharitypool: AaopoolPattern = AaopoolPattern( - client, "entrustcharitypool" - ) - self.eobot: AaopoolPattern = AaopoolPattern(client, "eobot") - self.exxbw: AaopoolPattern = AaopoolPattern(client, "exxbw") - self.f2pool: AaopoolPattern = AaopoolPattern(client, "f2pool") - self.fiftyeightcoin: AaopoolPattern = AaopoolPattern(client, "fiftyeightcoin") - self.foundryusa: AaopoolPattern = AaopoolPattern(client, "foundryusa") - self.futurebitapollosolo: AaopoolPattern = AaopoolPattern( - client, "futurebitapollosolo" - ) - self.gbminers: AaopoolPattern = AaopoolPattern(client, "gbminers") - self.ghashio: AaopoolPattern = AaopoolPattern(client, "ghashio") - self.givemecoins: AaopoolPattern = AaopoolPattern(client, "givemecoins") - self.gogreenlight: AaopoolPattern = AaopoolPattern(client, "gogreenlight") - self.haominer: AaopoolPattern = AaopoolPattern(client, "haominer") - self.haozhuzhu: AaopoolPattern = AaopoolPattern(client, "haozhuzhu") - self.hashbx: AaopoolPattern = AaopoolPattern(client, "hashbx") - self.hashpool: AaopoolPattern = AaopoolPattern(client, "hashpool") - self.helix: AaopoolPattern = AaopoolPattern(client, "helix") - self.hhtt: AaopoolPattern = AaopoolPattern(client, "hhtt") - self.hotpool: AaopoolPattern = AaopoolPattern(client, "hotpool") - self.hummerpool: AaopoolPattern = AaopoolPattern(client, "hummerpool") - self.huobipool: AaopoolPattern = AaopoolPattern(client, "huobipool") - self.innopolistech: AaopoolPattern = AaopoolPattern(client, "innopolistech") - self.kanopool: AaopoolPattern = AaopoolPattern(client, "kanopool") - self.kncminer: AaopoolPattern = AaopoolPattern(client, "kncminer") - self.kucoinpool: AaopoolPattern = AaopoolPattern(client, "kucoinpool") - self.lubiancom: AaopoolPattern = AaopoolPattern(client, "lubiancom") - self.luckypool: AaopoolPattern = AaopoolPattern(client, "luckypool") - self.luxor: AaopoolPattern = AaopoolPattern(client, "luxor") - self.marapool: AaopoolPattern = AaopoolPattern(client, "marapool") - self.maxbtc: AaopoolPattern = AaopoolPattern(client, "maxbtc") - self.maxipool: AaopoolPattern = AaopoolPattern(client, "maxipool") - self.megabigpower: AaopoolPattern = AaopoolPattern(client, "megabigpower") - self.minerium: AaopoolPattern = AaopoolPattern(client, "minerium") - self.miningcity: AaopoolPattern = AaopoolPattern(client, "miningcity") - self.miningdutch: AaopoolPattern = AaopoolPattern(client, "miningdutch") - self.miningkings: AaopoolPattern = AaopoolPattern(client, "miningkings") - self.miningsquared: AaopoolPattern = AaopoolPattern(client, "miningsquared") - self.mmpool: AaopoolPattern = AaopoolPattern(client, "mmpool") - self.mtred: AaopoolPattern = AaopoolPattern(client, "mtred") - self.multicoinco: AaopoolPattern = AaopoolPattern(client, "multicoinco") - self.multipool: AaopoolPattern = AaopoolPattern(client, "multipool") - self.mybtccoinpool: AaopoolPattern = AaopoolPattern(client, "mybtccoinpool") - self.neopool: AaopoolPattern = AaopoolPattern(client, "neopool") - self.nexious: AaopoolPattern = AaopoolPattern(client, "nexious") - self.nicehash: AaopoolPattern = AaopoolPattern(client, "nicehash") - self.nmcbit: AaopoolPattern = AaopoolPattern(client, "nmcbit") - self.novablock: AaopoolPattern = AaopoolPattern(client, "novablock") - self.ocean: AaopoolPattern = AaopoolPattern(client, "ocean") - self.okexpool: AaopoolPattern = AaopoolPattern(client, "okexpool") - self.okkong: AaopoolPattern = AaopoolPattern(client, "okkong") - self.okminer: AaopoolPattern = AaopoolPattern(client, "okminer") - self.okpooltop: AaopoolPattern = AaopoolPattern(client, "okpooltop") - self.onehash: AaopoolPattern = AaopoolPattern(client, "onehash") - self.onem1x: AaopoolPattern = AaopoolPattern(client, "onem1x") - self.onethash: AaopoolPattern = AaopoolPattern(client, "onethash") - self.ozcoin: AaopoolPattern = AaopoolPattern(client, "ozcoin") - self.parasite: AaopoolPattern = AaopoolPattern(client, "parasite") - self.patels: AaopoolPattern = AaopoolPattern(client, "patels") - self.pegapool: AaopoolPattern = AaopoolPattern(client, "pegapool") - self.phashio: AaopoolPattern = AaopoolPattern(client, "phashio") - self.phoenix: AaopoolPattern = AaopoolPattern(client, "phoenix") - self.polmine: AaopoolPattern = AaopoolPattern(client, "polmine") - self.pool175btc: AaopoolPattern = AaopoolPattern(client, "pool175btc") - self.pool50btc: AaopoolPattern = AaopoolPattern(client, "pool50btc") - self.poolin: AaopoolPattern = AaopoolPattern(client, "poolin") - self.portlandhodl: AaopoolPattern = AaopoolPattern(client, "portlandhodl") - self.publicpool: AaopoolPattern = AaopoolPattern(client, "publicpool") - self.purebtccom: AaopoolPattern = AaopoolPattern(client, "purebtccom") - self.rawpool: AaopoolPattern = AaopoolPattern(client, "rawpool") - self.rigpool: AaopoolPattern = AaopoolPattern(client, "rigpool") - self.sbicrypto: AaopoolPattern = AaopoolPattern(client, "sbicrypto") - self.secpool: AaopoolPattern = AaopoolPattern(client, "secpool") - self.secretsuperstar: AaopoolPattern = AaopoolPattern(client, "secretsuperstar") - self.sevenpool: AaopoolPattern = AaopoolPattern(client, "sevenpool") - self.shawnp0wers: AaopoolPattern = AaopoolPattern(client, "shawnp0wers") - self.sigmapoolcom: AaopoolPattern = AaopoolPattern(client, "sigmapoolcom") - self.simplecoinus: AaopoolPattern = AaopoolPattern(client, "simplecoinus") - self.solock: AaopoolPattern = AaopoolPattern(client, "solock") - self.spiderpool: AaopoolPattern = AaopoolPattern(client, "spiderpool") - self.stminingcorp: AaopoolPattern = AaopoolPattern(client, "stminingcorp") - self.tangpool: AaopoolPattern = AaopoolPattern(client, "tangpool") - self.tatmaspool: AaopoolPattern = AaopoolPattern(client, "tatmaspool") - self.tbdice: AaopoolPattern = AaopoolPattern(client, "tbdice") - self.telco214: AaopoolPattern = AaopoolPattern(client, "telco214") - self.terrapool: AaopoolPattern = AaopoolPattern(client, "terrapool") - self.tiger: AaopoolPattern = AaopoolPattern(client, "tiger") - self.tigerpoolnet: AaopoolPattern = AaopoolPattern(client, "tigerpoolnet") - self.titan: AaopoolPattern = AaopoolPattern(client, "titan") - self.transactioncoinmining: AaopoolPattern = AaopoolPattern( - client, "transactioncoinmining" - ) - self.trickysbtcpool: AaopoolPattern = AaopoolPattern(client, "trickysbtcpool") - self.triplemining: AaopoolPattern = AaopoolPattern(client, "triplemining") - self.twentyoneinc: AaopoolPattern = AaopoolPattern(client, "twentyoneinc") - self.ultimuspool: AaopoolPattern = AaopoolPattern(client, "ultimuspool") - self.unknown: AaopoolPattern = AaopoolPattern(client, "unknown") - self.unomp: AaopoolPattern = AaopoolPattern(client, "unomp") - self.viabtc: AaopoolPattern = AaopoolPattern(client, "viabtc") - self.waterhole: AaopoolPattern = AaopoolPattern(client, "waterhole") - self.wayicn: AaopoolPattern = AaopoolPattern(client, "wayicn") - self.whitepool: AaopoolPattern = AaopoolPattern(client, "whitepool") - self.wk057: AaopoolPattern = AaopoolPattern(client, "wk057") - self.yourbtcnet: AaopoolPattern = AaopoolPattern(client, "yourbtcnet") - self.zulupool: AaopoolPattern = AaopoolPattern(client, "zulupool") - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.aaopool: AaopoolPattern = AaopoolPattern(client, 'aaopool') + self.antpool: AaopoolPattern = AaopoolPattern(client, 'antpool') + self.arkpool: AaopoolPattern = AaopoolPattern(client, 'arkpool') + self.asicminer: AaopoolPattern = AaopoolPattern(client, 'asicminer') + self.axbt: AaopoolPattern = AaopoolPattern(client, 'axbt') + self.batpool: AaopoolPattern = AaopoolPattern(client, 'batpool') + self.bcmonster: AaopoolPattern = AaopoolPattern(client, 'bcmonster') + self.bcpoolio: AaopoolPattern = AaopoolPattern(client, 'bcpoolio') + self.binancepool: AaopoolPattern = AaopoolPattern(client, 'binancepool') + self.bitalo: AaopoolPattern = AaopoolPattern(client, 'bitalo') + self.bitclub: AaopoolPattern = AaopoolPattern(client, 'bitclub') + self.bitcoinaffiliatenetwork: AaopoolPattern = AaopoolPattern(client, 'bitcoinaffiliatenetwork') + self.bitcoincom: AaopoolPattern = AaopoolPattern(client, 'bitcoincom') + self.bitcoinindia: AaopoolPattern = AaopoolPattern(client, 'bitcoinindia') + self.bitcoinrussia: AaopoolPattern = AaopoolPattern(client, 'bitcoinrussia') + self.bitcoinukraine: AaopoolPattern = AaopoolPattern(client, 'bitcoinukraine') + self.bitfarms: AaopoolPattern = AaopoolPattern(client, 'bitfarms') + self.bitfufupool: AaopoolPattern = AaopoolPattern(client, 'bitfufupool') + self.bitfury: AaopoolPattern = AaopoolPattern(client, 'bitfury') + self.bitminter: AaopoolPattern = AaopoolPattern(client, 'bitminter') + self.bitparking: AaopoolPattern = AaopoolPattern(client, 'bitparking') + self.bitsolo: AaopoolPattern = AaopoolPattern(client, 'bitsolo') + self.bixin: AaopoolPattern = AaopoolPattern(client, 'bixin') + self.blockfills: AaopoolPattern = AaopoolPattern(client, 'blockfills') + self.braiinspool: AaopoolPattern = AaopoolPattern(client, 'braiinspool') + self.bravomining: AaopoolPattern = AaopoolPattern(client, 'bravomining') + self.btcc: AaopoolPattern = AaopoolPattern(client, 'btcc') + self.btccom: AaopoolPattern = AaopoolPattern(client, 'btccom') + self.btcdig: AaopoolPattern = AaopoolPattern(client, 'btcdig') + self.btcguild: AaopoolPattern = AaopoolPattern(client, 'btcguild') + self.btclab: AaopoolPattern = AaopoolPattern(client, 'btclab') + self.btcmp: AaopoolPattern = AaopoolPattern(client, 'btcmp') + self.btcnuggets: AaopoolPattern = AaopoolPattern(client, 'btcnuggets') + self.btcpoolparty: AaopoolPattern = AaopoolPattern(client, 'btcpoolparty') + self.btcserv: AaopoolPattern = AaopoolPattern(client, 'btcserv') + self.btctop: AaopoolPattern = AaopoolPattern(client, 'btctop') + self.btpool: AaopoolPattern = AaopoolPattern(client, 'btpool') + self.bwpool: AaopoolPattern = AaopoolPattern(client, 'bwpool') + self.bytepool: AaopoolPattern = AaopoolPattern(client, 'bytepool') + self.canoe: AaopoolPattern = AaopoolPattern(client, 'canoe') + self.canoepool: AaopoolPattern = AaopoolPattern(client, 'canoepool') + self.carbonnegative: AaopoolPattern = AaopoolPattern(client, 'carbonnegative') + self.ckpool: AaopoolPattern = AaopoolPattern(client, 'ckpool') + self.cloudhashing: AaopoolPattern = AaopoolPattern(client, 'cloudhashing') + self.coinlab: AaopoolPattern = AaopoolPattern(client, 'coinlab') + self.cointerra: AaopoolPattern = AaopoolPattern(client, 'cointerra') + self.connectbtc: AaopoolPattern = AaopoolPattern(client, 'connectbtc') + self.dcex: AaopoolPattern = AaopoolPattern(client, 'dcex') + self.dcexploration: AaopoolPattern = AaopoolPattern(client, 'dcexploration') + self.digitalbtc: AaopoolPattern = AaopoolPattern(client, 'digitalbtc') + self.digitalxmintsy: AaopoolPattern = AaopoolPattern(client, 'digitalxmintsy') + self.dpool: AaopoolPattern = AaopoolPattern(client, 'dpool') + self.eclipsemc: AaopoolPattern = AaopoolPattern(client, 'eclipsemc') + self.eightbaochi: AaopoolPattern = AaopoolPattern(client, 'eightbaochi') + self.ekanembtc: AaopoolPattern = AaopoolPattern(client, 'ekanembtc') + self.eligius: AaopoolPattern = AaopoolPattern(client, 'eligius') + self.emcdpool: AaopoolPattern = AaopoolPattern(client, 'emcdpool') + self.entrustcharitypool: AaopoolPattern = AaopoolPattern(client, 'entrustcharitypool') + self.eobot: AaopoolPattern = AaopoolPattern(client, 'eobot') + self.exxbw: AaopoolPattern = AaopoolPattern(client, 'exxbw') + self.f2pool: AaopoolPattern = AaopoolPattern(client, 'f2pool') + self.fiftyeightcoin: AaopoolPattern = AaopoolPattern(client, 'fiftyeightcoin') + self.foundryusa: AaopoolPattern = AaopoolPattern(client, 'foundryusa') + self.futurebitapollosolo: AaopoolPattern = AaopoolPattern(client, 'futurebitapollosolo') + self.gbminers: AaopoolPattern = AaopoolPattern(client, 'gbminers') + self.ghashio: AaopoolPattern = AaopoolPattern(client, 'ghashio') + self.givemecoins: AaopoolPattern = AaopoolPattern(client, 'givemecoins') + self.gogreenlight: AaopoolPattern = AaopoolPattern(client, 'gogreenlight') + self.haominer: AaopoolPattern = AaopoolPattern(client, 'haominer') + self.haozhuzhu: AaopoolPattern = AaopoolPattern(client, 'haozhuzhu') + self.hashbx: AaopoolPattern = AaopoolPattern(client, 'hashbx') + self.hashpool: AaopoolPattern = AaopoolPattern(client, 'hashpool') + self.helix: AaopoolPattern = AaopoolPattern(client, 'helix') + self.hhtt: AaopoolPattern = AaopoolPattern(client, 'hhtt') + self.hotpool: AaopoolPattern = AaopoolPattern(client, 'hotpool') + self.hummerpool: AaopoolPattern = AaopoolPattern(client, 'hummerpool') + self.huobipool: AaopoolPattern = AaopoolPattern(client, 'huobipool') + self.innopolistech: AaopoolPattern = AaopoolPattern(client, 'innopolistech') + self.kanopool: AaopoolPattern = AaopoolPattern(client, 'kanopool') + self.kncminer: AaopoolPattern = AaopoolPattern(client, 'kncminer') + self.kucoinpool: AaopoolPattern = AaopoolPattern(client, 'kucoinpool') + self.lubiancom: AaopoolPattern = AaopoolPattern(client, 'lubiancom') + self.luckypool: AaopoolPattern = AaopoolPattern(client, 'luckypool') + self.luxor: AaopoolPattern = AaopoolPattern(client, 'luxor') + self.marapool: AaopoolPattern = AaopoolPattern(client, 'marapool') + self.maxbtc: AaopoolPattern = AaopoolPattern(client, 'maxbtc') + self.maxipool: AaopoolPattern = AaopoolPattern(client, 'maxipool') + self.megabigpower: AaopoolPattern = AaopoolPattern(client, 'megabigpower') + self.minerium: AaopoolPattern = AaopoolPattern(client, 'minerium') + self.miningcity: AaopoolPattern = AaopoolPattern(client, 'miningcity') + self.miningdutch: AaopoolPattern = AaopoolPattern(client, 'miningdutch') + self.miningkings: AaopoolPattern = AaopoolPattern(client, 'miningkings') + self.miningsquared: AaopoolPattern = AaopoolPattern(client, 'miningsquared') + self.mmpool: AaopoolPattern = AaopoolPattern(client, 'mmpool') + self.mtred: AaopoolPattern = AaopoolPattern(client, 'mtred') + self.multicoinco: AaopoolPattern = AaopoolPattern(client, 'multicoinco') + self.multipool: AaopoolPattern = AaopoolPattern(client, 'multipool') + self.mybtccoinpool: AaopoolPattern = AaopoolPattern(client, 'mybtccoinpool') + self.neopool: AaopoolPattern = AaopoolPattern(client, 'neopool') + self.nexious: AaopoolPattern = AaopoolPattern(client, 'nexious') + self.nicehash: AaopoolPattern = AaopoolPattern(client, 'nicehash') + self.nmcbit: AaopoolPattern = AaopoolPattern(client, 'nmcbit') + self.novablock: AaopoolPattern = AaopoolPattern(client, 'novablock') + self.ocean: AaopoolPattern = AaopoolPattern(client, 'ocean') + self.okexpool: AaopoolPattern = AaopoolPattern(client, 'okexpool') + self.okkong: AaopoolPattern = AaopoolPattern(client, 'okkong') + self.okminer: AaopoolPattern = AaopoolPattern(client, 'okminer') + self.okpooltop: AaopoolPattern = AaopoolPattern(client, 'okpooltop') + self.onehash: AaopoolPattern = AaopoolPattern(client, 'onehash') + self.onem1x: AaopoolPattern = AaopoolPattern(client, 'onem1x') + self.onethash: AaopoolPattern = AaopoolPattern(client, 'onethash') + self.ozcoin: AaopoolPattern = AaopoolPattern(client, 'ozcoin') + self.parasite: AaopoolPattern = AaopoolPattern(client, 'parasite') + self.patels: AaopoolPattern = AaopoolPattern(client, 'patels') + self.pegapool: AaopoolPattern = AaopoolPattern(client, 'pegapool') + self.phashio: AaopoolPattern = AaopoolPattern(client, 'phashio') + self.phoenix: AaopoolPattern = AaopoolPattern(client, 'phoenix') + self.polmine: AaopoolPattern = AaopoolPattern(client, 'polmine') + self.pool175btc: AaopoolPattern = AaopoolPattern(client, 'pool175btc') + self.pool50btc: AaopoolPattern = AaopoolPattern(client, 'pool50btc') + self.poolin: AaopoolPattern = AaopoolPattern(client, 'poolin') + self.portlandhodl: AaopoolPattern = AaopoolPattern(client, 'portlandhodl') + self.publicpool: AaopoolPattern = AaopoolPattern(client, 'publicpool') + self.purebtccom: AaopoolPattern = AaopoolPattern(client, 'purebtccom') + self.rawpool: AaopoolPattern = AaopoolPattern(client, 'rawpool') + self.rigpool: AaopoolPattern = AaopoolPattern(client, 'rigpool') + self.sbicrypto: AaopoolPattern = AaopoolPattern(client, 'sbicrypto') + self.secpool: AaopoolPattern = AaopoolPattern(client, 'secpool') + self.secretsuperstar: AaopoolPattern = AaopoolPattern(client, 'secretsuperstar') + self.sevenpool: AaopoolPattern = AaopoolPattern(client, 'sevenpool') + self.shawnp0wers: AaopoolPattern = AaopoolPattern(client, 'shawnp0wers') + self.sigmapoolcom: AaopoolPattern = AaopoolPattern(client, 'sigmapoolcom') + self.simplecoinus: AaopoolPattern = AaopoolPattern(client, 'simplecoinus') + self.solock: AaopoolPattern = AaopoolPattern(client, 'solock') + self.spiderpool: AaopoolPattern = AaopoolPattern(client, 'spiderpool') + self.stminingcorp: AaopoolPattern = AaopoolPattern(client, 'stminingcorp') + self.tangpool: AaopoolPattern = AaopoolPattern(client, 'tangpool') + self.tatmaspool: AaopoolPattern = AaopoolPattern(client, 'tatmaspool') + self.tbdice: AaopoolPattern = AaopoolPattern(client, 'tbdice') + self.telco214: AaopoolPattern = AaopoolPattern(client, 'telco214') + self.terrapool: AaopoolPattern = AaopoolPattern(client, 'terrapool') + self.tiger: AaopoolPattern = AaopoolPattern(client, 'tiger') + self.tigerpoolnet: AaopoolPattern = AaopoolPattern(client, 'tigerpoolnet') + self.titan: AaopoolPattern = AaopoolPattern(client, 'titan') + self.transactioncoinmining: AaopoolPattern = AaopoolPattern(client, 'transactioncoinmining') + self.trickysbtcpool: AaopoolPattern = AaopoolPattern(client, 'trickysbtcpool') + self.triplemining: AaopoolPattern = AaopoolPattern(client, 'triplemining') + self.twentyoneinc: AaopoolPattern = AaopoolPattern(client, 'twentyoneinc') + self.ultimuspool: AaopoolPattern = AaopoolPattern(client, 'ultimuspool') + self.unknown: AaopoolPattern = AaopoolPattern(client, 'unknown') + self.unomp: AaopoolPattern = AaopoolPattern(client, 'unomp') + self.viabtc: AaopoolPattern = AaopoolPattern(client, 'viabtc') + self.waterhole: AaopoolPattern = AaopoolPattern(client, 'waterhole') + self.wayicn: AaopoolPattern = AaopoolPattern(client, 'wayicn') + self.whitepool: AaopoolPattern = AaopoolPattern(client, 'whitepool') + self.wk057: AaopoolPattern = AaopoolPattern(client, 'wk057') + self.yourbtcnet: AaopoolPattern = AaopoolPattern(client, 'yourbtcnet') + self.zulupool: AaopoolPattern = AaopoolPattern(client, 'zulupool') class MetricsTree_Pools: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.height_to_pool: MetricPattern11[PoolSlug] = MetricPattern11(client, "pool") + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.height_to_pool: MetricPattern11[PoolSlug] = MetricPattern11(client, 'pool') self.vecs: MetricsTree_Pools_Vecs = MetricsTree_Pools_Vecs(client) - class MetricsTree_Positions: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.block_position: MetricPattern11[BlkPosition] = MetricPattern11( - client, "position" - ) - self.tx_position: MetricPattern27[BlkPosition] = MetricPattern27( - client, "position" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.block_position: MetricPattern11[BlkPosition] = MetricPattern11(client, 'position') + self.tx_position: MetricPattern27[BlkPosition] = MetricPattern27(client, 'position') class MetricsTree_Price_Cents_Split: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.close: MetricPattern5[Cents] = MetricPattern5(client, "price_close_cents") - self.high: MetricPattern5[Cents] = MetricPattern5(client, "price_high_cents") - self.low: MetricPattern5[Cents] = MetricPattern5(client, "price_low_cents") - self.open: MetricPattern5[Cents] = MetricPattern5(client, "price_open_cents") - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.close: MetricPattern5[Cents] = MetricPattern5(client, 'price_close_cents') + self.high: MetricPattern5[Cents] = MetricPattern5(client, 'price_high_cents') + self.low: MetricPattern5[Cents] = MetricPattern5(client, 'price_low_cents') + self.open: MetricPattern5[Cents] = MetricPattern5(client, 'price_open_cents') class MetricsTree_Price_Cents: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.ohlc: MetricPattern5[OHLCCents] = MetricPattern5(client, "ohlc_cents") - self.split: MetricsTree_Price_Cents_Split = MetricsTree_Price_Cents_Split( - client - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.ohlc: MetricPattern5[OHLCCents] = MetricPattern5(client, 'ohlc_cents') + self.split: MetricsTree_Price_Cents_Split = MetricsTree_Price_Cents_Split(client) class MetricsTree_Price_Oracle: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.ohlc: MetricPattern6[OHLCCents] = MetricPattern6( - client, "oracle_dateindex_to_ohlc" - ) - self.price: MetricPattern11[Cents] = MetricPattern11( - client, "oracle_height_to_price" - ) - self.tx_count: MetricPattern6[StoredU32] = MetricPattern6( - client, "oracle_dateindex_to_tx_count" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.ohlc_cents: MetricPattern6[OHLCCents] = MetricPattern6(client, 'oracle_ohlc_cents') + self.price_cents: MetricPattern11[Cents] = MetricPattern11(client, 'orange_price_cents') + self.tx_count: MetricPattern6[StoredU32] = MetricPattern6(client, 'oracle_tx_count') class MetricsTree_Price: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): + + def __init__(self, client: BrkClientBase, base_path: str = ''): self.cents: MetricsTree_Price_Cents = MetricsTree_Price_Cents(client) self.oracle: MetricsTree_Price_Oracle = MetricsTree_Price_Oracle(client) - self.sats: SatsPattern[OHLCSats] = SatsPattern(client, "price") - self.usd: SatsPattern[OHLCDollars] = SatsPattern(client, "price") - + self.sats: SatsPattern[OHLCSats] = SatsPattern(client, 'price') + self.usd: SatsPattern[OHLCDollars] = SatsPattern(client, 'price') class MetricsTree_Scripts_Count: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.emptyoutput: DollarsPattern[StoredU64] = DollarsPattern( - client, "emptyoutput_count" - ) - self.opreturn: DollarsPattern[StoredU64] = DollarsPattern( - client, "opreturn_count" - ) - self.p2a: DollarsPattern[StoredU64] = DollarsPattern(client, "p2a_count") - self.p2ms: DollarsPattern[StoredU64] = DollarsPattern(client, "p2ms_count") - self.p2pk33: DollarsPattern[StoredU64] = DollarsPattern(client, "p2pk33_count") - self.p2pk65: DollarsPattern[StoredU64] = DollarsPattern(client, "p2pk65_count") - self.p2pkh: DollarsPattern[StoredU64] = DollarsPattern(client, "p2pkh_count") - self.p2sh: DollarsPattern[StoredU64] = DollarsPattern(client, "p2sh_count") - self.p2tr: DollarsPattern[StoredU64] = DollarsPattern(client, "p2tr_count") - self.p2wpkh: DollarsPattern[StoredU64] = DollarsPattern(client, "p2wpkh_count") - self.p2wsh: DollarsPattern[StoredU64] = DollarsPattern(client, "p2wsh_count") - self.segwit: DollarsPattern[StoredU64] = DollarsPattern(client, "segwit_count") - self.segwit_adoption: SegwitAdoptionPattern = SegwitAdoptionPattern( - client, "segwit_adoption" - ) - self.taproot_adoption: SegwitAdoptionPattern = SegwitAdoptionPattern( - client, "taproot_adoption" - ) - self.unknownoutput: DollarsPattern[StoredU64] = DollarsPattern( - client, "unknownoutput_count" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.emptyoutput: DollarsPattern[StoredU64] = DollarsPattern(client, 'emptyoutput_count') + self.opreturn: DollarsPattern[StoredU64] = DollarsPattern(client, 'opreturn_count') + self.p2a: DollarsPattern[StoredU64] = DollarsPattern(client, 'p2a_count') + self.p2ms: DollarsPattern[StoredU64] = DollarsPattern(client, 'p2ms_count') + self.p2pk33: DollarsPattern[StoredU64] = DollarsPattern(client, 'p2pk33_count') + self.p2pk65: DollarsPattern[StoredU64] = DollarsPattern(client, 'p2pk65_count') + self.p2pkh: DollarsPattern[StoredU64] = DollarsPattern(client, 'p2pkh_count') + self.p2sh: DollarsPattern[StoredU64] = DollarsPattern(client, 'p2sh_count') + self.p2tr: DollarsPattern[StoredU64] = DollarsPattern(client, 'p2tr_count') + self.p2wpkh: DollarsPattern[StoredU64] = DollarsPattern(client, 'p2wpkh_count') + self.p2wsh: DollarsPattern[StoredU64] = DollarsPattern(client, 'p2wsh_count') + self.segwit: DollarsPattern[StoredU64] = DollarsPattern(client, 'segwit_count') + self.segwit_adoption: SegwitAdoptionPattern = SegwitAdoptionPattern(client, 'segwit_adoption') + self.taproot_adoption: SegwitAdoptionPattern = SegwitAdoptionPattern(client, 'taproot_adoption') + self.unknownoutput: DollarsPattern[StoredU64] = DollarsPattern(client, 'unknownoutput_count') class MetricsTree_Scripts_Value: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.opreturn: CoinbasePattern = CoinbasePattern(client, "opreturn_value") - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.opreturn: CoinbasePattern = CoinbasePattern(client, 'opreturn_value') class MetricsTree_Scripts: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): + + def __init__(self, client: BrkClientBase, base_path: str = ''): self.count: MetricsTree_Scripts_Count = MetricsTree_Scripts_Count(client) - self.empty_to_txindex: MetricPattern9[TxIndex] = MetricPattern9( - client, "txindex" - ) - self.first_emptyoutputindex: MetricPattern11[EmptyOutputIndex] = ( - MetricPattern11(client, "first_emptyoutputindex") - ) - self.first_opreturnindex: MetricPattern11[OpReturnIndex] = MetricPattern11( - client, "first_opreturnindex" - ) - self.first_p2msoutputindex: MetricPattern11[P2MSOutputIndex] = MetricPattern11( - client, "first_p2msoutputindex" - ) - self.first_unknownoutputindex: MetricPattern11[UnknownOutputIndex] = ( - MetricPattern11(client, "first_unknownoutputindex") - ) - self.opreturn_to_txindex: MetricPattern14[TxIndex] = MetricPattern14( - client, "txindex" - ) - self.p2ms_to_txindex: MetricPattern17[TxIndex] = MetricPattern17( - client, "txindex" - ) - self.unknown_to_txindex: MetricPattern28[TxIndex] = MetricPattern28( - client, "txindex" - ) + self.empty_to_txindex: MetricPattern9[TxIndex] = MetricPattern9(client, 'txindex') + self.first_emptyoutputindex: MetricPattern11[EmptyOutputIndex] = MetricPattern11(client, 'first_emptyoutputindex') + self.first_opreturnindex: MetricPattern11[OpReturnIndex] = MetricPattern11(client, 'first_opreturnindex') + self.first_p2msoutputindex: MetricPattern11[P2MSOutputIndex] = MetricPattern11(client, 'first_p2msoutputindex') + self.first_unknownoutputindex: MetricPattern11[UnknownOutputIndex] = MetricPattern11(client, 'first_unknownoutputindex') + self.opreturn_to_txindex: MetricPattern14[TxIndex] = MetricPattern14(client, 'txindex') + self.p2ms_to_txindex: MetricPattern17[TxIndex] = MetricPattern17(client, 'txindex') + self.unknown_to_txindex: MetricPattern28[TxIndex] = MetricPattern28(client, 'txindex') self.value: MetricsTree_Scripts_Value = MetricsTree_Scripts_Value(client) - class MetricsTree_Supply_Burned: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.opreturn: UnclaimedRewardsPattern = UnclaimedRewardsPattern( - client, "opreturn_supply" - ) - self.unspendable: UnclaimedRewardsPattern = UnclaimedRewardsPattern( - client, "unspendable_supply" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.opreturn: UnclaimedRewardsPattern = UnclaimedRewardsPattern(client, 'opreturn_supply') + self.unspendable: UnclaimedRewardsPattern = UnclaimedRewardsPattern(client, 'unspendable_supply') class MetricsTree_Supply_Circulating: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.bitcoin: MetricPattern3[Bitcoin] = MetricPattern3( - client, "circulating_supply_btc" - ) - self.dollars: MetricPattern3[Dollars] = MetricPattern3( - client, "circulating_supply_usd" - ) - self.sats: MetricPattern3[Sats] = MetricPattern3(client, "circulating_supply") - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.bitcoin: MetricPattern3[Bitcoin] = MetricPattern3(client, 'circulating_supply_btc') + self.dollars: MetricPattern3[Dollars] = MetricPattern3(client, 'circulating_supply_usd') + self.sats: MetricPattern3[Sats] = MetricPattern3(client, 'circulating_supply') class MetricsTree_Supply_Velocity: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.btc: MetricPattern4[StoredF64] = MetricPattern4(client, "btc_velocity") - self.usd: MetricPattern4[StoredF64] = MetricPattern4(client, "usd_velocity") - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.btc: MetricPattern4[StoredF64] = MetricPattern4(client, 'btc_velocity') + self.usd: MetricPattern4[StoredF64] = MetricPattern4(client, 'usd_velocity') class MetricsTree_Supply: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): + + def __init__(self, client: BrkClientBase, base_path: str = ''): self.burned: MetricsTree_Supply_Burned = MetricsTree_Supply_Burned(client) - self.circulating: MetricsTree_Supply_Circulating = ( - MetricsTree_Supply_Circulating(client) - ) - self.inflation: MetricPattern4[StoredF32] = MetricPattern4( - client, "inflation_rate" - ) - self.market_cap: MetricPattern1[Dollars] = MetricPattern1(client, "market_cap") + self.circulating: MetricsTree_Supply_Circulating = MetricsTree_Supply_Circulating(client) + self.inflation: MetricPattern4[StoredF32] = MetricPattern4(client, 'inflation_rate') + self.market_cap: MetricPattern1[Dollars] = MetricPattern1(client, 'market_cap') self.velocity: MetricsTree_Supply_Velocity = MetricsTree_Supply_Velocity(client) - class MetricsTree_Transactions_Count: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.is_coinbase: MetricPattern27[StoredBool] = MetricPattern27( - client, "is_coinbase" - ) - self.tx_count: DollarsPattern[StoredU64] = DollarsPattern(client, "tx_count") - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.is_coinbase: MetricPattern27[StoredBool] = MetricPattern27(client, 'is_coinbase') + self.tx_count: DollarsPattern[StoredU64] = DollarsPattern(client, 'tx_count') class MetricsTree_Transactions_Fees_Fee_Dollars: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.average: MetricPattern1[Dollars] = MetricPattern1( - client, "fee_usd_average" - ) - self.cumulative: MetricPattern2[Dollars] = MetricPattern2( - client, "fee_usd_cumulative" - ) - self.height_cumulative: MetricPattern11[Dollars] = MetricPattern11( - client, "fee_usd_cumulative" - ) - self.max: MetricPattern1[Dollars] = MetricPattern1(client, "fee_usd_max") - self.median: MetricPattern11[Dollars] = MetricPattern11( - client, "fee_usd_median" - ) - self.min: MetricPattern1[Dollars] = MetricPattern1(client, "fee_usd_min") - self.pct10: MetricPattern11[Dollars] = MetricPattern11(client, "fee_usd_pct10") - self.pct25: MetricPattern11[Dollars] = MetricPattern11(client, "fee_usd_pct25") - self.pct75: MetricPattern11[Dollars] = MetricPattern11(client, "fee_usd_pct75") - self.pct90: MetricPattern11[Dollars] = MetricPattern11(client, "fee_usd_pct90") - self.sum: MetricPattern1[Dollars] = MetricPattern1(client, "fee_usd_sum") - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.average: MetricPattern1[Dollars] = MetricPattern1(client, 'fee_usd_average') + self.cumulative: MetricPattern2[Dollars] = MetricPattern2(client, 'fee_usd_cumulative') + self.height_cumulative: MetricPattern11[Dollars] = MetricPattern11(client, 'fee_usd_cumulative') + self.max: MetricPattern1[Dollars] = MetricPattern1(client, 'fee_usd_max') + self.median: MetricPattern11[Dollars] = MetricPattern11(client, 'fee_usd_median') + self.min: MetricPattern1[Dollars] = MetricPattern1(client, 'fee_usd_min') + self.pct10: MetricPattern11[Dollars] = MetricPattern11(client, 'fee_usd_pct10') + self.pct25: MetricPattern11[Dollars] = MetricPattern11(client, 'fee_usd_pct25') + self.pct75: MetricPattern11[Dollars] = MetricPattern11(client, 'fee_usd_pct75') + self.pct90: MetricPattern11[Dollars] = MetricPattern11(client, 'fee_usd_pct90') + self.sum: MetricPattern1[Dollars] = MetricPattern1(client, 'fee_usd_sum') class MetricsTree_Transactions_Fees_Fee: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.bitcoin: CountPattern2[Bitcoin] = CountPattern2(client, "fee_btc") - self.dollars: MetricsTree_Transactions_Fees_Fee_Dollars = ( - MetricsTree_Transactions_Fees_Fee_Dollars(client) - ) - self.sats: CountPattern2[Sats] = CountPattern2(client, "fee") - self.txindex: MetricPattern27[Sats] = MetricPattern27(client, "fee") - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.bitcoin: CountPattern2[Bitcoin] = CountPattern2(client, 'fee_btc') + self.dollars: MetricsTree_Transactions_Fees_Fee_Dollars = MetricsTree_Transactions_Fees_Fee_Dollars(client) + self.sats: CountPattern2[Sats] = CountPattern2(client, 'fee') + self.txindex: MetricPattern27[Sats] = MetricPattern27(client, 'fee') class MetricsTree_Transactions_Fees: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.fee: MetricsTree_Transactions_Fees_Fee = MetricsTree_Transactions_Fees_Fee( - client - ) - self.fee_rate: FeeRatePattern[FeeRate] = FeeRatePattern(client, "fee_rate") - self.input_value: MetricPattern27[Sats] = MetricPattern27(client, "input_value") - self.output_value: MetricPattern27[Sats] = MetricPattern27( - client, "output_value" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.fee: MetricsTree_Transactions_Fees_Fee = MetricsTree_Transactions_Fees_Fee(client) + self.fee_rate: FeeRatePattern[FeeRate] = FeeRatePattern(client, 'fee_rate') + self.input_value: MetricPattern27[Sats] = MetricPattern27(client, 'input_value') + self.output_value: MetricPattern27[Sats] = MetricPattern27(client, 'output_value') class MetricsTree_Transactions_Size: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.vsize: FeeRatePattern[VSize] = FeeRatePattern(client, "tx_vsize") - self.weight: FeeRatePattern[Weight] = FeeRatePattern(client, "tx_weight") - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.vsize: FeeRatePattern[VSize] = FeeRatePattern(client, 'tx_vsize') + self.weight: FeeRatePattern[Weight] = FeeRatePattern(client, 'tx_weight') class MetricsTree_Transactions_Versions: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.v1: BlockCountPattern[StoredU64] = BlockCountPattern(client, "tx_v1") - self.v2: BlockCountPattern[StoredU64] = BlockCountPattern(client, "tx_v2") - self.v3: BlockCountPattern[StoredU64] = BlockCountPattern(client, "tx_v3") - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.v1: BlockCountPattern[StoredU64] = BlockCountPattern(client, 'tx_v1') + self.v2: BlockCountPattern[StoredU64] = BlockCountPattern(client, 'tx_v2') + self.v3: BlockCountPattern[StoredU64] = BlockCountPattern(client, 'tx_v3') class MetricsTree_Transactions_Volume: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.annualized_volume: _2015Pattern = _2015Pattern(client, "annualized_volume") - self.inputs_per_sec: MetricPattern4[StoredF32] = MetricPattern4( - client, "inputs_per_sec" - ) - self.outputs_per_sec: MetricPattern4[StoredF32] = MetricPattern4( - client, "outputs_per_sec" - ) - self.sent_sum: ActiveSupplyPattern = ActiveSupplyPattern(client, "sent_sum") - self.tx_per_sec: MetricPattern4[StoredF32] = MetricPattern4( - client, "tx_per_sec" - ) - + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.annualized_volume: _2015Pattern = _2015Pattern(client, 'annualized_volume') + self.inputs_per_sec: MetricPattern4[StoredF32] = MetricPattern4(client, 'inputs_per_sec') + self.outputs_per_sec: MetricPattern4[StoredF32] = MetricPattern4(client, 'outputs_per_sec') + self.sent_sum: ActiveSupplyPattern = ActiveSupplyPattern(client, 'sent_sum') + self.tx_per_sec: MetricPattern4[StoredF32] = MetricPattern4(client, 'tx_per_sec') class MetricsTree_Transactions: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): - self.base_size: MetricPattern27[StoredU32] = MetricPattern27( - client, "base_size" - ) - self.count: MetricsTree_Transactions_Count = MetricsTree_Transactions_Count( - client - ) + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.base_size: MetricPattern27[StoredU32] = MetricPattern27(client, 'base_size') + self.count: MetricsTree_Transactions_Count = MetricsTree_Transactions_Count(client) self.fees: MetricsTree_Transactions_Fees = MetricsTree_Transactions_Fees(client) - self.first_txindex: MetricPattern11[TxIndex] = MetricPattern11( - client, "first_txindex" - ) - self.first_txinindex: MetricPattern27[TxInIndex] = MetricPattern27( - client, "first_txinindex" - ) - self.first_txoutindex: MetricPattern27[TxOutIndex] = MetricPattern27( - client, "first_txoutindex" - ) - self.height: MetricPattern27[Height] = MetricPattern27(client, "height") - self.is_explicitly_rbf: MetricPattern27[StoredBool] = MetricPattern27( - client, "is_explicitly_rbf" - ) - self.rawlocktime: MetricPattern27[RawLockTime] = MetricPattern27( - client, "rawlocktime" - ) + self.first_txindex: MetricPattern11[TxIndex] = MetricPattern11(client, 'first_txindex') + self.first_txinindex: MetricPattern27[TxInIndex] = MetricPattern27(client, 'first_txinindex') + self.first_txoutindex: MetricPattern27[TxOutIndex] = MetricPattern27(client, 'first_txoutindex') + self.height: MetricPattern27[Height] = MetricPattern27(client, 'height') + self.is_explicitly_rbf: MetricPattern27[StoredBool] = MetricPattern27(client, 'is_explicitly_rbf') + self.rawlocktime: MetricPattern27[RawLockTime] = MetricPattern27(client, 'rawlocktime') self.size: MetricsTree_Transactions_Size = MetricsTree_Transactions_Size(client) - self.total_size: MetricPattern27[StoredU32] = MetricPattern27( - client, "total_size" - ) - self.txid: MetricPattern27[Txid] = MetricPattern27(client, "txid") - self.txversion: MetricPattern27[TxVersion] = MetricPattern27( - client, "txversion" - ) - self.versions: MetricsTree_Transactions_Versions = ( - MetricsTree_Transactions_Versions(client) - ) - self.volume: MetricsTree_Transactions_Volume = MetricsTree_Transactions_Volume( - client - ) - + self.total_size: MetricPattern27[StoredU32] = MetricPattern27(client, 'total_size') + self.txid: MetricPattern27[Txid] = MetricPattern27(client, 'txid') + self.txversion: MetricPattern27[TxVersion] = MetricPattern27(client, 'txversion') + self.versions: MetricsTree_Transactions_Versions = MetricsTree_Transactions_Versions(client) + self.volume: MetricsTree_Transactions_Volume = MetricsTree_Transactions_Volume(client) class MetricsTree: """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ""): + + def __init__(self, client: BrkClientBase, base_path: str = ''): self.addresses: MetricsTree_Addresses = MetricsTree_Addresses(client) self.blocks: MetricsTree_Blocks = MetricsTree_Blocks(client) self.cointime: MetricsTree_Cointime = MetricsTree_Cointime(client) @@ -6571,644 +4520,903 @@ class MetricsTree: self.supply: MetricsTree_Supply = MetricsTree_Supply(client) self.transactions: MetricsTree_Transactions = MetricsTree_Transactions(client) - class BrkClient(BrkClientBase): """Main BRK client with metrics tree and API methods.""" VERSION = "v0.1.0-alpha.2" INDEXES = [ - "dateindex", - "decadeindex", - "difficultyepoch", - "emptyoutputindex", - "halvingepoch", - "height", - "txinindex", - "monthindex", - "opreturnindex", - "txoutindex", - "p2aaddressindex", - "p2msoutputindex", - "p2pk33addressindex", - "p2pk65addressindex", - "p2pkhaddressindex", - "p2shaddressindex", - "p2traddressindex", - "p2wpkhaddressindex", - "p2wshaddressindex", - "quarterindex", - "semesterindex", - "txindex", - "unknownoutputindex", - "weekindex", - "yearindex", - "loadedaddressindex", - "emptyaddressindex", + "dateindex", + "decadeindex", + "difficultyepoch", + "emptyoutputindex", + "halvingepoch", + "height", + "txinindex", + "monthindex", + "opreturnindex", + "txoutindex", + "p2aaddressindex", + "p2msoutputindex", + "p2pk33addressindex", + "p2pk65addressindex", + "p2pkhaddressindex", + "p2shaddressindex", + "p2traddressindex", + "p2wpkhaddressindex", + "p2wshaddressindex", + "quarterindex", + "semesterindex", + "txindex", + "unknownoutputindex", + "weekindex", + "yearindex", + "loadedaddressindex", + "emptyaddressindex" ] POOL_ID_TO_POOL_NAME = { - "aaopool": "AAO Pool", - "antpool": "AntPool", - "arkpool": "ArkPool", - "asicminer": "ASICMiner", - "axbt": "A-XBT", - "batpool": "BATPOOL", - "bcmonster": "BCMonster", - "bcpoolio": "bcpool.io", - "binancepool": "Binance Pool", - "bitalo": "Bitalo", - "bitclub": "BitClub", - "bitcoinaffiliatenetwork": "Bitcoin Affiliate Network", - "bitcoincom": "Bitcoin.com", - "bitcoinindia": "Bitcoin India", - "bitcoinrussia": "BitcoinRussia", - "bitcoinukraine": "Bitcoin-Ukraine", - "bitfarms": "Bitfarms", - "bitfufupool": "BitFuFuPool", - "bitfury": "BitFury", - "bitminter": "BitMinter", - "bitparking": "Bitparking", - "bitsolo": "Bitsolo", - "bixin": "Bixin", - "blockfills": "BlockFills", - "braiinspool": "Braiins Pool", - "bravomining": "Bravo Mining", - "btcc": "BTCC", - "btccom": "BTC.com", - "btcdig": "BTCDig", - "btcguild": "BTC Guild", - "btclab": "BTCLab", - "btcmp": "BTCMP", - "btcnuggets": "BTC Nuggets", - "btcpoolparty": "BTC Pool Party", - "btcserv": "BTCServ", - "btctop": "BTC.TOP", - "btpool": "BTPOOL", - "bwpool": "BWPool", - "bytepool": "BytePool", - "canoe": "CANOE", - "canoepool": "CanoePool", - "carbonnegative": "Carbon Negative", - "ckpool": "CKPool", - "cloudhashing": "CloudHashing", - "coinlab": "CoinLab", - "cointerra": "Cointerra", - "connectbtc": "ConnectBTC", - "dcex": "DCEX", - "dcexploration": "DCExploration", - "digitalbtc": "digitalBTC", - "digitalxmintsy": "digitalX Mintsy", - "dpool": "DPOOL", - "eclipsemc": "EclipseMC", - "eightbaochi": "8baochi", - "ekanembtc": "EkanemBTC", - "eligius": "Eligius", - "emcdpool": "EMCDPool", - "entrustcharitypool": "Entrust Charity Pool", - "eobot": "Eobot", - "exxbw": "EXX&BW", - "f2pool": "F2Pool", - "fiftyeightcoin": "58COIN", - "foundryusa": "Foundry USA", - "futurebitapollosolo": "FutureBit Apollo Solo", - "gbminers": "GBMiners", - "ghashio": "GHash.IO", - "givemecoins": "Give Me Coins", - "gogreenlight": "GoGreenLight", - "haominer": "haominer", - "haozhuzhu": "HAOZHUZHU", - "hashbx": "HashBX", - "hashpool": "HASHPOOL", - "helix": "Helix", - "hhtt": "HHTT", - "hotpool": "HotPool", - "hummerpool": "Hummerpool", - "huobipool": "Huobi.pool", - "innopolistech": "Innopolis Tech", - "kanopool": "KanoPool", - "kncminer": "KnCMiner", - "kucoinpool": "KuCoinPool", - "lubiancom": "Lubian.com", - "luckypool": "luckyPool", - "luxor": "Luxor", - "marapool": "MARA Pool", - "maxbtc": "MaxBTC", - "maxipool": "MaxiPool", - "megabigpower": "MegaBigPower", - "minerium": "Minerium", - "miningcity": "MiningCity", - "miningdutch": "Mining-Dutch", - "miningkings": "MiningKings", - "miningsquared": "Mining Squared", - "mmpool": "mmpool", - "mtred": "Mt Red", - "multicoinco": "MultiCoin.co", - "multipool": "Multipool", - "mybtccoinpool": "myBTCcoin Pool", - "neopool": "Neopool", - "nexious": "Nexious", - "nicehash": "NiceHash", - "nmcbit": "NMCbit", - "novablock": "NovaBlock", - "ocean": "OCEAN", - "okexpool": "OKExPool", - "okkong": "OKKONG", - "okminer": "OKMINER", - "okpooltop": "okpool.top", - "onehash": "1Hash", - "onem1x": "1M1X", - "onethash": "1THash", - "ozcoin": "OzCoin", - "parasite": "Parasite", - "patels": "Patels", - "pegapool": "PEGA Pool", - "phashio": "PHash.IO", - "phoenix": "Phoenix", - "polmine": "Polmine", - "pool175btc": "175btc", - "pool50btc": "50BTC", - "poolin": "Poolin", - "portlandhodl": "Portland.HODL", - "publicpool": "Public Pool", - "purebtccom": "PureBTC.COM", - "rawpool": "Rawpool", - "rigpool": "RigPool", - "sbicrypto": "SBI Crypto", - "secpool": "SECPOOL", - "secretsuperstar": "SecretSuperstar", - "sevenpool": "7pool", - "shawnp0wers": "shawnp0wers", - "sigmapoolcom": "Sigmapool.com", - "simplecoinus": "simplecoin.us", - "solock": "Solo CK", - "spiderpool": "SpiderPool", - "stminingcorp": "ST Mining Corp", - "tangpool": "Tangpool", - "tatmaspool": "TATMAS Pool", - "tbdice": "TBDice", - "telco214": "Telco 214", - "terrapool": "Terra Pool", - "tiger": "tiger", - "tigerpoolnet": "tigerpool.net", - "titan": "Titan", - "transactioncoinmining": "transactioncoinmining", - "trickysbtcpool": "Tricky's BTC Pool", - "triplemining": "TripleMining", - "twentyoneinc": "21 Inc.", - "ultimuspool": "ULTIMUSPOOL", - "unknown": "Unknown", - "unomp": "UNOMP", - "viabtc": "ViaBTC", - "waterhole": "Waterhole", - "wayicn": "WAYI.CN", - "whitepool": "WhitePool", - "wk057": "wk057", - "yourbtcnet": "Yourbtc.net", - "zulupool": "Zulupool", + "aaopool": "AAO Pool", + "antpool": "AntPool", + "arkpool": "ArkPool", + "asicminer": "ASICMiner", + "axbt": "A-XBT", + "batpool": "BATPOOL", + "bcmonster": "BCMonster", + "bcpoolio": "bcpool.io", + "binancepool": "Binance Pool", + "bitalo": "Bitalo", + "bitclub": "BitClub", + "bitcoinaffiliatenetwork": "Bitcoin Affiliate Network", + "bitcoincom": "Bitcoin.com", + "bitcoinindia": "Bitcoin India", + "bitcoinrussia": "BitcoinRussia", + "bitcoinukraine": "Bitcoin-Ukraine", + "bitfarms": "Bitfarms", + "bitfufupool": "BitFuFuPool", + "bitfury": "BitFury", + "bitminter": "BitMinter", + "bitparking": "Bitparking", + "bitsolo": "Bitsolo", + "bixin": "Bixin", + "blockfills": "BlockFills", + "braiinspool": "Braiins Pool", + "bravomining": "Bravo Mining", + "btcc": "BTCC", + "btccom": "BTC.com", + "btcdig": "BTCDig", + "btcguild": "BTC Guild", + "btclab": "BTCLab", + "btcmp": "BTCMP", + "btcnuggets": "BTC Nuggets", + "btcpoolparty": "BTC Pool Party", + "btcserv": "BTCServ", + "btctop": "BTC.TOP", + "btpool": "BTPOOL", + "bwpool": "BWPool", + "bytepool": "BytePool", + "canoe": "CANOE", + "canoepool": "CanoePool", + "carbonnegative": "Carbon Negative", + "ckpool": "CKPool", + "cloudhashing": "CloudHashing", + "coinlab": "CoinLab", + "cointerra": "Cointerra", + "connectbtc": "ConnectBTC", + "dcex": "DCEX", + "dcexploration": "DCExploration", + "digitalbtc": "digitalBTC", + "digitalxmintsy": "digitalX Mintsy", + "dpool": "DPOOL", + "eclipsemc": "EclipseMC", + "eightbaochi": "8baochi", + "ekanembtc": "EkanemBTC", + "eligius": "Eligius", + "emcdpool": "EMCDPool", + "entrustcharitypool": "Entrust Charity Pool", + "eobot": "Eobot", + "exxbw": "EXX&BW", + "f2pool": "F2Pool", + "fiftyeightcoin": "58COIN", + "foundryusa": "Foundry USA", + "futurebitapollosolo": "FutureBit Apollo Solo", + "gbminers": "GBMiners", + "ghashio": "GHash.IO", + "givemecoins": "Give Me Coins", + "gogreenlight": "GoGreenLight", + "haominer": "haominer", + "haozhuzhu": "HAOZHUZHU", + "hashbx": "HashBX", + "hashpool": "HASHPOOL", + "helix": "Helix", + "hhtt": "HHTT", + "hotpool": "HotPool", + "hummerpool": "Hummerpool", + "huobipool": "Huobi.pool", + "innopolistech": "Innopolis Tech", + "kanopool": "KanoPool", + "kncminer": "KnCMiner", + "kucoinpool": "KuCoinPool", + "lubiancom": "Lubian.com", + "luckypool": "luckyPool", + "luxor": "Luxor", + "marapool": "MARA Pool", + "maxbtc": "MaxBTC", + "maxipool": "MaxiPool", + "megabigpower": "MegaBigPower", + "minerium": "Minerium", + "miningcity": "MiningCity", + "miningdutch": "Mining-Dutch", + "miningkings": "MiningKings", + "miningsquared": "Mining Squared", + "mmpool": "mmpool", + "mtred": "Mt Red", + "multicoinco": "MultiCoin.co", + "multipool": "Multipool", + "mybtccoinpool": "myBTCcoin Pool", + "neopool": "Neopool", + "nexious": "Nexious", + "nicehash": "NiceHash", + "nmcbit": "NMCbit", + "novablock": "NovaBlock", + "ocean": "OCEAN", + "okexpool": "OKExPool", + "okkong": "OKKONG", + "okminer": "OKMINER", + "okpooltop": "okpool.top", + "onehash": "1Hash", + "onem1x": "1M1X", + "onethash": "1THash", + "ozcoin": "OzCoin", + "parasite": "Parasite", + "patels": "Patels", + "pegapool": "PEGA Pool", + "phashio": "PHash.IO", + "phoenix": "Phoenix", + "polmine": "Polmine", + "pool175btc": "175btc", + "pool50btc": "50BTC", + "poolin": "Poolin", + "portlandhodl": "Portland.HODL", + "publicpool": "Public Pool", + "purebtccom": "PureBTC.COM", + "rawpool": "Rawpool", + "rigpool": "RigPool", + "sbicrypto": "SBI Crypto", + "secpool": "SECPOOL", + "secretsuperstar": "SecretSuperstar", + "sevenpool": "7pool", + "shawnp0wers": "shawnp0wers", + "sigmapoolcom": "Sigmapool.com", + "simplecoinus": "simplecoin.us", + "solock": "Solo CK", + "spiderpool": "SpiderPool", + "stminingcorp": "ST Mining Corp", + "tangpool": "Tangpool", + "tatmaspool": "TATMAS Pool", + "tbdice": "TBDice", + "telco214": "Telco 214", + "terrapool": "Terra Pool", + "tiger": "tiger", + "tigerpoolnet": "tigerpool.net", + "titan": "Titan", + "transactioncoinmining": "transactioncoinmining", + "trickysbtcpool": "Tricky's BTC Pool", + "triplemining": "TripleMining", + "twentyoneinc": "21 Inc.", + "ultimuspool": "ULTIMUSPOOL", + "unknown": "Unknown", + "unomp": "UNOMP", + "viabtc": "ViaBTC", + "waterhole": "Waterhole", + "wayicn": "WAYI.CN", + "whitepool": "WhitePool", + "wk057": "wk057", + "yourbtcnet": "Yourbtc.net", + "zulupool": "Zulupool" } TERM_NAMES = { - "short": {"id": "sth", "short": "STH", "long": "Short Term Holders"}, - "long": {"id": "lth", "short": "LTH", "long": "Long Term Holders"}, + "short": { + "id": "sth", + "short": "STH", + "long": "Short Term Holders" + }, + "long": { + "id": "lth", + "short": "LTH", + "long": "Long Term Holders" + } } EPOCH_NAMES = { - "_0": {"id": "epoch_0", "short": "Epoch 0", "long": "Epoch 0"}, - "_1": {"id": "epoch_1", "short": "Epoch 1", "long": "Epoch 1"}, - "_2": {"id": "epoch_2", "short": "Epoch 2", "long": "Epoch 2"}, - "_3": {"id": "epoch_3", "short": "Epoch 3", "long": "Epoch 3"}, - "_4": {"id": "epoch_4", "short": "Epoch 4", "long": "Epoch 4"}, + "_0": { + "id": "epoch_0", + "short": "Epoch 0", + "long": "Epoch 0" + }, + "_1": { + "id": "epoch_1", + "short": "Epoch 1", + "long": "Epoch 1" + }, + "_2": { + "id": "epoch_2", + "short": "Epoch 2", + "long": "Epoch 2" + }, + "_3": { + "id": "epoch_3", + "short": "Epoch 3", + "long": "Epoch 3" + }, + "_4": { + "id": "epoch_4", + "short": "Epoch 4", + "long": "Epoch 4" + } } YEAR_NAMES = { - "_2009": {"id": "year_2009", "short": "2009", "long": "Year 2009"}, - "_2010": {"id": "year_2010", "short": "2010", "long": "Year 2010"}, - "_2011": {"id": "year_2011", "short": "2011", "long": "Year 2011"}, - "_2012": {"id": "year_2012", "short": "2012", "long": "Year 2012"}, - "_2013": {"id": "year_2013", "short": "2013", "long": "Year 2013"}, - "_2014": {"id": "year_2014", "short": "2014", "long": "Year 2014"}, - "_2015": {"id": "year_2015", "short": "2015", "long": "Year 2015"}, - "_2016": {"id": "year_2016", "short": "2016", "long": "Year 2016"}, - "_2017": {"id": "year_2017", "short": "2017", "long": "Year 2017"}, - "_2018": {"id": "year_2018", "short": "2018", "long": "Year 2018"}, - "_2019": {"id": "year_2019", "short": "2019", "long": "Year 2019"}, - "_2020": {"id": "year_2020", "short": "2020", "long": "Year 2020"}, - "_2021": {"id": "year_2021", "short": "2021", "long": "Year 2021"}, - "_2022": {"id": "year_2022", "short": "2022", "long": "Year 2022"}, - "_2023": {"id": "year_2023", "short": "2023", "long": "Year 2023"}, - "_2024": {"id": "year_2024", "short": "2024", "long": "Year 2024"}, - "_2025": {"id": "year_2025", "short": "2025", "long": "Year 2025"}, - "_2026": {"id": "year_2026", "short": "2026", "long": "Year 2026"}, + "_2009": { + "id": "year_2009", + "short": "2009", + "long": "Year 2009" + }, + "_2010": { + "id": "year_2010", + "short": "2010", + "long": "Year 2010" + }, + "_2011": { + "id": "year_2011", + "short": "2011", + "long": "Year 2011" + }, + "_2012": { + "id": "year_2012", + "short": "2012", + "long": "Year 2012" + }, + "_2013": { + "id": "year_2013", + "short": "2013", + "long": "Year 2013" + }, + "_2014": { + "id": "year_2014", + "short": "2014", + "long": "Year 2014" + }, + "_2015": { + "id": "year_2015", + "short": "2015", + "long": "Year 2015" + }, + "_2016": { + "id": "year_2016", + "short": "2016", + "long": "Year 2016" + }, + "_2017": { + "id": "year_2017", + "short": "2017", + "long": "Year 2017" + }, + "_2018": { + "id": "year_2018", + "short": "2018", + "long": "Year 2018" + }, + "_2019": { + "id": "year_2019", + "short": "2019", + "long": "Year 2019" + }, + "_2020": { + "id": "year_2020", + "short": "2020", + "long": "Year 2020" + }, + "_2021": { + "id": "year_2021", + "short": "2021", + "long": "Year 2021" + }, + "_2022": { + "id": "year_2022", + "short": "2022", + "long": "Year 2022" + }, + "_2023": { + "id": "year_2023", + "short": "2023", + "long": "Year 2023" + }, + "_2024": { + "id": "year_2024", + "short": "2024", + "long": "Year 2024" + }, + "_2025": { + "id": "year_2025", + "short": "2025", + "long": "Year 2025" + }, + "_2026": { + "id": "year_2026", + "short": "2026", + "long": "Year 2026" + } } SPENDABLE_TYPE_NAMES = { - "p2pk65": { - "id": "p2pk65", - "short": "P2PK65", - "long": "Pay to Public Key (65 bytes)", - }, - "p2pk33": { - "id": "p2pk33", - "short": "P2PK33", - "long": "Pay to Public Key (33 bytes)", - }, - "p2pkh": {"id": "p2pkh", "short": "P2PKH", "long": "Pay to Public Key Hash"}, - "p2ms": {"id": "p2ms", "short": "P2MS", "long": "Pay to Multisig"}, - "p2sh": {"id": "p2sh", "short": "P2SH", "long": "Pay to Script Hash"}, - "p2wpkh": { - "id": "p2wpkh", - "short": "P2WPKH", - "long": "Pay to Witness Public Key Hash", - }, - "p2wsh": { - "id": "p2wsh", - "short": "P2WSH", - "long": "Pay to Witness Script Hash", - }, - "p2tr": {"id": "p2tr", "short": "P2TR", "long": "Pay to Taproot"}, - "p2a": {"id": "p2a", "short": "P2A", "long": "Pay to Anchor"}, - "unknown": { - "id": "unknown_outputs", - "short": "Unknown", - "long": "Unknown Output Type", - }, - "empty": {"id": "empty_outputs", "short": "Empty", "long": "Empty Output"}, + "p2pk65": { + "id": "p2pk65", + "short": "P2PK65", + "long": "Pay to Public Key (65 bytes)" + }, + "p2pk33": { + "id": "p2pk33", + "short": "P2PK33", + "long": "Pay to Public Key (33 bytes)" + }, + "p2pkh": { + "id": "p2pkh", + "short": "P2PKH", + "long": "Pay to Public Key Hash" + }, + "p2ms": { + "id": "p2ms", + "short": "P2MS", + "long": "Pay to Multisig" + }, + "p2sh": { + "id": "p2sh", + "short": "P2SH", + "long": "Pay to Script Hash" + }, + "p2wpkh": { + "id": "p2wpkh", + "short": "P2WPKH", + "long": "Pay to Witness Public Key Hash" + }, + "p2wsh": { + "id": "p2wsh", + "short": "P2WSH", + "long": "Pay to Witness Script Hash" + }, + "p2tr": { + "id": "p2tr", + "short": "P2TR", + "long": "Pay to Taproot" + }, + "p2a": { + "id": "p2a", + "short": "P2A", + "long": "Pay to Anchor" + }, + "unknown": { + "id": "unknown_outputs", + "short": "Unknown", + "long": "Unknown Output Type" + }, + "empty": { + "id": "empty_outputs", + "short": "Empty", + "long": "Empty Output" + } } AGE_RANGE_NAMES = { - "up_to_1h": {"id": "up_to_1h_old", "short": "<1h", "long": "Up to 1 Hour Old"}, - "_1h_to_1d": { - "id": "at_least_1h_up_to_1d_old", - "short": "1h-1d", - "long": "1 Hour to 1 Day Old", - }, - "_1d_to_1w": { - "id": "at_least_1d_up_to_1w_old", - "short": "1d-1w", - "long": "1 Day to 1 Week Old", - }, - "_1w_to_1m": { - "id": "at_least_1w_up_to_1m_old", - "short": "1w-1m", - "long": "1 Week to 1 Month Old", - }, - "_1m_to_2m": { - "id": "at_least_1m_up_to_2m_old", - "short": "1m-2m", - "long": "1 to 2 Months Old", - }, - "_2m_to_3m": { - "id": "at_least_2m_up_to_3m_old", - "short": "2m-3m", - "long": "2 to 3 Months Old", - }, - "_3m_to_4m": { - "id": "at_least_3m_up_to_4m_old", - "short": "3m-4m", - "long": "3 to 4 Months Old", - }, - "_4m_to_5m": { - "id": "at_least_4m_up_to_5m_old", - "short": "4m-5m", - "long": "4 to 5 Months Old", - }, - "_5m_to_6m": { - "id": "at_least_5m_up_to_6m_old", - "short": "5m-6m", - "long": "5 to 6 Months Old", - }, - "_6m_to_1y": { - "id": "at_least_6m_up_to_1y_old", - "short": "6m-1y", - "long": "6 Months to 1 Year Old", - }, - "_1y_to_2y": { - "id": "at_least_1y_up_to_2y_old", - "short": "1y-2y", - "long": "1 to 2 Years Old", - }, - "_2y_to_3y": { - "id": "at_least_2y_up_to_3y_old", - "short": "2y-3y", - "long": "2 to 3 Years Old", - }, - "_3y_to_4y": { - "id": "at_least_3y_up_to_4y_old", - "short": "3y-4y", - "long": "3 to 4 Years Old", - }, - "_4y_to_5y": { - "id": "at_least_4y_up_to_5y_old", - "short": "4y-5y", - "long": "4 to 5 Years Old", - }, - "_5y_to_6y": { - "id": "at_least_5y_up_to_6y_old", - "short": "5y-6y", - "long": "5 to 6 Years Old", - }, - "_6y_to_7y": { - "id": "at_least_6y_up_to_7y_old", - "short": "6y-7y", - "long": "6 to 7 Years Old", - }, - "_7y_to_8y": { - "id": "at_least_7y_up_to_8y_old", - "short": "7y-8y", - "long": "7 to 8 Years Old", - }, - "_8y_to_10y": { - "id": "at_least_8y_up_to_10y_old", - "short": "8y-10y", - "long": "8 to 10 Years Old", - }, - "_10y_to_12y": { - "id": "at_least_10y_up_to_12y_old", - "short": "10y-12y", - "long": "10 to 12 Years Old", - }, - "_12y_to_15y": { - "id": "at_least_12y_up_to_15y_old", - "short": "12y-15y", - "long": "12 to 15 Years Old", - }, - "from_15y": { - "id": "at_least_15y_old", - "short": "15y+", - "long": "15+ Years Old", - }, + "up_to_1h": { + "id": "up_to_1h_old", + "short": "<1h", + "long": "Up to 1 Hour Old" + }, + "_1h_to_1d": { + "id": "at_least_1h_up_to_1d_old", + "short": "1h-1d", + "long": "1 Hour to 1 Day Old" + }, + "_1d_to_1w": { + "id": "at_least_1d_up_to_1w_old", + "short": "1d-1w", + "long": "1 Day to 1 Week Old" + }, + "_1w_to_1m": { + "id": "at_least_1w_up_to_1m_old", + "short": "1w-1m", + "long": "1 Week to 1 Month Old" + }, + "_1m_to_2m": { + "id": "at_least_1m_up_to_2m_old", + "short": "1m-2m", + "long": "1 to 2 Months Old" + }, + "_2m_to_3m": { + "id": "at_least_2m_up_to_3m_old", + "short": "2m-3m", + "long": "2 to 3 Months Old" + }, + "_3m_to_4m": { + "id": "at_least_3m_up_to_4m_old", + "short": "3m-4m", + "long": "3 to 4 Months Old" + }, + "_4m_to_5m": { + "id": "at_least_4m_up_to_5m_old", + "short": "4m-5m", + "long": "4 to 5 Months Old" + }, + "_5m_to_6m": { + "id": "at_least_5m_up_to_6m_old", + "short": "5m-6m", + "long": "5 to 6 Months Old" + }, + "_6m_to_1y": { + "id": "at_least_6m_up_to_1y_old", + "short": "6m-1y", + "long": "6 Months to 1 Year Old" + }, + "_1y_to_2y": { + "id": "at_least_1y_up_to_2y_old", + "short": "1y-2y", + "long": "1 to 2 Years Old" + }, + "_2y_to_3y": { + "id": "at_least_2y_up_to_3y_old", + "short": "2y-3y", + "long": "2 to 3 Years Old" + }, + "_3y_to_4y": { + "id": "at_least_3y_up_to_4y_old", + "short": "3y-4y", + "long": "3 to 4 Years Old" + }, + "_4y_to_5y": { + "id": "at_least_4y_up_to_5y_old", + "short": "4y-5y", + "long": "4 to 5 Years Old" + }, + "_5y_to_6y": { + "id": "at_least_5y_up_to_6y_old", + "short": "5y-6y", + "long": "5 to 6 Years Old" + }, + "_6y_to_7y": { + "id": "at_least_6y_up_to_7y_old", + "short": "6y-7y", + "long": "6 to 7 Years Old" + }, + "_7y_to_8y": { + "id": "at_least_7y_up_to_8y_old", + "short": "7y-8y", + "long": "7 to 8 Years Old" + }, + "_8y_to_10y": { + "id": "at_least_8y_up_to_10y_old", + "short": "8y-10y", + "long": "8 to 10 Years Old" + }, + "_10y_to_12y": { + "id": "at_least_10y_up_to_12y_old", + "short": "10y-12y", + "long": "10 to 12 Years Old" + }, + "_12y_to_15y": { + "id": "at_least_12y_up_to_15y_old", + "short": "12y-15y", + "long": "12 to 15 Years Old" + }, + "from_15y": { + "id": "at_least_15y_old", + "short": "15y+", + "long": "15+ Years Old" + } } MAX_AGE_NAMES = { - "_1w": {"id": "up_to_1w_old", "short": "<1w", "long": "Up to 1 Week Old"}, - "_1m": {"id": "up_to_1m_old", "short": "<1m", "long": "Up to 1 Month Old"}, - "_2m": {"id": "up_to_2m_old", "short": "<2m", "long": "Up to 2 Months Old"}, - "_3m": {"id": "up_to_3m_old", "short": "<3m", "long": "Up to 3 Months Old"}, - "_4m": {"id": "up_to_4m_old", "short": "<4m", "long": "Up to 4 Months Old"}, - "_5m": {"id": "up_to_5m_old", "short": "<5m", "long": "Up to 5 Months Old"}, - "_6m": {"id": "up_to_6m_old", "short": "<6m", "long": "Up to 6 Months Old"}, - "_1y": {"id": "up_to_1y_old", "short": "<1y", "long": "Up to 1 Year Old"}, - "_2y": {"id": "up_to_2y_old", "short": "<2y", "long": "Up to 2 Years Old"}, - "_3y": {"id": "up_to_3y_old", "short": "<3y", "long": "Up to 3 Years Old"}, - "_4y": {"id": "up_to_4y_old", "short": "<4y", "long": "Up to 4 Years Old"}, - "_5y": {"id": "up_to_5y_old", "short": "<5y", "long": "Up to 5 Years Old"}, - "_6y": {"id": "up_to_6y_old", "short": "<6y", "long": "Up to 6 Years Old"}, - "_7y": {"id": "up_to_7y_old", "short": "<7y", "long": "Up to 7 Years Old"}, - "_8y": {"id": "up_to_8y_old", "short": "<8y", "long": "Up to 8 Years Old"}, - "_10y": {"id": "up_to_10y_old", "short": "<10y", "long": "Up to 10 Years Old"}, - "_12y": {"id": "up_to_12y_old", "short": "<12y", "long": "Up to 12 Years Old"}, - "_15y": {"id": "up_to_15y_old", "short": "<15y", "long": "Up to 15 Years Old"}, + "_1w": { + "id": "up_to_1w_old", + "short": "<1w", + "long": "Up to 1 Week Old" + }, + "_1m": { + "id": "up_to_1m_old", + "short": "<1m", + "long": "Up to 1 Month Old" + }, + "_2m": { + "id": "up_to_2m_old", + "short": "<2m", + "long": "Up to 2 Months Old" + }, + "_3m": { + "id": "up_to_3m_old", + "short": "<3m", + "long": "Up to 3 Months Old" + }, + "_4m": { + "id": "up_to_4m_old", + "short": "<4m", + "long": "Up to 4 Months Old" + }, + "_5m": { + "id": "up_to_5m_old", + "short": "<5m", + "long": "Up to 5 Months Old" + }, + "_6m": { + "id": "up_to_6m_old", + "short": "<6m", + "long": "Up to 6 Months Old" + }, + "_1y": { + "id": "up_to_1y_old", + "short": "<1y", + "long": "Up to 1 Year Old" + }, + "_2y": { + "id": "up_to_2y_old", + "short": "<2y", + "long": "Up to 2 Years Old" + }, + "_3y": { + "id": "up_to_3y_old", + "short": "<3y", + "long": "Up to 3 Years Old" + }, + "_4y": { + "id": "up_to_4y_old", + "short": "<4y", + "long": "Up to 4 Years Old" + }, + "_5y": { + "id": "up_to_5y_old", + "short": "<5y", + "long": "Up to 5 Years Old" + }, + "_6y": { + "id": "up_to_6y_old", + "short": "<6y", + "long": "Up to 6 Years Old" + }, + "_7y": { + "id": "up_to_7y_old", + "short": "<7y", + "long": "Up to 7 Years Old" + }, + "_8y": { + "id": "up_to_8y_old", + "short": "<8y", + "long": "Up to 8 Years Old" + }, + "_10y": { + "id": "up_to_10y_old", + "short": "<10y", + "long": "Up to 10 Years Old" + }, + "_12y": { + "id": "up_to_12y_old", + "short": "<12y", + "long": "Up to 12 Years Old" + }, + "_15y": { + "id": "up_to_15y_old", + "short": "<15y", + "long": "Up to 15 Years Old" + } } MIN_AGE_NAMES = { - "_1d": {"id": "at_least_1d_old", "short": "1d+", "long": "At Least 1 Day Old"}, - "_1w": {"id": "at_least_1w_old", "short": "1w+", "long": "At Least 1 Week Old"}, - "_1m": { - "id": "at_least_1m_old", - "short": "1m+", - "long": "At Least 1 Month Old", - }, - "_2m": { - "id": "at_least_2m_old", - "short": "2m+", - "long": "At Least 2 Months Old", - }, - "_3m": { - "id": "at_least_3m_old", - "short": "3m+", - "long": "At Least 3 Months Old", - }, - "_4m": { - "id": "at_least_4m_old", - "short": "4m+", - "long": "At Least 4 Months Old", - }, - "_5m": { - "id": "at_least_5m_old", - "short": "5m+", - "long": "At Least 5 Months Old", - }, - "_6m": { - "id": "at_least_6m_old", - "short": "6m+", - "long": "At Least 6 Months Old", - }, - "_1y": {"id": "at_least_1y_old", "short": "1y+", "long": "At Least 1 Year Old"}, - "_2y": { - "id": "at_least_2y_old", - "short": "2y+", - "long": "At Least 2 Years Old", - }, - "_3y": { - "id": "at_least_3y_old", - "short": "3y+", - "long": "At Least 3 Years Old", - }, - "_4y": { - "id": "at_least_4y_old", - "short": "4y+", - "long": "At Least 4 Years Old", - }, - "_5y": { - "id": "at_least_5y_old", - "short": "5y+", - "long": "At Least 5 Years Old", - }, - "_6y": { - "id": "at_least_6y_old", - "short": "6y+", - "long": "At Least 6 Years Old", - }, - "_7y": { - "id": "at_least_7y_old", - "short": "7y+", - "long": "At Least 7 Years Old", - }, - "_8y": { - "id": "at_least_8y_old", - "short": "8y+", - "long": "At Least 8 Years Old", - }, - "_10y": { - "id": "at_least_10y_old", - "short": "10y+", - "long": "At Least 10 Years Old", - }, - "_12y": { - "id": "at_least_12y_old", - "short": "12y+", - "long": "At Least 12 Years Old", - }, + "_1d": { + "id": "at_least_1d_old", + "short": "1d+", + "long": "At Least 1 Day Old" + }, + "_1w": { + "id": "at_least_1w_old", + "short": "1w+", + "long": "At Least 1 Week Old" + }, + "_1m": { + "id": "at_least_1m_old", + "short": "1m+", + "long": "At Least 1 Month Old" + }, + "_2m": { + "id": "at_least_2m_old", + "short": "2m+", + "long": "At Least 2 Months Old" + }, + "_3m": { + "id": "at_least_3m_old", + "short": "3m+", + "long": "At Least 3 Months Old" + }, + "_4m": { + "id": "at_least_4m_old", + "short": "4m+", + "long": "At Least 4 Months Old" + }, + "_5m": { + "id": "at_least_5m_old", + "short": "5m+", + "long": "At Least 5 Months Old" + }, + "_6m": { + "id": "at_least_6m_old", + "short": "6m+", + "long": "At Least 6 Months Old" + }, + "_1y": { + "id": "at_least_1y_old", + "short": "1y+", + "long": "At Least 1 Year Old" + }, + "_2y": { + "id": "at_least_2y_old", + "short": "2y+", + "long": "At Least 2 Years Old" + }, + "_3y": { + "id": "at_least_3y_old", + "short": "3y+", + "long": "At Least 3 Years Old" + }, + "_4y": { + "id": "at_least_4y_old", + "short": "4y+", + "long": "At Least 4 Years Old" + }, + "_5y": { + "id": "at_least_5y_old", + "short": "5y+", + "long": "At Least 5 Years Old" + }, + "_6y": { + "id": "at_least_6y_old", + "short": "6y+", + "long": "At Least 6 Years Old" + }, + "_7y": { + "id": "at_least_7y_old", + "short": "7y+", + "long": "At Least 7 Years Old" + }, + "_8y": { + "id": "at_least_8y_old", + "short": "8y+", + "long": "At Least 8 Years Old" + }, + "_10y": { + "id": "at_least_10y_old", + "short": "10y+", + "long": "At Least 10 Years Old" + }, + "_12y": { + "id": "at_least_12y_old", + "short": "12y+", + "long": "At Least 12 Years Old" + } } AMOUNT_RANGE_NAMES = { - "_0sats": {"id": "with_0sats", "short": "0 sats", "long": "0 Sats"}, - "_1sat_to_10sats": { - "id": "above_1sat_under_10sats", - "short": "1-10 sats", - "long": "1 to 10 Sats", - }, - "_10sats_to_100sats": { - "id": "above_10sats_under_100sats", - "short": "10-100 sats", - "long": "10 to 100 Sats", - }, - "_100sats_to_1k_sats": { - "id": "above_100sats_under_1k_sats", - "short": "100-1k sats", - "long": "100 to 1K Sats", - }, - "_1k_sats_to_10k_sats": { - "id": "above_1k_sats_under_10k_sats", - "short": "1k-10k sats", - "long": "1K to 10K Sats", - }, - "_10k_sats_to_100k_sats": { - "id": "above_10k_sats_under_100k_sats", - "short": "10k-100k sats", - "long": "10K to 100K Sats", - }, - "_100k_sats_to_1m_sats": { - "id": "above_100k_sats_under_1m_sats", - "short": "100k-1M sats", - "long": "100K to 1M Sats", - }, - "_1m_sats_to_10m_sats": { - "id": "above_1m_sats_under_10m_sats", - "short": "1M-10M sats", - "long": "1M to 10M Sats", - }, - "_10m_sats_to_1btc": { - "id": "above_10m_sats_under_1btc", - "short": "0.1-1 BTC", - "long": "0.1 to 1 BTC", - }, - "_1btc_to_10btc": { - "id": "above_1btc_under_10btc", - "short": "1-10 BTC", - "long": "1 to 10 BTC", - }, - "_10btc_to_100btc": { - "id": "above_10btc_under_100btc", - "short": "10-100 BTC", - "long": "10 to 100 BTC", - }, - "_100btc_to_1k_btc": { - "id": "above_100btc_under_1k_btc", - "short": "100-1k BTC", - "long": "100 to 1K BTC", - }, - "_1k_btc_to_10k_btc": { - "id": "above_1k_btc_under_10k_btc", - "short": "1k-10k BTC", - "long": "1K to 10K BTC", - }, - "_10k_btc_to_100k_btc": { - "id": "above_10k_btc_under_100k_btc", - "short": "10k-100k BTC", - "long": "10K to 100K BTC", - }, - "_100k_btc_or_more": { - "id": "above_100k_btc", - "short": "100k+ BTC", - "long": "100K+ BTC", - }, + "_0sats": { + "id": "with_0sats", + "short": "0 sats", + "long": "0 Sats" + }, + "_1sat_to_10sats": { + "id": "above_1sat_under_10sats", + "short": "1-10 sats", + "long": "1 to 10 Sats" + }, + "_10sats_to_100sats": { + "id": "above_10sats_under_100sats", + "short": "10-100 sats", + "long": "10 to 100 Sats" + }, + "_100sats_to_1k_sats": { + "id": "above_100sats_under_1k_sats", + "short": "100-1k sats", + "long": "100 to 1K Sats" + }, + "_1k_sats_to_10k_sats": { + "id": "above_1k_sats_under_10k_sats", + "short": "1k-10k sats", + "long": "1K to 10K Sats" + }, + "_10k_sats_to_100k_sats": { + "id": "above_10k_sats_under_100k_sats", + "short": "10k-100k sats", + "long": "10K to 100K Sats" + }, + "_100k_sats_to_1m_sats": { + "id": "above_100k_sats_under_1m_sats", + "short": "100k-1M sats", + "long": "100K to 1M Sats" + }, + "_1m_sats_to_10m_sats": { + "id": "above_1m_sats_under_10m_sats", + "short": "1M-10M sats", + "long": "1M to 10M Sats" + }, + "_10m_sats_to_1btc": { + "id": "above_10m_sats_under_1btc", + "short": "0.1-1 BTC", + "long": "0.1 to 1 BTC" + }, + "_1btc_to_10btc": { + "id": "above_1btc_under_10btc", + "short": "1-10 BTC", + "long": "1 to 10 BTC" + }, + "_10btc_to_100btc": { + "id": "above_10btc_under_100btc", + "short": "10-100 BTC", + "long": "10 to 100 BTC" + }, + "_100btc_to_1k_btc": { + "id": "above_100btc_under_1k_btc", + "short": "100-1k BTC", + "long": "100 to 1K BTC" + }, + "_1k_btc_to_10k_btc": { + "id": "above_1k_btc_under_10k_btc", + "short": "1k-10k BTC", + "long": "1K to 10K BTC" + }, + "_10k_btc_to_100k_btc": { + "id": "above_10k_btc_under_100k_btc", + "short": "10k-100k BTC", + "long": "10K to 100K BTC" + }, + "_100k_btc_or_more": { + "id": "above_100k_btc", + "short": "100k+ BTC", + "long": "100K+ BTC" + } } GE_AMOUNT_NAMES = { - "_1sat": {"id": "above_1sat", "short": "1+ sats", "long": "Above 1 Sat"}, - "_10sats": {"id": "above_10sats", "short": "10+ sats", "long": "Above 10 Sats"}, - "_100sats": { - "id": "above_100sats", - "short": "100+ sats", - "long": "Above 100 Sats", - }, - "_1k_sats": { - "id": "above_1k_sats", - "short": "1k+ sats", - "long": "Above 1K Sats", - }, - "_10k_sats": { - "id": "above_10k_sats", - "short": "10k+ sats", - "long": "Above 10K Sats", - }, - "_100k_sats": { - "id": "above_100k_sats", - "short": "100k+ sats", - "long": "Above 100K Sats", - }, - "_1m_sats": { - "id": "above_1m_sats", - "short": "1M+ sats", - "long": "Above 1M Sats", - }, - "_10m_sats": { - "id": "above_10m_sats", - "short": "0.1+ BTC", - "long": "Above 0.1 BTC", - }, - "_1btc": {"id": "above_1btc", "short": "1+ BTC", "long": "Above 1 BTC"}, - "_10btc": {"id": "above_10btc", "short": "10+ BTC", "long": "Above 10 BTC"}, - "_100btc": {"id": "above_100btc", "short": "100+ BTC", "long": "Above 100 BTC"}, - "_1k_btc": {"id": "above_1k_btc", "short": "1k+ BTC", "long": "Above 1K BTC"}, - "_10k_btc": { - "id": "above_10k_btc", - "short": "10k+ BTC", - "long": "Above 10K BTC", - }, + "_1sat": { + "id": "above_1sat", + "short": "1+ sats", + "long": "Above 1 Sat" + }, + "_10sats": { + "id": "above_10sats", + "short": "10+ sats", + "long": "Above 10 Sats" + }, + "_100sats": { + "id": "above_100sats", + "short": "100+ sats", + "long": "Above 100 Sats" + }, + "_1k_sats": { + "id": "above_1k_sats", + "short": "1k+ sats", + "long": "Above 1K Sats" + }, + "_10k_sats": { + "id": "above_10k_sats", + "short": "10k+ sats", + "long": "Above 10K Sats" + }, + "_100k_sats": { + "id": "above_100k_sats", + "short": "100k+ sats", + "long": "Above 100K Sats" + }, + "_1m_sats": { + "id": "above_1m_sats", + "short": "1M+ sats", + "long": "Above 1M Sats" + }, + "_10m_sats": { + "id": "above_10m_sats", + "short": "0.1+ BTC", + "long": "Above 0.1 BTC" + }, + "_1btc": { + "id": "above_1btc", + "short": "1+ BTC", + "long": "Above 1 BTC" + }, + "_10btc": { + "id": "above_10btc", + "short": "10+ BTC", + "long": "Above 10 BTC" + }, + "_100btc": { + "id": "above_100btc", + "short": "100+ BTC", + "long": "Above 100 BTC" + }, + "_1k_btc": { + "id": "above_1k_btc", + "short": "1k+ BTC", + "long": "Above 1K BTC" + }, + "_10k_btc": { + "id": "above_10k_btc", + "short": "10k+ BTC", + "long": "Above 10K BTC" + } } LT_AMOUNT_NAMES = { - "_10sats": {"id": "under_10sats", "short": "<10 sats", "long": "Under 10 Sats"}, - "_100sats": { - "id": "under_100sats", - "short": "<100 sats", - "long": "Under 100 Sats", - }, - "_1k_sats": { - "id": "under_1k_sats", - "short": "<1k sats", - "long": "Under 1K Sats", - }, - "_10k_sats": { - "id": "under_10k_sats", - "short": "<10k sats", - "long": "Under 10K Sats", - }, - "_100k_sats": { - "id": "under_100k_sats", - "short": "<100k sats", - "long": "Under 100K Sats", - }, - "_1m_sats": { - "id": "under_1m_sats", - "short": "<1M sats", - "long": "Under 1M Sats", - }, - "_10m_sats": { - "id": "under_10m_sats", - "short": "<0.1 BTC", - "long": "Under 0.1 BTC", - }, - "_1btc": {"id": "under_1btc", "short": "<1 BTC", "long": "Under 1 BTC"}, - "_10btc": {"id": "under_10btc", "short": "<10 BTC", "long": "Under 10 BTC"}, - "_100btc": {"id": "under_100btc", "short": "<100 BTC", "long": "Under 100 BTC"}, - "_1k_btc": {"id": "under_1k_btc", "short": "<1k BTC", "long": "Under 1K BTC"}, - "_10k_btc": { - "id": "under_10k_btc", - "short": "<10k BTC", - "long": "Under 10K BTC", - }, - "_100k_btc": { - "id": "under_100k_btc", - "short": "<100k BTC", - "long": "Under 100K BTC", - }, + "_10sats": { + "id": "under_10sats", + "short": "<10 sats", + "long": "Under 10 Sats" + }, + "_100sats": { + "id": "under_100sats", + "short": "<100 sats", + "long": "Under 100 Sats" + }, + "_1k_sats": { + "id": "under_1k_sats", + "short": "<1k sats", + "long": "Under 1K Sats" + }, + "_10k_sats": { + "id": "under_10k_sats", + "short": "<10k sats", + "long": "Under 10K Sats" + }, + "_100k_sats": { + "id": "under_100k_sats", + "short": "<100k sats", + "long": "Under 100K Sats" + }, + "_1m_sats": { + "id": "under_1m_sats", + "short": "<1M sats", + "long": "Under 1M Sats" + }, + "_10m_sats": { + "id": "under_10m_sats", + "short": "<0.1 BTC", + "long": "Under 0.1 BTC" + }, + "_1btc": { + "id": "under_1btc", + "short": "<1 BTC", + "long": "Under 1 BTC" + }, + "_10btc": { + "id": "under_10btc", + "short": "<10 BTC", + "long": "Under 10 BTC" + }, + "_100btc": { + "id": "under_100btc", + "short": "<100 BTC", + "long": "Under 100 BTC" + }, + "_1k_btc": { + "id": "under_1k_btc", + "short": "<1k BTC", + "long": "Under 1K BTC" + }, + "_10k_btc": { + "id": "under_10k_btc", + "short": "<10k BTC", + "long": "Under 10K BTC" + }, + "_100k_btc": { + "id": "under_100k_btc", + "short": "<100k BTC", + "long": "Under 100K BTC" + } } - def __init__(self, base_url: str = "http://localhost:3000", timeout: float = 30.0): + def __init__(self, base_url: str = 'http://localhost:3000', timeout: float = 30.0): super().__init__(base_url, timeout) self.metrics = MetricsTree(self) @@ -7228,14 +5436,9 @@ class BrkClient(BrkClientBase): *[Mempool.space docs](https://mempool.space/docs/api/rest#get-address)* Endpoint: `GET /api/address/{address}`""" - return self.get_json(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. @@ -7244,20 +5447,13 @@ class BrkClient(BrkClientBase): Endpoint: `GET /api/address/{address}/txs`""" params = [] - if after_txid is not None: - params.append(f"after_txid={after_txid}") - if limit is not None: - params.append(f"limit={limit}") - query = "&".join(params) - path = f"/api/address/{address}/txs{'?' + query if query else ''}" + if after_txid is not None: params.append(f'after_txid={after_txid}') + if limit is not None: params.append(f'limit={limit}') + query = '&'.join(params) + path = f'/api/address/{address}/txs{"?" + query if query else ""}' return self.get_json(path) - def get_address_confirmed_txs( - self, - address: Address, - after_txid: Optional[str] = None, - limit: Optional[float] = None, - ) -> List[Txid]: + def get_address_confirmed_txs(self, address: Address, after_txid: Optional[str] = None, limit: Optional[float] = None) -> List[Txid]: """Address confirmed transactions. Get confirmed transaction IDs for an address, 25 per page. Use ?after_txid= for pagination. @@ -7266,12 +5462,10 @@ class BrkClient(BrkClientBase): Endpoint: `GET /api/address/{address}/txs/chain`""" params = [] - if after_txid is not None: - params.append(f"after_txid={after_txid}") - if limit is not None: - params.append(f"limit={limit}") - query = "&".join(params) - path = f"/api/address/{address}/txs/chain{'?' + query if query else ''}" + if after_txid is not None: params.append(f'after_txid={after_txid}') + if limit is not None: params.append(f'limit={limit}') + query = '&'.join(params) + path = f'/api/address/{address}/txs/chain{"?" + query if query else ""}' return self.get_json(path) def get_address_mempool_txs(self, address: Address) -> List[Txid]: @@ -7282,7 +5476,7 @@ class BrkClient(BrkClientBase): *[Mempool.space docs](https://mempool.space/docs/api/rest#get-address-transactions-mempool)* Endpoint: `GET /api/address/{address}/txs/mempool`""" - return self.get_json(f"/api/address/{address}/txs/mempool") + return self.get_json(f'/api/address/{address}/txs/mempool') def get_address_utxos(self, address: Address) -> List[Utxo]: """Address UTXOs. @@ -7292,7 +5486,7 @@ class BrkClient(BrkClientBase): *[Mempool.space docs](https://mempool.space/docs/api/rest#get-address-utxo)* Endpoint: `GET /api/address/{address}/utxo`""" - return self.get_json(f"/api/address/{address}/utxo") + return self.get_json(f'/api/address/{address}/utxo') def get_block_by_height(self, height: Height) -> BlockInfo: """Block by height. @@ -7302,7 +5496,7 @@ class BrkClient(BrkClientBase): *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-height)* Endpoint: `GET /api/block-height/{height}`""" - return self.get_json(f"/api/block-height/{height}") + return self.get_json(f'/api/block-height/{height}') def get_block(self, hash: BlockHash) -> BlockInfo: """Block information. @@ -7312,7 +5506,7 @@ class BrkClient(BrkClientBase): *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block)* Endpoint: `GET /api/block/{hash}`""" - return self.get_json(f"/api/block/{hash}") + return self.get_json(f'/api/block/{hash}') def get_block_raw(self, hash: BlockHash) -> List[float]: """Raw block. @@ -7322,7 +5516,7 @@ class BrkClient(BrkClientBase): *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-raw)* Endpoint: `GET /api/block/{hash}/raw`""" - return self.get_json(f"/api/block/{hash}/raw") + return self.get_json(f'/api/block/{hash}/raw') def get_block_status(self, hash: BlockHash) -> BlockStatus: """Block status. @@ -7332,7 +5526,7 @@ class BrkClient(BrkClientBase): *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-status)* Endpoint: `GET /api/block/{hash}/status`""" - return self.get_json(f"/api/block/{hash}/status") + return self.get_json(f'/api/block/{hash}/status') def get_block_txid(self, hash: BlockHash, index: TxIndex) -> Txid: """Transaction ID at index. @@ -7342,7 +5536,7 @@ class BrkClient(BrkClientBase): *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-transaction-id)* Endpoint: `GET /api/block/{hash}/txid/{index}`""" - return self.get_json(f"/api/block/{hash}/txid/{index}") + return self.get_json(f'/api/block/{hash}/txid/{index}') def get_block_txids(self, hash: BlockHash) -> List[Txid]: """Block transaction IDs. @@ -7352,7 +5546,7 @@ class BrkClient(BrkClientBase): *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-transaction-ids)* Endpoint: `GET /api/block/{hash}/txids`""" - return self.get_json(f"/api/block/{hash}/txids") + return self.get_json(f'/api/block/{hash}/txids') def get_block_txs(self, hash: BlockHash, start_index: TxIndex) -> List[Transaction]: """Block transactions (paginated). @@ -7362,7 +5556,7 @@ class BrkClient(BrkClientBase): *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-transactions)* Endpoint: `GET /api/block/{hash}/txs/{start_index}`""" - return self.get_json(f"/api/block/{hash}/txs/{start_index}") + return self.get_json(f'/api/block/{hash}/txs/{start_index}') def get_blocks(self) -> List[BlockInfo]: """Recent blocks. @@ -7372,7 +5566,7 @@ class BrkClient(BrkClientBase): *[Mempool.space docs](https://mempool.space/docs/api/rest#get-blocks)* Endpoint: `GET /api/blocks`""" - return self.get_json("/api/blocks") + return self.get_json('/api/blocks') def get_blocks_from_height(self, height: Height) -> List[BlockInfo]: """Blocks from height. @@ -7382,7 +5576,7 @@ class BrkClient(BrkClientBase): *[Mempool.space docs](https://mempool.space/docs/api/rest#get-blocks)* Endpoint: `GET /api/blocks/{height}`""" - return self.get_json(f"/api/blocks/{height}") + return self.get_json(f'/api/blocks/{height}') def get_mempool(self) -> MempoolInfo: """Mempool statistics. @@ -7392,7 +5586,7 @@ class BrkClient(BrkClientBase): *[Mempool.space docs](https://mempool.space/docs/api/rest#get-mempool)* Endpoint: `GET /api/mempool/info`""" - return self.get_json("/api/mempool/info") + return self.get_json('/api/mempool/info') def get_mempool_txids(self) -> List[Txid]: """Mempool transaction IDs. @@ -7402,7 +5596,7 @@ class BrkClient(BrkClientBase): *[Mempool.space docs](https://mempool.space/docs/api/rest#get-mempool-transaction-ids)* Endpoint: `GET /api/mempool/txids`""" - return self.get_json("/api/mempool/txids") + return self.get_json('/api/mempool/txids') def get_metric_info(self, metric: Metric) -> List[Index]: """Get supported indexes for a metric. @@ -7410,34 +5604,22 @@ class BrkClient(BrkClientBase): Returns the list of indexes supported by the specified metric. For example, `realized_price` might be available on dateindex, weekindex, and monthindex. Endpoint: `GET /api/metric/{metric}`""" - return self.get_json(f"/api/metric/{metric}") + return self.get_json(f'/api/metric/{metric}') - def get_metric( - self, - metric: Metric, - index: Index, - start: Optional[float] = None, - end: Optional[float] = None, - limit: Optional[str] = None, - format: Optional[Format] = None, - ) -> Union[AnyMetricData, str]: + def get_metric(self, metric: Metric, index: Index, start: Optional[float] = None, end: Optional[float] = None, limit: Optional[str] = None, format: Optional[Format] = None) -> Union[AnyMetricData, str]: """Get metric data. Fetch data for a specific metric at the given index. Use query parameters to filter by date range and format (json/csv). Endpoint: `GET /api/metric/{metric}/{index}`""" params = [] - if start is not None: - params.append(f"start={start}") - if end is not None: - params.append(f"end={end}") - if limit is not None: - params.append(f"limit={limit}") - if format is not None: - params.append(f"format={format}") - query = "&".join(params) - path = f"/api/metric/{metric}/{index}{'?' + query if query else ''}" - if format == "csv": + if start is not None: params.append(f'start={start}') + if end is not None: params.append(f'end={end}') + if limit is not None: params.append(f'limit={limit}') + if format is not None: params.append(f'format={format}') + query = '&'.join(params) + path = f'/api/metric/{metric}/{index}{"?" + query if query else ""}' + if format == 'csv': return self.get_text(path) return self.get_json(path) @@ -7447,36 +5629,24 @@ class BrkClient(BrkClientBase): Returns the complete hierarchical catalog of available metrics organized as a tree structure. Metrics are grouped by categories and subcategories. Endpoint: `GET /api/metrics`""" - return self.get_json("/api/metrics") + return self.get_json('/api/metrics') - def get_metrics( - self, - metrics: Metrics, - index: Index, - start: Optional[float] = None, - end: Optional[float] = None, - limit: Optional[str] = None, - format: Optional[Format] = None, - ) -> Union[List[AnyMetricData], str]: + def get_metrics(self, metrics: Metrics, index: Index, start: Optional[float] = None, end: Optional[float] = None, limit: Optional[str] = None, format: Optional[Format] = None) -> Union[List[AnyMetricData], str]: """Bulk metric data. Fetch multiple metrics in a single request. Supports filtering by index and date range. Returns an array of MetricData objects. For a single metric, use `get_metric` instead. Endpoint: `GET /api/metrics/bulk`""" params = [] - params.append(f"metrics={metrics}") - params.append(f"index={index}") - if start is not None: - params.append(f"start={start}") - if end is not None: - params.append(f"end={end}") - if limit is not None: - params.append(f"limit={limit}") - if format is not None: - params.append(f"format={format}") - query = "&".join(params) - path = f"/api/metrics/bulk{'?' + query if query else ''}" - if format == "csv": + params.append(f'metrics={metrics}') + params.append(f'index={index}') + if start is not None: params.append(f'start={start}') + if end is not None: params.append(f'end={end}') + if limit is not None: params.append(f'limit={limit}') + if format is not None: params.append(f'format={format}') + query = '&'.join(params) + path = f'/api/metrics/bulk{"?" + query if query else ""}' + if format == 'csv': return self.get_text(path) return self.get_json(path) @@ -7486,7 +5656,7 @@ class BrkClient(BrkClientBase): Returns the number of metrics available per index type. Endpoint: `GET /api/metrics/count`""" - return self.get_json("/api/metrics/count") + return self.get_json('/api/metrics/count') def get_indexes(self) -> List[IndexInfo]: """List available indexes. @@ -7494,7 +5664,7 @@ class BrkClient(BrkClientBase): Returns all available indexes with their accepted query aliases. Use any alias when querying metrics. Endpoint: `GET /api/metrics/indexes`""" - return self.get_json("/api/metrics/indexes") + return self.get_json('/api/metrics/indexes') def list_metrics(self, page: Optional[float] = None) -> PaginatedMetrics: """Metrics list. @@ -7503,25 +5673,21 @@ class BrkClient(BrkClientBase): Endpoint: `GET /api/metrics/list`""" params = [] - if page is not None: - params.append(f"page={page}") - query = "&".join(params) - path = f"/api/metrics/list{'?' + query if query else ''}" + if page is not None: params.append(f'page={page}') + query = '&'.join(params) + path = f'/api/metrics/list{"?" + query if query else ""}' return self.get_json(path) - def search_metrics( - self, metric: Metric, limit: Optional[Limit] = None - ) -> List[Metric]: + def search_metrics(self, metric: Metric, limit: Optional[Limit] = None) -> List[Metric]: """Search metrics. Fuzzy search for metrics by name. Supports partial matches and typos. Endpoint: `GET /api/metrics/search/{metric}`""" params = [] - if limit is not None: - params.append(f"limit={limit}") - query = "&".join(params) - path = f"/api/metrics/search/{metric}{'?' + query if query else ''}" + if limit is not None: params.append(f'limit={limit}') + query = '&'.join(params) + path = f'/api/metrics/search/{metric}{"?" + query if query else ""}' return self.get_json(path) def get_disk_usage(self) -> DiskUsage: @@ -7530,7 +5696,7 @@ class BrkClient(BrkClientBase): Returns the disk space used by BRK and Bitcoin data. Endpoint: `GET /api/server/disk`""" - return self.get_json("/api/server/disk") + return self.get_json('/api/server/disk') def get_sync_status(self) -> SyncStatus: """Sync status. @@ -7538,7 +5704,7 @@ class BrkClient(BrkClientBase): Returns the sync status of the indexer, including indexed height, tip height, blocks behind, and last indexed timestamp. Endpoint: `GET /api/server/sync`""" - return self.get_json("/api/server/sync") + return self.get_json('/api/server/sync') def get_tx(self, txid: Txid) -> Transaction: """Transaction information. @@ -7548,7 +5714,7 @@ class BrkClient(BrkClientBase): *[Mempool.space docs](https://mempool.space/docs/api/rest#get-transaction)* Endpoint: `GET /api/tx/{txid}`""" - return self.get_json(f"/api/tx/{txid}") + return self.get_json(f'/api/tx/{txid}') def get_tx_hex(self, txid: Txid) -> Hex: """Transaction hex. @@ -7558,7 +5724,7 @@ class BrkClient(BrkClientBase): *[Mempool.space docs](https://mempool.space/docs/api/rest#get-transaction-hex)* Endpoint: `GET /api/tx/{txid}/hex`""" - return self.get_json(f"/api/tx/{txid}/hex") + return self.get_json(f'/api/tx/{txid}/hex') def get_tx_outspend(self, txid: Txid, vout: Vout) -> TxOutspend: """Output spend status. @@ -7568,7 +5734,7 @@ class BrkClient(BrkClientBase): *[Mempool.space docs](https://mempool.space/docs/api/rest#get-transaction-outspend)* Endpoint: `GET /api/tx/{txid}/outspend/{vout}`""" - return self.get_json(f"/api/tx/{txid}/outspend/{vout}") + return self.get_json(f'/api/tx/{txid}/outspend/{vout}') def get_tx_outspends(self, txid: Txid) -> List[TxOutspend]: """All output spend statuses. @@ -7578,7 +5744,7 @@ class BrkClient(BrkClientBase): *[Mempool.space docs](https://mempool.space/docs/api/rest#get-transaction-outspends)* Endpoint: `GET /api/tx/{txid}/outspends`""" - return self.get_json(f"/api/tx/{txid}/outspends") + return self.get_json(f'/api/tx/{txid}/outspends') def get_tx_status(self, txid: Txid) -> TxStatus: """Transaction status. @@ -7588,7 +5754,7 @@ class BrkClient(BrkClientBase): *[Mempool.space docs](https://mempool.space/docs/api/rest#get-transaction-status)* Endpoint: `GET /api/tx/{txid}/status`""" - return self.get_json(f"/api/tx/{txid}/status") + return self.get_json(f'/api/tx/{txid}/status') def get_difficulty_adjustment(self) -> DifficultyAdjustment: """Difficulty adjustment. @@ -7598,7 +5764,7 @@ class BrkClient(BrkClientBase): *[Mempool.space docs](https://mempool.space/docs/api/rest#get-difficulty-adjustment)* Endpoint: `GET /api/v1/difficulty-adjustment`""" - return self.get_json("/api/v1/difficulty-adjustment") + return self.get_json('/api/v1/difficulty-adjustment') def get_mempool_blocks(self) -> List[MempoolBlock]: """Projected mempool blocks. @@ -7608,7 +5774,7 @@ class BrkClient(BrkClientBase): *[Mempool.space docs](https://mempool.space/docs/api/rest#get-mempool-blocks-fees)* Endpoint: `GET /api/v1/fees/mempool-blocks`""" - return self.get_json("/api/v1/fees/mempool-blocks") + return self.get_json('/api/v1/fees/mempool-blocks') def get_recommended_fees(self) -> RecommendedFees: """Recommended fees. @@ -7618,7 +5784,7 @@ class BrkClient(BrkClientBase): *[Mempool.space docs](https://mempool.space/docs/api/rest#get-recommended-fees)* Endpoint: `GET /api/v1/fees/recommended`""" - return self.get_json("/api/v1/fees/recommended") + return self.get_json('/api/v1/fees/recommended') def get_block_fee_rates(self, time_period: TimePeriod) -> Any: """Block fee rates (WIP). @@ -7628,7 +5794,7 @@ class BrkClient(BrkClientBase): *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-feerates)* Endpoint: `GET /api/v1/mining/blocks/fee-rates/{time_period}`""" - return self.get_json(f"/api/v1/mining/blocks/fee-rates/{time_period}") + return self.get_json(f'/api/v1/mining/blocks/fee-rates/{time_period}') def get_block_fees(self, time_period: TimePeriod) -> List[BlockFeesEntry]: """Block fees. @@ -7638,7 +5804,7 @@ class BrkClient(BrkClientBase): *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-fees)* Endpoint: `GET /api/v1/mining/blocks/fees/{time_period}`""" - return self.get_json(f"/api/v1/mining/blocks/fees/{time_period}") + return self.get_json(f'/api/v1/mining/blocks/fees/{time_period}') def get_block_rewards(self, time_period: TimePeriod) -> List[BlockRewardsEntry]: """Block rewards. @@ -7648,7 +5814,7 @@ class BrkClient(BrkClientBase): *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-rewards)* Endpoint: `GET /api/v1/mining/blocks/rewards/{time_period}`""" - return self.get_json(f"/api/v1/mining/blocks/rewards/{time_period}") + return self.get_json(f'/api/v1/mining/blocks/rewards/{time_period}') def get_block_sizes_weights(self, time_period: TimePeriod) -> BlockSizesWeights: """Block sizes and weights. @@ -7658,7 +5824,7 @@ class BrkClient(BrkClientBase): *[Mempool.space docs](https://mempool.space/docs/api/rest#get-sizes-weights)* Endpoint: `GET /api/v1/mining/blocks/sizes-weights/{time_period}`""" - return self.get_json(f"/api/v1/mining/blocks/sizes-weights/{time_period}") + return self.get_json(f'/api/v1/mining/blocks/sizes-weights/{time_period}') def get_block_by_timestamp(self, timestamp: Timestamp) -> BlockTimestamp: """Block by timestamp. @@ -7668,7 +5834,7 @@ class BrkClient(BrkClientBase): *[Mempool.space docs](https://mempool.space/docs/api/rest#get-block-timestamp)* Endpoint: `GET /api/v1/mining/blocks/timestamp/{timestamp}`""" - return self.get_json(f"/api/v1/mining/blocks/timestamp/{timestamp}") + return self.get_json(f'/api/v1/mining/blocks/timestamp/{timestamp}') def get_difficulty_adjustments(self) -> List[DifficultyAdjustmentEntry]: """Difficulty adjustments (all time). @@ -7678,11 +5844,9 @@ class BrkClient(BrkClientBase): *[Mempool.space docs](https://mempool.space/docs/api/rest#get-difficulty-adjustments)* Endpoint: `GET /api/v1/mining/difficulty-adjustments`""" - return self.get_json("/api/v1/mining/difficulty-adjustments") + return self.get_json('/api/v1/mining/difficulty-adjustments') - def get_difficulty_adjustments_by_period( - self, time_period: TimePeriod - ) -> List[DifficultyAdjustmentEntry]: + def get_difficulty_adjustments_by_period(self, time_period: TimePeriod) -> List[DifficultyAdjustmentEntry]: """Difficulty adjustments. Get historical difficulty adjustments for a time period. Valid periods: 24h, 3d, 1w, 1m, 3m, 6m, 1y, 2y, 3y. @@ -7690,7 +5854,7 @@ class BrkClient(BrkClientBase): *[Mempool.space docs](https://mempool.space/docs/api/rest#get-difficulty-adjustments)* Endpoint: `GET /api/v1/mining/difficulty-adjustments/{time_period}`""" - return self.get_json(f"/api/v1/mining/difficulty-adjustments/{time_period}") + return self.get_json(f'/api/v1/mining/difficulty-adjustments/{time_period}') def get_hashrate(self) -> HashrateSummary: """Network hashrate (all time). @@ -7700,7 +5864,7 @@ class BrkClient(BrkClientBase): *[Mempool.space docs](https://mempool.space/docs/api/rest#get-hashrate)* Endpoint: `GET /api/v1/mining/hashrate`""" - return self.get_json("/api/v1/mining/hashrate") + return self.get_json('/api/v1/mining/hashrate') def get_hashrate_by_period(self, time_period: TimePeriod) -> HashrateSummary: """Network hashrate. @@ -7710,7 +5874,7 @@ class BrkClient(BrkClientBase): *[Mempool.space docs](https://mempool.space/docs/api/rest#get-hashrate)* Endpoint: `GET /api/v1/mining/hashrate/{time_period}`""" - return self.get_json(f"/api/v1/mining/hashrate/{time_period}") + return self.get_json(f'/api/v1/mining/hashrate/{time_period}') def get_pool(self, slug: PoolSlug) -> PoolDetail: """Mining pool details. @@ -7720,7 +5884,7 @@ class BrkClient(BrkClientBase): *[Mempool.space docs](https://mempool.space/docs/api/rest#get-mining-pool)* Endpoint: `GET /api/v1/mining/pool/{slug}`""" - return self.get_json(f"/api/v1/mining/pool/{slug}") + return self.get_json(f'/api/v1/mining/pool/{slug}') def get_pools(self) -> List[PoolInfo]: """List all mining pools. @@ -7730,7 +5894,7 @@ class BrkClient(BrkClientBase): *[Mempool.space docs](https://mempool.space/docs/api/rest#get-mining-pools)* Endpoint: `GET /api/v1/mining/pools`""" - return self.get_json("/api/v1/mining/pools") + return self.get_json('/api/v1/mining/pools') def get_pool_stats(self, time_period: TimePeriod) -> PoolsSummary: """Mining pool statistics. @@ -7740,7 +5904,7 @@ class BrkClient(BrkClientBase): *[Mempool.space docs](https://mempool.space/docs/api/rest#get-mining-pools)* Endpoint: `GET /api/v1/mining/pools/{time_period}`""" - return self.get_json(f"/api/v1/mining/pools/{time_period}") + return self.get_json(f'/api/v1/mining/pools/{time_period}') def get_reward_stats(self, block_count: float) -> RewardStats: """Mining reward statistics. @@ -7750,7 +5914,7 @@ class BrkClient(BrkClientBase): *[Mempool.space docs](https://mempool.space/docs/api/rest#get-reward-stats)* Endpoint: `GET /api/v1/mining/reward-stats/{block_count}`""" - return self.get_json(f"/api/v1/mining/reward-stats/{block_count}") + return self.get_json(f'/api/v1/mining/reward-stats/{block_count}') def validate_address(self, address: str) -> AddressValidation: """Validate address. @@ -7760,7 +5924,7 @@ class BrkClient(BrkClientBase): *[Mempool.space docs](https://mempool.space/docs/api/rest#get-address-validate)* Endpoint: `GET /api/v1/validate-address/{address}`""" - return self.get_json(f"/api/v1/validate-address/{address}") + return self.get_json(f'/api/v1/validate-address/{address}') def get_health(self) -> Health: """Health check. @@ -7768,7 +5932,7 @@ class BrkClient(BrkClientBase): Returns the health status of the API server, including uptime information. Endpoint: `GET /health`""" - return self.get_json("/health") + return self.get_json('/health') def get_version(self) -> str: """API version. @@ -7776,4 +5940,5 @@ class BrkClient(BrkClientBase): Returns the current version of the API server Endpoint: `GET /version`""" - return self.get_json("/version") + return self.get_json('/version') +