diff --git a/Cargo.lock b/Cargo.lock index f4b93dd31..8a7812a2e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -30,15 +30,15 @@ dependencies = [ [[package]] name = "ahash" -version = "0.8.11" +version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" dependencies = [ "cfg-if", - "getrandom 0.2.16", + "getrandom 0.3.3", "once_cell", "version_check", - "zerocopy 0.7.35", + "zerocopy", ] [[package]] @@ -455,8 +455,8 @@ dependencies = [ "serde", "serde_bytes", "serde_derive", - "zerocopy 0.8.25", - "zerocopy-derive 0.8.25", + "zerocopy", + "zerocopy-derive", ] [[package]] @@ -497,7 +497,7 @@ dependencies = [ "fjall", "log", "rayon", - "zerocopy 0.8.25", + "zerocopy", ] [[package]] @@ -522,7 +522,7 @@ dependencies = [ "rayon", "serde", "serde_json", - "zerocopy 0.8.25", + "zerocopy", ] [[package]] @@ -584,8 +584,8 @@ dependencies = [ "rayon", "serde", "serde_json", - "zerocopy 0.8.25", - "zerocopy-derive 0.8.25", + "zerocopy", + "zerocopy-derive", "zstd", ] @@ -679,9 +679,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.21" +version = "1.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8691782945451c1c383942c4874dbe63814f61cb57ef773cda2972682b7bb3c0" +checksum = "32db95edf998450acc7881c932f94cd9b05c87b4b2599e8bab064753da4acfd1" dependencies = [ "jobserver", "libc", @@ -1245,9 +1245,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73fea8450eea4bac3940448fb7ae50d91f034f941199fcd9d909a5a07aa455f0" +checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" dependencies = [ "cfg-if", "js-sys", @@ -1553,7 +1553,7 @@ version = "0.1.33" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38f262f097c174adebe41eb73d66ae9c06b2844fb0da69969647bbddd9b0538a" dependencies = [ - "getrandom 0.3.2", + "getrandom 0.3.3", "libc", ] @@ -2080,9 +2080,9 @@ dependencies = [ [[package]] name = "oxc_sourcemap" -version = "3.0.0" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6665c417b2aa1c426a7b142bcc0d2f47d9fee9e6f88610f054cfa7ce6623001e" +checksum = "9cd7bb37974a2684a080d05b9c28460e1610c5ac5ef13f481a45179f458239cb" dependencies = [ "base64-simd", "cfg-if", @@ -2311,7 +2311,7 @@ version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" dependencies = [ - "zerocopy 0.8.25", + "zerocopy", ] [[package]] @@ -2347,9 +2347,9 @@ dependencies = [ [[package]] name = "quick_cache" -version = "0.6.13" +version = "0.6.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "287e56aac5a2b4fb25a6fb050961d157635924c8696305a5c937a76f29841a0f" +checksum = "6b450dad8382b1b95061d5ca1eb792081fb082adf48c678791fe917509596d5f" dependencies = [ "equivalent", "hashbrown 0.15.3", @@ -2856,12 +2856,12 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.19.1" +version = "3.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7437ac7763b9b123ccf33c338a5cc1bac6f69b45a136c19bdd8a65e3916435bf" +checksum = "e8a64e3985349f2441a1a9ef0b853f869006c3855f2cda6862a94d26ebb9d6a1" dependencies = [ "fastrand", - "getrandom 0.3.2", + "getrandom 0.3.3", "once_cell", "rustix", "windows-sys 0.59.0", @@ -3469,33 +3469,13 @@ dependencies = [ "lzma-sys", ] -[[package]] -name = "zerocopy" -version = "0.7.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" -dependencies = [ - "zerocopy-derive 0.7.35", -] - [[package]] name = "zerocopy" version = "0.8.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1702d9583232ddb9174e01bb7c15a2ab8fb1bc6f227aa1233858c351a3ba0cb" dependencies = [ - "zerocopy-derive 0.8.25", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.101", + "zerocopy-derive", ] [[package]] @@ -3543,7 +3523,7 @@ dependencies = [ "crossbeam-utils", "deflate64", "flate2", - "getrandom 0.3.2", + "getrandom 0.3.3", "hmac", "indexmap 2.9.0", "lzma-rs", diff --git a/crates/brk_computer/src/lib.rs b/crates/brk_computer/src/lib.rs index 6492f3534..c40f558bd 100644 --- a/crates/brk_computer/src/lib.rs +++ b/crates/brk_computer/src/lib.rs @@ -7,15 +7,17 @@ use std::path::{Path, PathBuf}; use brk_exit::Exit; use brk_fetcher::Fetcher; -use brk_indexer::{Indexer, Indexes}; +use brk_indexer::Indexer; pub use brk_parser::rpc; - -mod storage; -mod utils; - use brk_vec::{AnyCollectableVec, Compressed, Computation}; + +mod stores; +mod utils; +mod vecs; + use log::info; -use storage::{Stores, Vecs}; +use stores::Stores; +use vecs::Vecs; #[derive(Clone)] pub struct Computer { @@ -67,7 +69,7 @@ impl Computer { pub fn compute( &mut self, indexer: &mut Indexer, - starting_indexes: Indexes, + starting_indexes: brk_indexer::Indexes, exit: &Exit, ) -> color_eyre::Result<()> { info!("Computing..."); diff --git a/crates/brk_computer/src/storage/mod.rs b/crates/brk_computer/src/storage/mod.rs deleted file mode 100644 index 96983bd40..000000000 --- a/crates/brk_computer/src/storage/mod.rs +++ /dev/null @@ -1,5 +0,0 @@ -mod stores; -mod vecs; - -pub use stores::*; -pub use vecs::*; diff --git a/crates/brk_computer/src/storage/stores.rs b/crates/brk_computer/src/stores.rs similarity index 100% rename from crates/brk_computer/src/storage/stores.rs rename to crates/brk_computer/src/stores.rs diff --git a/crates/brk_computer/src/storage/vecs/blocks.rs b/crates/brk_computer/src/vecs/blocks.rs similarity index 100% rename from crates/brk_computer/src/storage/vecs/blocks.rs rename to crates/brk_computer/src/vecs/blocks.rs diff --git a/crates/brk_computer/src/vecs/constants.rs b/crates/brk_computer/src/vecs/constants.rs new file mode 100644 index 000000000..fdd870576 --- /dev/null +++ b/crates/brk_computer/src/vecs/constants.rs @@ -0,0 +1,149 @@ +use std::{fs, path::Path}; + +use brk_core::StoredU8; +use brk_exit::Exit; +use brk_indexer::Indexer; +use brk_vec::{AnyCollectableVec, AnyVec, Compressed, Computation, Version}; + +use super::{ + Indexes, + grouped::{ComputedVecsFromHeight, StorableVecGeneatorOptions}, + indexes, +}; + +#[derive(Clone)] +pub struct Vecs { + pub _0: ComputedVecsFromHeight, + pub _1: ComputedVecsFromHeight, + pub _50: ComputedVecsFromHeight, + pub _100: ComputedVecsFromHeight, +} + +impl Vecs { + pub fn forced_import( + path: &Path, + _computation: Computation, + compressed: Compressed, + ) -> color_eyre::Result { + fs::create_dir_all(path)?; + + Ok(Self { + _0: ComputedVecsFromHeight::forced_import( + path, + "0", + true, + Version::ZERO, + compressed, + StorableVecGeneatorOptions::default().add_last(), + )?, + _1: ComputedVecsFromHeight::forced_import( + path, + "1", + true, + Version::ZERO, + compressed, + StorableVecGeneatorOptions::default().add_last(), + )?, + _50: ComputedVecsFromHeight::forced_import( + path, + "50", + true, + Version::ZERO, + compressed, + StorableVecGeneatorOptions::default().add_last(), + )?, + _100: ComputedVecsFromHeight::forced_import( + path, + "100", + true, + Version::ZERO, + compressed, + StorableVecGeneatorOptions::default().add_last(), + )?, + }) + } + + pub fn compute( + &mut self, + indexer: &Indexer, + indexes: &indexes::Vecs, + starting_indexes: &Indexes, + exit: &Exit, + ) -> color_eyre::Result<()> { + self._0.compute_all( + indexer, + indexes, + starting_indexes, + exit, + |vec, _, indexes, starting_indexes, exit| { + vec.compute_to( + starting_indexes.height, + indexes.height_to_date.len(), + indexes.height_to_date.version(), + |i| (i, StoredU8::new(0)), + exit, + ) + }, + )?; + + self._1.compute_all( + indexer, + indexes, + starting_indexes, + exit, + |vec, _, indexes, starting_indexes, exit| { + vec.compute_to( + starting_indexes.height, + indexes.height_to_date.len(), + indexes.height_to_date.version(), + |i| (i, StoredU8::new(1)), + exit, + ) + }, + )?; + + self._50.compute_all( + indexer, + indexes, + starting_indexes, + exit, + |vec, _, indexes, starting_indexes, exit| { + vec.compute_to( + starting_indexes.height, + indexes.height_to_date.len(), + indexes.height_to_date.version(), + |i| (i, StoredU8::new(50)), + exit, + ) + }, + )?; + + self._100.compute_all( + indexer, + indexes, + starting_indexes, + exit, + |vec, _, indexes, starting_indexes, exit| { + vec.compute_to( + starting_indexes.height, + indexes.height_to_date.len(), + indexes.height_to_date.version(), + |i| (i, StoredU8::new(100)), + exit, + ) + }, + )?; + + Ok(()) + } + + pub fn vecs(&self) -> Vec<&dyn AnyCollectableVec> { + [ + self._0.vecs(), + self._1.vecs(), + self._50.vecs(), + self._100.vecs(), + ] + .concat() + } +} diff --git a/crates/brk_computer/src/storage/vecs/fetched.rs b/crates/brk_computer/src/vecs/fetched.rs similarity index 100% rename from crates/brk_computer/src/storage/vecs/fetched.rs rename to crates/brk_computer/src/vecs/fetched.rs diff --git a/crates/brk_computer/src/storage/vecs/grouped/builder.rs b/crates/brk_computer/src/vecs/grouped/builder.rs similarity index 100% rename from crates/brk_computer/src/storage/vecs/grouped/builder.rs rename to crates/brk_computer/src/vecs/grouped/builder.rs diff --git a/crates/brk_computer/src/storage/vecs/grouped/from_dateindex.rs b/crates/brk_computer/src/vecs/grouped/from_dateindex.rs similarity index 99% rename from crates/brk_computer/src/storage/vecs/grouped/from_dateindex.rs rename to crates/brk_computer/src/vecs/grouped/from_dateindex.rs index 7016b876f..0bc57daf1 100644 --- a/crates/brk_computer/src/storage/vecs/grouped/from_dateindex.rs +++ b/crates/brk_computer/src/vecs/grouped/from_dateindex.rs @@ -5,7 +5,7 @@ use brk_exit::Exit; use brk_indexer::Indexer; use brk_vec::{AnyCollectableVec, Compressed, EagerVec, Result, Version}; -use crate::storage::{Indexes, indexes}; +use crate::vecs::{Indexes, indexes}; use super::{ComputedType, ComputedVecBuilder, StorableVecGeneatorOptions}; diff --git a/crates/brk_computer/src/storage/vecs/grouped/from_height.rs b/crates/brk_computer/src/vecs/grouped/from_height.rs similarity index 99% rename from crates/brk_computer/src/storage/vecs/grouped/from_height.rs rename to crates/brk_computer/src/vecs/grouped/from_height.rs index 328c74c64..de2a62755 100644 --- a/crates/brk_computer/src/storage/vecs/grouped/from_height.rs +++ b/crates/brk_computer/src/vecs/grouped/from_height.rs @@ -7,7 +7,7 @@ use brk_exit::Exit; use brk_indexer::Indexer; use brk_vec::{AnyCollectableVec, AnyIterableVec, Compressed, EagerVec, Result, Version}; -use crate::storage::{Indexes, indexes}; +use crate::vecs::{Indexes, indexes}; use super::{ComputedType, ComputedVecBuilder, StorableVecGeneatorOptions}; diff --git a/crates/brk_computer/src/storage/vecs/grouped/from_height_strict.rs b/crates/brk_computer/src/vecs/grouped/from_height_strict.rs similarity index 98% rename from crates/brk_computer/src/storage/vecs/grouped/from_height_strict.rs rename to crates/brk_computer/src/vecs/grouped/from_height_strict.rs index efc85d1d9..dee3406b9 100644 --- a/crates/brk_computer/src/storage/vecs/grouped/from_height_strict.rs +++ b/crates/brk_computer/src/vecs/grouped/from_height_strict.rs @@ -5,7 +5,7 @@ use brk_exit::Exit; use brk_indexer::Indexer; use brk_vec::{AnyCollectableVec, Compressed, EagerVec, Result, Version}; -use crate::storage::{Indexes, indexes}; +use crate::vecs::{Indexes, indexes}; use super::{ComputedType, ComputedVecBuilder, StorableVecGeneatorOptions}; diff --git a/crates/brk_computer/src/storage/vecs/grouped/from_txindex.rs b/crates/brk_computer/src/vecs/grouped/from_txindex.rs similarity index 99% rename from crates/brk_computer/src/storage/vecs/grouped/from_txindex.rs rename to crates/brk_computer/src/vecs/grouped/from_txindex.rs index ea894f578..5839c5a3b 100644 --- a/crates/brk_computer/src/storage/vecs/grouped/from_txindex.rs +++ b/crates/brk_computer/src/vecs/grouped/from_txindex.rs @@ -10,7 +10,7 @@ use brk_vec::{ AnyCollectableVec, CollectableVec, Compressed, EagerVec, Result, StoredVec, Version, }; -use crate::storage::{Indexes, indexes}; +use crate::vecs::{Indexes, indexes}; use super::{ComputedType, ComputedVecBuilder, StorableVecGeneatorOptions}; diff --git a/crates/brk_computer/src/storage/vecs/grouped/mod.rs b/crates/brk_computer/src/vecs/grouped/mod.rs similarity index 100% rename from crates/brk_computer/src/storage/vecs/grouped/mod.rs rename to crates/brk_computer/src/vecs/grouped/mod.rs diff --git a/crates/brk_computer/src/storage/vecs/grouped/ratio_from_dateindex.rs b/crates/brk_computer/src/vecs/grouped/ratio_from_dateindex.rs similarity index 99% rename from crates/brk_computer/src/storage/vecs/grouped/ratio_from_dateindex.rs rename to crates/brk_computer/src/vecs/grouped/ratio_from_dateindex.rs index 9b40d7989..0e833ce48 100644 --- a/crates/brk_computer/src/storage/vecs/grouped/ratio_from_dateindex.rs +++ b/crates/brk_computer/src/vecs/grouped/ratio_from_dateindex.rs @@ -10,11 +10,8 @@ use brk_vec::{ // use rayon::prelude::*; use crate::{ - storage::{ - fetched, - vecs::{Indexes, indexes}, - }, utils::get_percentile, + vecs::{Indexes, fetched, indexes}, }; use super::{ComputedVecsFromDateIndex, StorableVecGeneatorOptions}; diff --git a/crates/brk_computer/src/storage/vecs/grouped/type.rs b/crates/brk_computer/src/vecs/grouped/type.rs similarity index 100% rename from crates/brk_computer/src/storage/vecs/grouped/type.rs rename to crates/brk_computer/src/vecs/grouped/type.rs diff --git a/crates/brk_computer/src/storage/vecs/grouped/value_from_height.rs b/crates/brk_computer/src/vecs/grouped/value_from_height.rs similarity index 98% rename from crates/brk_computer/src/storage/vecs/grouped/value_from_height.rs rename to crates/brk_computer/src/vecs/grouped/value_from_height.rs index a44c5918a..4220e9248 100644 --- a/crates/brk_computer/src/storage/vecs/grouped/value_from_height.rs +++ b/crates/brk_computer/src/vecs/grouped/value_from_height.rs @@ -7,10 +7,7 @@ use brk_vec::{ AnyCollectableVec, CollectableVec, Compressed, EagerVec, Result, StoredVec, Version, }; -use crate::storage::{ - fetched, - vecs::{Indexes, indexes}, -}; +use crate::vecs::{Indexes, fetched, indexes}; use super::{ComputedVecsFromHeight, StorableVecGeneatorOptions}; diff --git a/crates/brk_computer/src/storage/vecs/grouped/value_from_txindex.rs b/crates/brk_computer/src/vecs/grouped/value_from_txindex.rs similarity index 99% rename from crates/brk_computer/src/storage/vecs/grouped/value_from_txindex.rs rename to crates/brk_computer/src/vecs/grouped/value_from_txindex.rs index 7daa6cead..8910d0b51 100644 --- a/crates/brk_computer/src/storage/vecs/grouped/value_from_txindex.rs +++ b/crates/brk_computer/src/vecs/grouped/value_from_txindex.rs @@ -8,10 +8,7 @@ use brk_vec::{ Computation, ComputedVecFrom3, LazyVecFrom1, StoredIndex, StoredVec, Version, }; -use crate::storage::{ - fetched, - vecs::{Indexes, indexes}, -}; +use crate::vecs::{Indexes, fetched, indexes}; use super::{ComputedVecsFromTxindex, StorableVecGeneatorOptions}; diff --git a/crates/brk_computer/src/storage/vecs/indexes.rs b/crates/brk_computer/src/vecs/indexes.rs similarity index 100% rename from crates/brk_computer/src/storage/vecs/indexes.rs rename to crates/brk_computer/src/vecs/indexes.rs diff --git a/crates/brk_computer/src/storage/vecs/market.rs b/crates/brk_computer/src/vecs/market.rs similarity index 100% rename from crates/brk_computer/src/storage/vecs/market.rs rename to crates/brk_computer/src/vecs/market.rs diff --git a/crates/brk_computer/src/storage/vecs/mining.rs b/crates/brk_computer/src/vecs/mining.rs similarity index 100% rename from crates/brk_computer/src/storage/vecs/mining.rs rename to crates/brk_computer/src/vecs/mining.rs diff --git a/crates/brk_computer/src/storage/vecs/mod.rs b/crates/brk_computer/src/vecs/mod.rs similarity index 91% rename from crates/brk_computer/src/storage/vecs/mod.rs rename to crates/brk_computer/src/vecs/mod.rs index c75c74005..6be2d54ef 100644 --- a/crates/brk_computer/src/storage/vecs/mod.rs +++ b/crates/brk_computer/src/vecs/mod.rs @@ -6,6 +6,7 @@ use brk_indexer::Indexer; use brk_vec::{AnyCollectableVec, Compressed, Computation}; pub mod blocks; +pub mod constants; pub mod fetched; pub mod grouped; pub mod indexes; @@ -18,6 +19,7 @@ pub use indexes::Indexes; #[derive(Clone)] pub struct Vecs { pub indexes: indexes::Vecs, + pub constants: constants::Vecs, pub blocks: blocks::Vecs, pub mining: mining::Vecs, pub market: market::Vecs, @@ -43,6 +45,7 @@ impl Vecs { Ok(Self { blocks: blocks::Vecs::forced_import(path, computation, compressed)?, mining: mining::Vecs::forced_import(path, computation, compressed)?, + constants: constants::Vecs::forced_import(path, computation, compressed)?, market: market::Vecs::forced_import(path, computation, compressed)?, transactions: transactions::Vecs::forced_import( path, @@ -66,6 +69,9 @@ impl Vecs { ) -> color_eyre::Result<()> { let starting_indexes = self.indexes.compute(indexer, starting_indexes, exit)?; + self.constants + .compute(indexer, &self.indexes, &starting_indexes, exit)?; + self.blocks .compute(indexer, &self.indexes, &starting_indexes, exit)?; @@ -106,6 +112,7 @@ impl Vecs { pub fn vecs(&self) -> Vec<&dyn AnyCollectableVec> { [ + self.constants.vecs(), self.indexes.vecs(), self.blocks.vecs(), self.mining.vecs(), diff --git a/crates/brk_computer/src/storage/vecs/transactions.rs b/crates/brk_computer/src/vecs/transactions.rs similarity index 100% rename from crates/brk_computer/src/storage/vecs/transactions.rs rename to crates/brk_computer/src/vecs/transactions.rs diff --git a/crates/brk_server/src/api/query/dts.rs b/crates/brk_server/src/api/query/dts.rs index ee46202fb..b0ec92dfa 100644 --- a/crates/brk_server/src/api/query/dts.rs +++ b/crates/brk_server/src/api/query/dts.rs @@ -79,14 +79,7 @@ impl DTS for Query<'static> { .collect::>() .join(", "); - contents += &format!( - " {}: [{indexes}],\n", - if id.contains("-") { - format!("\"{id}\"") - } else { - id.to_owned() - } - ); + contents += &format!(" \"{id}\": [{indexes}],\n"); }); contents += " });\n"; diff --git a/websites/kibo.money/packages/lightweight-charts/wrapper.js b/websites/kibo.money/packages/lightweight-charts/wrapper.js index 19e34ad32..5dcf4698d 100644 --- a/websites/kibo.money/packages/lightweight-charts/wrapper.js +++ b/websites/kibo.money/packages/lightweight-charts/wrapper.js @@ -76,7 +76,7 @@ export default import("./v5.0.6-treeshaked/script.js").then((lc) => { signals.createEffect( () => ({ defaultColor: colors.default(), - offColor: colors.off(), + offColor: colors.gray(), borderColor: colors.border(), }), ({ defaultColor, offColor, borderColor }) => { @@ -404,7 +404,7 @@ export default import("./v5.0.6-treeshaked/script.js").then((lc) => { * @param {Color} [args.color] * @param {number} [args.paneIndex] * @param {boolean} [args.defaultActive] - * @param {DeepPartial} [args.options] + * @param {DeepPartial} [args.options] */ addLineSeries({ vecId, @@ -434,6 +434,17 @@ export default import("./v5.0.6-treeshaked/script.js").then((lc) => { paneIndex, ); + const createPriceLine = options?.createPriceLine; + if (createPriceLine) { + series.createPriceLine({ + price: createPriceLine.value || 0, + color: colors.gray(), + axisLabelVisible: false, + lineWidth: 1, + lineStyle: 4, + }); + } + let url = /** @type {string | undefined} */ (undefined); if (vecId) { @@ -485,7 +496,7 @@ export default import("./v5.0.6-treeshaked/script.js").then((lc) => { * @param {VecId} [args.vecId] * @param {number} [args.paneIndex] * @param {boolean} [args.defaultActive] - * @param {DeepPartial} [args.options] + * @param {DeepPartial} [args.options] */ addBaselineSeries({ vecId, @@ -507,6 +518,9 @@ export default import("./v5.0.6-treeshaked/script.js").then((lc) => { { lineWidth: /** @type {any} */ (1.5), visible: defaultActive !== false, + baseValue: { + price: 0, + }, ...options, topLineColor: options?.topLineColor ?? colors.green(), bottomLineColor: options?.bottomLineColor ?? colors.red(), @@ -515,14 +529,22 @@ export default import("./v5.0.6-treeshaked/script.js").then((lc) => { bottomFillColor2: "transparent", topFillColor1: "transparent", topFillColor2: "transparent", - baseValue: { - price: 0, - }, lineVisible: true, }, paneIndex, ); + const createPriceLine = options?.createPriceLine; + if (createPriceLine) { + series.createPriceLine({ + price: createPriceLine.value || 0, + color: colors.gray(), + axisLabelVisible: false, + lineWidth: 1, + lineStyle: 4, + }); + } + let url = /** @type {string | undefined} */ (undefined); if (vecId) { diff --git a/websites/kibo.money/scripts/main.js b/websites/kibo.money/scripts/main.js index 0cc6010ec..5b18c357d 100644 --- a/websites/kibo.money/scripts/main.js +++ b/websites/kibo.money/scripts/main.js @@ -1,7 +1,7 @@ // @ts-check /** - * @import { Option, PartialChartOption, ChartOption, AnyPartialOption, ProcessedOptionAddons, OptionsTree, SimulationOption, AnySeriesBlueprint, ChartableIndex } from "./options" + * @import { Option, PartialChartOption, ChartOption, AnyPartialOption, ProcessedOptionAddons, OptionsTree, SimulationOption, AnySeriesBlueprint, ChartableIndex,CreatePriceLineOptions } from "./options" * @import {Valued, SingleValueData, CandlestickData, ChartData, OHLCTuple} from "../packages/lightweight-charts/wrapper" * @import * as _ from "../packages/ufuzzy/v1.0.14/types" * @import { createChart as CreateClassicChart, LineStyleOptions, DeepPartial, ChartOptions, IChartApi, IHorzScaleBehavior, WhitespaceData, ISeriesApi, Time, LineData, LogicalRange, BaselineStyleOptions, SeriesOptionsCommon, BaselineData, CandlestickStyleOptions } from "../packages/lightweight-charts/v5.0.6-treeshaked/types" @@ -41,9 +41,10 @@ * "Years" | * "Locktime" | * "sat/vB" | + * "constant" | * "cagr" | * "vB" | - * "performance" | + * "performance" * } Unit */ @@ -688,6 +689,8 @@ function createUtils() { let unit; if (id.includes("index") || id.includes("height") || id.includes("epoch")) { unit = "Index"; + } else if (id === "0" || id === "1" || id === "50" || id === "100") { + unit = "constant"; } else if (id.endsWith("cagr")) { unit = "cagr"; } else if (id.endsWith("returns")) { @@ -1563,7 +1566,7 @@ function createColors(dark, elements) { function rose() { return getColor("rose"); } - function off() { + function gray() { return getColor("gray"); } @@ -1585,7 +1588,7 @@ function createColors(dark, elements) { return { default: textColor, - off, + gray, border: borderColor, lightBitcoin: yellow, bitcoin: orange, diff --git a/websites/kibo.money/scripts/options.js b/websites/kibo.money/scripts/options.js index 2e41dec60..1232018df 100644 --- a/websites/kibo.money/scripts/options.js +++ b/websites/kibo.money/scripts/options.js @@ -16,25 +16,31 @@ * @property {string} title * @property {boolean} [defaultActive] * + * @typedef {Object} CreatePriceLine + * @property {number} value + * + * @typedef {Object} CreatePriceLineOptions + * @property {CreatePriceLine} createPriceLine + * * @typedef {Object} BaselineSeriesBlueprintSpecific * @property {"Baseline"} type * @property {Color} [color] * @property {[Color, Color]} [colors] - * @property {DeepPartial} [options] + * @property {DeepPartial} [options] * @property {Accessor} [data] * @typedef {BaseSeriesBlueprint & BaselineSeriesBlueprintSpecific} BaselineSeriesBlueprint * * @typedef {Object} CandlestickSeriesBlueprintSpecific * @property {"Candlestick"} type * @property {Color} [color] - * @property {DeepPartial} [options] + * @property {DeepPartial} [options] * @property {Accessor} [data] * @typedef {BaseSeriesBlueprint & CandlestickSeriesBlueprintSpecific} CandlestickSeriesBlueprint * * @typedef {Object} LineSeriesBlueprintSpecific * @property {"Line"} [type] * @property {Color} [color] - * @property {DeepPartial} [options] + * @property {DeepPartial} [options] * @property {Accessor} [data] * @typedef {BaseSeriesBlueprint & LineSeriesBlueprintSpecific} LineSeriesBlueprint * @@ -42,10 +48,12 @@ * * @typedef {AnySeriesBlueprint["type"]} SeriesType * - * @typedef {BaselineSeriesBlueprint & { key: ChartableVecId }} FetchedBaselineSeriesBlueprint - * @typedef {CandlestickSeriesBlueprint & { key: ChartableVecId }} FetchedCandlestickSeriesBlueprint - * @typedef {LineSeriesBlueprint & { key: ChartableVecId }} FetchedLineSeriesBlueprint - * @typedef {AnySeriesBlueprint & { key: ChartableVecId }} AnyFetchedSeriesBlueprint + * @typedef {{ key: ChartableVecId }} FetchedAnySeriesOptions + * + * @typedef {BaselineSeriesBlueprint & FetchedAnySeriesOptions} FetchedBaselineSeriesBlueprint + * @typedef {CandlestickSeriesBlueprint & FetchedAnySeriesOptions} FetchedCandlestickSeriesBlueprint + * @typedef {LineSeriesBlueprint & FetchedAnySeriesOptions} FetchedLineSeriesBlueprint + * @typedef {AnySeriesBlueprint & FetchedAnySeriesOptions} AnyFetchedSeriesBlueprint * * @typedef {Object} PartialOption * @property {string} name @@ -986,7 +994,10 @@ function createPartialOptions(colors) { title: "Ratio", type: "Baseline", options: { - baseValue: { type: "price", price: 1 }, + baseValue: { price: 1 }, + createPriceLine: { + value: 1, + }, }, }), createBaseSeries({ @@ -1089,6 +1100,11 @@ function createPartialOptions(colors) { key: `${key}-sma-ratio-1y-sma-momentum-oscillator`, title: "1Y Momentum", type: "Baseline", + options: { + createPriceLine: { + value: 0, + }, + }, }), ], })), @@ -1111,6 +1127,11 @@ function createPartialOptions(colors) { key: `1d-returns`, title: "1d", type: "Baseline", + options: { + createPriceLine: { + value: 0, + }, + }, }), ], }, @@ -1142,12 +1163,22 @@ function createPartialOptions(colors) { key: `${key}-returns`, title: "lump sum", type: "Baseline", + options: { + createPriceLine: { + value: 0, + }, + }, }), /** @satisfies {FetchedBaselineSeriesBlueprint} */ ({ key: `${key}-dca-returns`, title: "dca", type: "Baseline", colors: [colors.yellow, colors.pink], + options: { + createPriceLine: { + value: 0, + }, + }, }), ], }), @@ -1182,23 +1213,43 @@ function createPartialOptions(colors) { key: `${key}-returns`, title: "lump sum", type: "Baseline", + options: { + createPriceLine: { + value: 0, + }, + }, }), /** @satisfies {FetchedBaselineSeriesBlueprint} */ ({ key: `${key}-cagr`, title: "lump sum", type: "Baseline", + options: { + createPriceLine: { + value: 0, + }, + }, }), /** @satisfies {FetchedBaselineSeriesBlueprint} */ ({ key: `${key}-dca-returns`, title: "dca", type: "Baseline", colors: [colors.yellow, colors.pink], + options: { + createPriceLine: { + value: 0, + }, + }, }), /** @satisfies {FetchedBaselineSeriesBlueprint} */ ({ key: `${key}-dca-cagr`, title: "dca", type: "Baseline", colors: [colors.yellow, colors.pink], + options: { + createPriceLine: { + value: 0, + }, + }, }), ], }), diff --git a/websites/kibo.money/scripts/vecid-to-indexes.js b/websites/kibo.money/scripts/vecid-to-indexes.js index 628f239ba..23fff4d4c 100644 --- a/websites/kibo.money/scripts/vecid-to-indexes.js +++ b/websites/kibo.money/scripts/vecid-to-indexes.js @@ -56,6 +56,9 @@ export function createVecIdToIndexes() { const YearIndex = /** @satisfies {YearIndex} */ (23); return /** @type {const} */ ({ + "0": [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex], + "1": [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex], + "100": [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex], "10y-cagr": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex], "10y-dca-avg-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex], "10y-dca-cagr": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex], @@ -417,6 +420,7 @@ export function createVecIdToIndexes() { "4y-sma-ratio-p99-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex], "4y-sma-ratio-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex], "4y-sma-ratio-standard-deviation": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex], + "50": [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex], "55d-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex], "55d-sma-ratio": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex], "55d-sma-ratio-1m-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex], @@ -535,7 +539,7 @@ export function createVecIdToIndexes() { "8y-dca-returns": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex], "8y-dca-stack": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex], "8y-returns": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex], - ath: [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex], + "ath": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex], "base-size": [TxIndex], "block-count": [Height], "block-count-sum": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex], @@ -550,11 +554,11 @@ export function createVecIdToIndexes() { "block-size-sum": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex], "block-vbytes-sum": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex], "block-weight-sum": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex], - blockhash: [Height], - close: [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex], + "blockhash": [Height], + "close": [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex], "close-in-cents": [DateIndex, Height], "close-in-sats": [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex], - coinbase: [Height], + "coinbase": [Height], "coinbase-10p": [DateIndex], "coinbase-25p": [DateIndex], "coinbase-75p": [DateIndex], @@ -584,15 +588,15 @@ export function createVecIdToIndexes() { "coinbase-median": [DateIndex], "coinbase-min": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex], "coinbase-sum": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex], - date: [DateIndex, Height], + "date": [DateIndex, Height], "date-fixed": [Height], - dateindex: [DateIndex, Height], + "dateindex": [DateIndex, Height], "dateindex-count": [MonthIndex, WeekIndex], "days-since-ath": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex], - decadeindex: [DecadeIndex, YearIndex], - difficulty: [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex], - difficultyepoch: [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex], - drawdown: [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex], + "decadeindex": [DecadeIndex, YearIndex], + "difficulty": [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex], + "difficultyepoch": [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex], + "drawdown": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex], "emptyoutput-count": [Height], "emptyoutput-count-10p": [DateIndex], "emptyoutput-count-25p": [DateIndex], @@ -603,8 +607,8 @@ export function createVecIdToIndexes() { "emptyoutput-count-median": [DateIndex], "emptyoutput-count-min": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex], "emptyoutput-count-sum": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex], - emptyoutputindex: [EmptyOutputIndex], - fee: [TxIndex], + "emptyoutputindex": [EmptyOutputIndex], + "fee": [TxIndex], "fee-10p": [Height], "fee-25p": [Height], "fee-75p": [Height], @@ -632,7 +636,7 @@ export function createVecIdToIndexes() { "fee-median": [Height], "fee-min": [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex], "fee-sum": [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex], - feerate: [TxIndex], + "feerate": [TxIndex], "feerate-10p": [Height], "feerate-25p": [Height], "feerate-75p": [Height], @@ -660,10 +664,10 @@ export function createVecIdToIndexes() { "first-txindex": [Height], "first-unknownoutputindex": [Height], "first-yearindex": [DecadeIndex], - halvingepoch: [DateIndex, DecadeIndex, HalvingEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex], - height: [Height, TxIndex], + "halvingepoch": [DateIndex, DecadeIndex, HalvingEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex], + "height": [Height, TxIndex], "height-count": [DateIndex, DifficultyEpoch], - high: [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex], + "high": [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex], "high-in-cents": [DateIndex, Height], "high-in-sats": [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex], "input-count": [TxIndex], @@ -677,22 +681,22 @@ export function createVecIdToIndexes() { "input-count-min": [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex], "input-count-sum": [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex], "input-value": [TxIndex], - inputindex: [InputIndex], - interval: [Height], + "inputindex": [InputIndex], + "interval": [Height], "is-coinbase": [TxIndex], "is-explicitly-rbf": [TxIndex], - low: [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex], + "low": [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex], "low-in-cents": [DateIndex, Height], "low-in-sats": [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex], - marketcap: [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex], + "marketcap": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex], "max-days-between-ath": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex], "max-years-between-ath": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex], - monthindex: [DateIndex, MonthIndex], + "monthindex": [DateIndex, MonthIndex], "monthindex-count": [QuarterIndex, YearIndex], - ohlc: [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex], + "ohlc": [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex], "ohlc-in-cents": [DateIndex, Height], "ohlc-in-sats": [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex], - open: [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex], + "open": [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex], "open-in-cents": [DateIndex, Height], "open-in-sats": [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex], "opreturn-count": [Height], @@ -705,7 +709,7 @@ export function createVecIdToIndexes() { "opreturn-count-median": [DateIndex], "opreturn-count-min": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex], "opreturn-count-sum": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex], - opreturnindex: [OpReturnIndex], + "opreturnindex": [OpReturnIndex], "output-count": [TxIndex], "output-count-10p": [Height], "output-count-25p": [Height], @@ -717,9 +721,9 @@ export function createVecIdToIndexes() { "output-count-min": [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex], "output-count-sum": [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex], "output-value": [TxIndex], - outputindex: [InputIndex, OutputIndex], - outputtype: [OutputIndex], - outputtypeindex: [OutputIndex], + "outputindex": [InputIndex, OutputIndex], + "outputtype": [OutputIndex], + "outputtypeindex": [OutputIndex], "p2a-count": [Height], "p2a-count-10p": [DateIndex], "p2a-count-25p": [DateIndex], @@ -730,8 +734,8 @@ export function createVecIdToIndexes() { "p2a-count-median": [DateIndex], "p2a-count-min": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex], "p2a-count-sum": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex], - p2abytes: [P2AIndex], - p2aindex: [P2AIndex], + "p2abytes": [P2AIndex], + "p2aindex": [P2AIndex], "p2ms-count": [Height], "p2ms-count-10p": [DateIndex], "p2ms-count-25p": [DateIndex], @@ -742,7 +746,7 @@ export function createVecIdToIndexes() { "p2ms-count-median": [DateIndex], "p2ms-count-min": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex], "p2ms-count-sum": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex], - p2msindex: [P2MSIndex], + "p2msindex": [P2MSIndex], "p2pk33-count": [Height], "p2pk33-count-10p": [DateIndex], "p2pk33-count-25p": [DateIndex], @@ -753,8 +757,8 @@ export function createVecIdToIndexes() { "p2pk33-count-median": [DateIndex], "p2pk33-count-min": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex], "p2pk33-count-sum": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex], - p2pk33bytes: [P2PK33Index], - p2pk33index: [P2PK33Index], + "p2pk33bytes": [P2PK33Index], + "p2pk33index": [P2PK33Index], "p2pk65-count": [Height], "p2pk65-count-10p": [DateIndex], "p2pk65-count-25p": [DateIndex], @@ -765,8 +769,8 @@ export function createVecIdToIndexes() { "p2pk65-count-median": [DateIndex], "p2pk65-count-min": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex], "p2pk65-count-sum": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex], - p2pk65bytes: [P2PK65Index], - p2pk65index: [P2PK65Index], + "p2pk65bytes": [P2PK65Index], + "p2pk65index": [P2PK65Index], "p2pkh-count": [Height], "p2pkh-count-10p": [DateIndex], "p2pkh-count-25p": [DateIndex], @@ -777,8 +781,8 @@ export function createVecIdToIndexes() { "p2pkh-count-median": [DateIndex], "p2pkh-count-min": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex], "p2pkh-count-sum": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex], - p2pkhbytes: [P2PKHIndex], - p2pkhindex: [P2PKHIndex], + "p2pkhbytes": [P2PKHIndex], + "p2pkhindex": [P2PKHIndex], "p2sh-count": [Height], "p2sh-count-10p": [DateIndex], "p2sh-count-25p": [DateIndex], @@ -789,8 +793,8 @@ export function createVecIdToIndexes() { "p2sh-count-median": [DateIndex], "p2sh-count-min": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex], "p2sh-count-sum": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex], - p2shbytes: [P2SHIndex], - p2shindex: [P2SHIndex], + "p2shbytes": [P2SHIndex], + "p2shindex": [P2SHIndex], "p2tr-count": [Height], "p2tr-count-10p": [DateIndex], "p2tr-count-25p": [DateIndex], @@ -801,8 +805,8 @@ export function createVecIdToIndexes() { "p2tr-count-median": [DateIndex], "p2tr-count-min": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex], "p2tr-count-sum": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex], - p2trbytes: [P2TRIndex], - p2trindex: [P2TRIndex], + "p2trbytes": [P2TRIndex], + "p2trindex": [P2TRIndex], "p2wpkh-count": [Height], "p2wpkh-count-10p": [DateIndex], "p2wpkh-count-25p": [DateIndex], @@ -813,8 +817,8 @@ export function createVecIdToIndexes() { "p2wpkh-count-median": [DateIndex], "p2wpkh-count-min": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex], "p2wpkh-count-sum": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex], - p2wpkhbytes: [P2WPKHIndex], - p2wpkhindex: [P2WPKHIndex], + "p2wpkhbytes": [P2WPKHIndex], + "p2wpkhindex": [P2WPKHIndex], "p2wsh-count": [Height], "p2wsh-count-10p": [DateIndex], "p2wsh-count-25p": [DateIndex], @@ -825,8 +829,8 @@ export function createVecIdToIndexes() { "p2wsh-count-median": [DateIndex], "p2wsh-count-min": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex], "p2wsh-count-sum": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex], - p2wshbytes: [P2WSHIndex], - p2wshindex: [P2WSHIndex], + "p2wshbytes": [P2WSHIndex], + "p2wshindex": [P2WSHIndex], "price-10y-ago": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex], "price-1d-ago": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex], "price-1m-ago": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex], @@ -840,9 +844,9 @@ export function createVecIdToIndexes() { "price-6m-ago": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex], "price-6y-ago": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex], "price-8y-ago": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex], - quarterindex: [MonthIndex, QuarterIndex], - rawlocktime: [TxIndex], - subsidy: [Height], + "quarterindex": [MonthIndex, QuarterIndex], + "rawlocktime": [TxIndex], + "subsidy": [Height], "subsidy-10p": [DateIndex], "subsidy-25p": [DateIndex], "subsidy-75p": [DateIndex], @@ -872,7 +876,7 @@ export function createVecIdToIndexes() { "subsidy-median": [DateIndex], "subsidy-min": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex], "subsidy-sum": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex], - timestamp: [DateIndex, DecadeIndex, DifficultyEpoch, HalvingEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex], + "timestamp": [DateIndex, DecadeIndex, DifficultyEpoch, HalvingEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex], "timestamp-fixed": [Height], "total-block-count": [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex], "total-block-size": [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex], @@ -938,10 +942,10 @@ export function createVecIdToIndexes() { "tx-weight-max": [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex], "tx-weight-median": [Height], "tx-weight-min": [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex], - txid: [TxIndex], - txindex: [EmptyOutputIndex, OpReturnIndex, P2MSIndex, TxIndex, UnknownOutputIndex], + "txid": [TxIndex], + "txindex": [EmptyOutputIndex, OpReturnIndex, P2MSIndex, TxIndex, UnknownOutputIndex], "txindex-count": [Height], - txversion: [TxIndex], + "txversion": [TxIndex], "unknownoutput-count": [Height], "unknownoutput-count-10p": [DateIndex], "unknownoutput-count-25p": [DateIndex], @@ -952,13 +956,13 @@ export function createVecIdToIndexes() { "unknownoutput-count-median": [DateIndex], "unknownoutput-count-min": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex], "unknownoutput-count-sum": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex], - unknownoutputindex: [UnknownOutputIndex], - value: [InputIndex, OutputIndex], - vbytes: [Height], - vsize: [TxIndex], - weekindex: [DateIndex, WeekIndex], - weight: [Height, TxIndex], - yearindex: [MonthIndex, YearIndex], + "unknownoutputindex": [UnknownOutputIndex], + "value": [InputIndex, OutputIndex], + "vbytes": [Height], + "vsize": [TxIndex], + "weekindex": [DateIndex, WeekIndex], + "weight": [Height, TxIndex], + "yearindex": [MonthIndex, YearIndex], "yearindex-count": [DecadeIndex], }); }