Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4efd98b758 | |||
| 36640e3710 | |||
| 311c4fd29d |
@@ -487,7 +487,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "brk"
|
name = "brk"
|
||||||
version = "0.0.93"
|
version = "0.0.94"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"brk_bundler",
|
"brk_bundler",
|
||||||
"brk_cli",
|
"brk_cli",
|
||||||
@@ -506,7 +506,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "brk_bundler"
|
name = "brk_bundler"
|
||||||
version = "0.0.93"
|
version = "0.0.94"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"brk_rolldown",
|
"brk_rolldown",
|
||||||
"log",
|
"log",
|
||||||
@@ -517,7 +517,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "brk_cli"
|
name = "brk_cli"
|
||||||
version = "0.0.93"
|
version = "0.0.94"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitcoincore-rpc",
|
"bitcoincore-rpc",
|
||||||
"brk_bundler",
|
"brk_bundler",
|
||||||
@@ -542,7 +542,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "brk_computer"
|
name = "brk_computer"
|
||||||
version = "0.0.93"
|
version = "0.0.94"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitcoin",
|
"bitcoin",
|
||||||
"bitcoincore-rpc",
|
"bitcoincore-rpc",
|
||||||
@@ -564,7 +564,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "brk_error"
|
name = "brk_error"
|
||||||
version = "0.0.93"
|
version = "0.0.94"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitcoincore-rpc",
|
"bitcoincore-rpc",
|
||||||
"fjall",
|
"fjall",
|
||||||
@@ -577,7 +577,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "brk_fetcher"
|
name = "brk_fetcher"
|
||||||
version = "0.0.93"
|
version = "0.0.94"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"brk_error",
|
"brk_error",
|
||||||
"brk_logger",
|
"brk_logger",
|
||||||
@@ -589,7 +589,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "brk_indexer"
|
name = "brk_indexer"
|
||||||
version = "0.0.93"
|
version = "0.0.94"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitcoin",
|
"bitcoin",
|
||||||
"bitcoincore-rpc",
|
"bitcoincore-rpc",
|
||||||
@@ -606,7 +606,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "brk_interface"
|
name = "brk_interface"
|
||||||
version = "0.0.93"
|
version = "0.0.94"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"brk_computer",
|
"brk_computer",
|
||||||
"brk_error",
|
"brk_error",
|
||||||
@@ -623,7 +623,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "brk_logger"
|
name = "brk_logger"
|
||||||
version = "0.0.93"
|
version = "0.0.94"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"env_logger",
|
"env_logger",
|
||||||
"jiff",
|
"jiff",
|
||||||
@@ -633,7 +633,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "brk_mcp"
|
name = "brk_mcp"
|
||||||
version = "0.0.93"
|
version = "0.0.94"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"axum",
|
"axum",
|
||||||
"brk_interface",
|
"brk_interface",
|
||||||
@@ -643,7 +643,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "brk_parser"
|
name = "brk_parser"
|
||||||
version = "0.0.93"
|
version = "0.0.94"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitcoin",
|
"bitcoin",
|
||||||
"bitcoincore-rpc",
|
"bitcoincore-rpc",
|
||||||
@@ -1021,7 +1021,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "brk_server"
|
name = "brk_server"
|
||||||
version = "0.0.93"
|
version = "0.0.94"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"axum",
|
"axum",
|
||||||
"bitcoincore-rpc",
|
"bitcoincore-rpc",
|
||||||
@@ -1045,7 +1045,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "brk_store"
|
name = "brk_store"
|
||||||
version = "0.0.93"
|
version = "0.0.94"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"brk_error",
|
"brk_error",
|
||||||
"brk_structs",
|
"brk_structs",
|
||||||
@@ -1068,7 +1068,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "brk_structs"
|
name = "brk_structs"
|
||||||
version = "0.0.93"
|
version = "0.0.94"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitcoin",
|
"bitcoin",
|
||||||
"bitcoincore-rpc",
|
"bitcoincore-rpc",
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ members = ["crates/*"]
|
|||||||
package.description = "The Bitcoin Research Kit is a suite of tools designed to extract, compute and display data stored on a Bitcoin Core node"
|
package.description = "The Bitcoin Research Kit is a suite of tools designed to extract, compute and display data stored on a Bitcoin Core node"
|
||||||
package.license = "MIT"
|
package.license = "MIT"
|
||||||
package.edition = "2024"
|
package.edition = "2024"
|
||||||
package.version = "0.0.93"
|
package.version = "0.0.94"
|
||||||
package.homepage = "https://bitcoinresearchkit.org"
|
package.homepage = "https://bitcoinresearchkit.org"
|
||||||
package.repository = "https://github.com/bitcoinresearchkit/brk"
|
package.repository = "https://github.com/bitcoinresearchkit/brk"
|
||||||
package.readme = "README.md"
|
package.readme = "README.md"
|
||||||
@@ -26,19 +26,19 @@ inherits = "release"
|
|||||||
axum = "0.8.4"
|
axum = "0.8.4"
|
||||||
bitcoin = { version = "0.32.7", features = ["serde"] }
|
bitcoin = { version = "0.32.7", features = ["serde"] }
|
||||||
bitcoincore-rpc = "0.19.0"
|
bitcoincore-rpc = "0.19.0"
|
||||||
brk_bundler = { version = "0.0.93", path = "crates/brk_bundler" }
|
brk_bundler = { version = "0.0.94", path = "crates/brk_bundler" }
|
||||||
brk_cli = { version = "0.0.93", path = "crates/brk_cli" }
|
brk_cli = { version = "0.0.94", path = "crates/brk_cli" }
|
||||||
brk_computer = { version = "0.0.93", path = "crates/brk_computer" }
|
brk_computer = { version = "0.0.94", path = "crates/brk_computer" }
|
||||||
brk_error = { version = "0.0.93", path = "crates/brk_error" }
|
brk_error = { version = "0.0.94", path = "crates/brk_error" }
|
||||||
brk_fetcher = { version = "0.0.93", path = "crates/brk_fetcher" }
|
brk_fetcher = { version = "0.0.94", path = "crates/brk_fetcher" }
|
||||||
brk_indexer = { version = "0.0.93", path = "crates/brk_indexer" }
|
brk_indexer = { version = "0.0.94", path = "crates/brk_indexer" }
|
||||||
brk_interface = { version = "0.0.93", path = "crates/brk_interface" }
|
brk_interface = { version = "0.0.94", path = "crates/brk_interface" }
|
||||||
brk_logger = { version = "0.0.93", path = "crates/brk_logger" }
|
brk_logger = { version = "0.0.94", path = "crates/brk_logger" }
|
||||||
brk_mcp = { version = "0.0.93", path = "crates/brk_mcp" }
|
brk_mcp = { version = "0.0.94", path = "crates/brk_mcp" }
|
||||||
brk_parser = { version = "0.0.93", path = "crates/brk_parser" }
|
brk_parser = { version = "0.0.94", path = "crates/brk_parser" }
|
||||||
brk_server = { version = "0.0.93", path = "crates/brk_server" }
|
brk_server = { version = "0.0.94", path = "crates/brk_server" }
|
||||||
brk_store = { version = "0.0.93", path = "crates/brk_store" }
|
brk_store = { version = "0.0.94", path = "crates/brk_store" }
|
||||||
brk_structs = { version = "0.0.93", path = "crates/brk_structs" }
|
brk_structs = { version = "0.0.94", path = "crates/brk_structs" }
|
||||||
byteview = "=0.6.1"
|
byteview = "=0.6.1"
|
||||||
derive_deref = "1.1.1"
|
derive_deref = "1.1.1"
|
||||||
fjall = "2.11.2"
|
fjall = "2.11.2"
|
||||||
|
|||||||
@@ -31,10 +31,9 @@ In other words it's an alternative to [Glassnode](https://glassnode.com), [mempo
|
|||||||
|
|
||||||
The toolkit can be used in various ways to accommodate as many needs as possible:
|
The toolkit can be used in various ways to accommodate as many needs as possible:
|
||||||
|
|
||||||
- **[Website](https://bitcoinresearchkit.org)** \
|
- **[Website](https://bitview.space)** \
|
||||||
Everyone is welcome to visit the official instance and showcase of the suite's capabilities. \
|
Everyone is welcome to visit the official instance and showcase of the suite's capabilities. \
|
||||||
It has a wide range of functionalities including charts, tables and simulations which you can visit for free and without the need for an account. \
|
It has a wide range of functionalities including charts, tables and simulations which you can visit for free and without the need for an account.
|
||||||
Also available at: [brekit.org](https://brekit.org) // [kibo.money](https://kibo.money) // [satonomics.xyz](https://satonomics.xyz)
|
|
||||||
- **[API](https://github.com/bitcoinresearchkit/brk/tree/main/crates/brk_server#brk-server)** \
|
- **[API](https://github.com/bitcoinresearchkit/brk/tree/main/crates/brk_server#brk-server)** \
|
||||||
Researchers and developers are free to use BRK's public API with  dataset variants at their disposal. \
|
Researchers and developers are free to use BRK's public API with  dataset variants at their disposal. \
|
||||||
Just like the website, it's entirely free, with no authentication or rate-limiting.
|
Just like the website, it's entirely free, with no authentication or rate-limiting.
|
||||||
@@ -62,7 +61,7 @@ If you'd like to have your own instance hosted for you please contact [hosting@b
|
|||||||
- Updates delivered at your convenience
|
- Updates delivered at your convenience
|
||||||
- Direct communication for feature requests and support
|
- Direct communication for feature requests and support
|
||||||
- Bitcoin Core or Knots with desired version
|
- Bitcoin Core or Knots with desired version
|
||||||
- Optional subdomains: `*.bitcoinresearchkit.org`, `*.brekit.org`, `*.kibo.money` and `*.satonomics.xyz`
|
- Optional subdomains
|
||||||
- Logo featured in the Readme if desired
|
- Logo featured in the Readme if desired
|
||||||
|
|
||||||
Pricing: `0.01 BTC / month` *or* `0.1 BTC / year`
|
Pricing: `0.01 BTC / month` *or* `0.1 BTC / year`
|
||||||
|
|||||||
@@ -284,7 +284,7 @@ Finally, you can run the program with '-h' for help."
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn website(&self) -> Website {
|
pub fn website(&self) -> Website {
|
||||||
self.website.unwrap_or(Website::Default)
|
self.website.unwrap_or(Website::Bitview)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn fetch(&self) -> bool {
|
pub fn fetch(&self) -> bool {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ use serde::{Deserialize, Serialize};
|
|||||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Deserialize, Serialize, ValueEnum)]
|
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Deserialize, Serialize, ValueEnum)]
|
||||||
pub enum Website {
|
pub enum Website {
|
||||||
None,
|
None,
|
||||||
Default,
|
Bitview,
|
||||||
Custom,
|
Custom,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -20,7 +20,7 @@ impl Website {
|
|||||||
pub fn to_folder_name(self) -> &'static str {
|
pub fn to_folder_name(self) -> &'static str {
|
||||||
match self {
|
match self {
|
||||||
Self::Custom => "custom",
|
Self::Custom => "custom",
|
||||||
Self::Default => "default",
|
Self::Bitview => "bitview",
|
||||||
Self::None => unreachable!(),
|
Self::None => unreachable!(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -78,15 +78,25 @@ impl Vecs {
|
|||||||
Source::None,
|
Source::None,
|
||||||
version + VERSION + Version::ZERO,
|
version + VERSION + Version::ZERO,
|
||||||
indexes,
|
indexes,
|
||||||
VecBuilderOptions::default().add_sum().add_cumulative(),
|
VecBuilderOptions::default()
|
||||||
|
.add_sum()
|
||||||
|
.add_minmax()
|
||||||
|
.add_average()
|
||||||
|
.add_percentiles()
|
||||||
|
.add_cumulative(),
|
||||||
)?,
|
)?,
|
||||||
indexes_to_block_size: ComputedVecsFromHeight::forced_import(
|
indexes_to_block_size: ComputedVecsFromHeight::forced_import(
|
||||||
&db,
|
&db,
|
||||||
"block_size",
|
"block_size",
|
||||||
Source::None,
|
Source::Compute,
|
||||||
version + VERSION + Version::ZERO,
|
version + VERSION + Version::ZERO,
|
||||||
indexes,
|
indexes,
|
||||||
VecBuilderOptions::default().add_sum().add_cumulative(),
|
VecBuilderOptions::default()
|
||||||
|
.add_sum()
|
||||||
|
.add_minmax()
|
||||||
|
.add_average()
|
||||||
|
.add_percentiles()
|
||||||
|
.add_cumulative(),
|
||||||
)?,
|
)?,
|
||||||
height_to_vbytes: EagerVec::forced_import_compressed(
|
height_to_vbytes: EagerVec::forced_import_compressed(
|
||||||
&db,
|
&db,
|
||||||
@@ -99,7 +109,12 @@ impl Vecs {
|
|||||||
Source::None,
|
Source::None,
|
||||||
version + VERSION + Version::ZERO,
|
version + VERSION + Version::ZERO,
|
||||||
indexes,
|
indexes,
|
||||||
VecBuilderOptions::default().add_sum().add_cumulative(),
|
VecBuilderOptions::default()
|
||||||
|
.add_sum()
|
||||||
|
.add_minmax()
|
||||||
|
.add_average()
|
||||||
|
.add_percentiles()
|
||||||
|
.add_cumulative(),
|
||||||
)?,
|
)?,
|
||||||
difficultyepoch_to_timestamp: EagerVec::forced_import_compressed(
|
difficultyepoch_to_timestamp: EagerVec::forced_import_compressed(
|
||||||
&db,
|
&db,
|
||||||
|
|||||||
@@ -79,8 +79,8 @@ impl Vecs {
|
|||||||
version,
|
version,
|
||||||
indexes,
|
indexes,
|
||||||
price,
|
price,
|
||||||
compute_relative_to_all,
|
|
||||||
false,
|
false,
|
||||||
|
compute_relative_to_all,
|
||||||
false,
|
false,
|
||||||
)?,
|
)?,
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -52,12 +52,16 @@ pub struct Vecs {
|
|||||||
pub indexes_to_coindays_destroyed: ComputedVecsFromHeight<StoredF64>,
|
pub indexes_to_coindays_destroyed: ComputedVecsFromHeight<StoredF64>,
|
||||||
pub dateindex_to_spent_output_profit_ratio: Option<EagerVec<DateIndex, StoredF32>>,
|
pub dateindex_to_spent_output_profit_ratio: Option<EagerVec<DateIndex, StoredF32>>,
|
||||||
pub dateindex_to_spent_output_profit_ratio_7d_ema: Option<EagerVec<DateIndex, StoredF32>>,
|
pub dateindex_to_spent_output_profit_ratio_7d_ema: Option<EagerVec<DateIndex, StoredF32>>,
|
||||||
|
pub dateindex_to_spent_output_profit_ratio_30d_ema: Option<EagerVec<DateIndex, StoredF32>>,
|
||||||
pub dateindex_to_adjusted_spent_output_profit_ratio: Option<EagerVec<DateIndex, StoredF32>>,
|
pub dateindex_to_adjusted_spent_output_profit_ratio: Option<EagerVec<DateIndex, StoredF32>>,
|
||||||
pub dateindex_to_adjusted_spent_output_profit_ratio_7d_ema:
|
pub dateindex_to_adjusted_spent_output_profit_ratio_7d_ema:
|
||||||
Option<EagerVec<DateIndex, StoredF32>>,
|
Option<EagerVec<DateIndex, StoredF32>>,
|
||||||
|
pub dateindex_to_adjusted_spent_output_profit_ratio_30d_ema:
|
||||||
|
Option<EagerVec<DateIndex, StoredF32>>,
|
||||||
pub indexes_to_realized_cap_30d_change: Option<ComputedVecsFromDateIndex<Dollars>>,
|
pub indexes_to_realized_cap_30d_change: Option<ComputedVecsFromDateIndex<Dollars>>,
|
||||||
pub dateindex_to_sell_side_risk_ratio: Option<EagerVec<DateIndex, StoredF32>>,
|
pub dateindex_to_sell_side_risk_ratio: Option<EagerVec<DateIndex, StoredF32>>,
|
||||||
pub dateindex_to_sell_side_risk_ratio_7d_ema: Option<EagerVec<DateIndex, StoredF32>>,
|
pub dateindex_to_sell_side_risk_ratio_7d_ema: Option<EagerVec<DateIndex, StoredF32>>,
|
||||||
|
pub dateindex_to_sell_side_risk_ratio_30d_ema: Option<EagerVec<DateIndex, StoredF32>>,
|
||||||
pub indexes_to_adjusted_value_created: Option<ComputedVecsFromHeight<Dollars>>,
|
pub indexes_to_adjusted_value_created: Option<ComputedVecsFromHeight<Dollars>>,
|
||||||
pub indexes_to_adjusted_value_destroyed: Option<ComputedVecsFromHeight<Dollars>>,
|
pub indexes_to_adjusted_value_destroyed: Option<ComputedVecsFromHeight<Dollars>>,
|
||||||
pub indexes_to_negative_realized_loss: Option<ComputedVecsFromHeight<Dollars>>,
|
pub indexes_to_negative_realized_loss: Option<ComputedVecsFromHeight<Dollars>>,
|
||||||
@@ -83,8 +87,18 @@ pub struct Vecs {
|
|||||||
pub indexes_to_negative_unrealized_loss: Option<ComputedVecsFromDateIndex<Dollars>>,
|
pub indexes_to_negative_unrealized_loss: Option<ComputedVecsFromDateIndex<Dollars>>,
|
||||||
pub height_to_net_unrealized_profit_and_loss: Option<EagerVec<Height, Dollars>>,
|
pub height_to_net_unrealized_profit_and_loss: Option<EagerVec<Height, Dollars>>,
|
||||||
pub indexes_to_net_unrealized_profit_and_loss: Option<ComputedVecsFromDateIndex<Dollars>>,
|
pub indexes_to_net_unrealized_profit_and_loss: Option<ComputedVecsFromDateIndex<Dollars>>,
|
||||||
|
pub height_to_unrealized_profit_relative_to_market_cap: Option<EagerVec<Height, StoredF32>>,
|
||||||
|
pub height_to_unrealized_loss_relative_to_market_cap: Option<EagerVec<Height, StoredF32>>,
|
||||||
|
pub height_to_negative_unrealized_loss_relative_to_market_cap:
|
||||||
|
Option<EagerVec<Height, StoredF32>>,
|
||||||
pub height_to_net_unrealized_profit_and_loss_relative_to_market_cap:
|
pub height_to_net_unrealized_profit_and_loss_relative_to_market_cap:
|
||||||
Option<EagerVec<Height, StoredF32>>,
|
Option<EagerVec<Height, StoredF32>>,
|
||||||
|
pub indexes_to_unrealized_profit_relative_to_market_cap:
|
||||||
|
Option<ComputedVecsFromDateIndex<StoredF32>>,
|
||||||
|
pub indexes_to_unrealized_loss_relative_to_market_cap:
|
||||||
|
Option<ComputedVecsFromDateIndex<StoredF32>>,
|
||||||
|
pub indexes_to_negative_unrealized_loss_relative_to_market_cap:
|
||||||
|
Option<ComputedVecsFromDateIndex<StoredF32>>,
|
||||||
pub indexes_to_net_unrealized_profit_and_loss_relative_to_market_cap:
|
pub indexes_to_net_unrealized_profit_and_loss_relative_to_market_cap:
|
||||||
Option<ComputedVecsFromDateIndex<StoredF32>>,
|
Option<ComputedVecsFromDateIndex<StoredF32>>,
|
||||||
pub indexes_to_realized_profit_relative_to_realized_cap:
|
pub indexes_to_realized_profit_relative_to_realized_cap:
|
||||||
@@ -136,8 +150,8 @@ impl Vecs {
|
|||||||
version: Version,
|
version: Version,
|
||||||
indexes: &indexes::Vecs,
|
indexes: &indexes::Vecs,
|
||||||
price: Option<&price::Vecs>,
|
price: Option<&price::Vecs>,
|
||||||
|
extended: bool,
|
||||||
compute_relative_to_all: bool,
|
compute_relative_to_all: bool,
|
||||||
ratio_extended: bool,
|
|
||||||
compute_adjusted: bool,
|
compute_adjusted: bool,
|
||||||
) -> Result<Self> {
|
) -> Result<Self> {
|
||||||
let compute_dollars = price.is_some();
|
let compute_dollars = price.is_some();
|
||||||
@@ -420,7 +434,7 @@ impl Vecs {
|
|||||||
Source::None,
|
Source::None,
|
||||||
version + VERSION + Version::ZERO,
|
version + VERSION + Version::ZERO,
|
||||||
indexes,
|
indexes,
|
||||||
ratio_extended,
|
extended,
|
||||||
)
|
)
|
||||||
.unwrap()
|
.unwrap()
|
||||||
}),
|
}),
|
||||||
@@ -612,6 +626,15 @@ impl Vecs {
|
|||||||
)
|
)
|
||||||
.unwrap()
|
.unwrap()
|
||||||
}),
|
}),
|
||||||
|
dateindex_to_sell_side_risk_ratio_30d_ema: compute_dollars.then(|| {
|
||||||
|
EagerVec::forced_import(
|
||||||
|
db,
|
||||||
|
&suffix("sell_side_risk_ratio_30d_ema"),
|
||||||
|
version + VERSION + Version::ONE,
|
||||||
|
format,
|
||||||
|
)
|
||||||
|
.unwrap()
|
||||||
|
}),
|
||||||
dateindex_to_spent_output_profit_ratio: compute_dollars.then(|| {
|
dateindex_to_spent_output_profit_ratio: compute_dollars.then(|| {
|
||||||
EagerVec::forced_import(
|
EagerVec::forced_import(
|
||||||
db,
|
db,
|
||||||
@@ -630,6 +653,15 @@ impl Vecs {
|
|||||||
)
|
)
|
||||||
.unwrap()
|
.unwrap()
|
||||||
}),
|
}),
|
||||||
|
dateindex_to_spent_output_profit_ratio_30d_ema: compute_dollars.then(|| {
|
||||||
|
EagerVec::forced_import(
|
||||||
|
db,
|
||||||
|
&suffix("spent_output_profit_ratio_30d_ema"),
|
||||||
|
version + VERSION + Version::ZERO,
|
||||||
|
format,
|
||||||
|
)
|
||||||
|
.unwrap()
|
||||||
|
}),
|
||||||
dateindex_to_adjusted_spent_output_profit_ratio: (compute_dollars && compute_adjusted).then(|| {
|
dateindex_to_adjusted_spent_output_profit_ratio: (compute_dollars && compute_adjusted).then(|| {
|
||||||
EagerVec::forced_import(
|
EagerVec::forced_import(
|
||||||
db,
|
db,
|
||||||
@@ -648,6 +680,15 @@ impl Vecs {
|
|||||||
)
|
)
|
||||||
.unwrap()
|
.unwrap()
|
||||||
}),
|
}),
|
||||||
|
dateindex_to_adjusted_spent_output_profit_ratio_30d_ema: (compute_dollars && compute_adjusted).then(|| {
|
||||||
|
EagerVec::forced_import(
|
||||||
|
db,
|
||||||
|
&suffix("adjusted_spent_output_profit_ratio_30d_ema"),
|
||||||
|
version + VERSION + Version::ZERO,
|
||||||
|
format,
|
||||||
|
)
|
||||||
|
.unwrap()
|
||||||
|
}),
|
||||||
height_to_halved_supply_value: ComputedHeightValueVecs::forced_import(
|
height_to_halved_supply_value: ComputedHeightValueVecs::forced_import(
|
||||||
db,
|
db,
|
||||||
&suffix("halved_supply"),
|
&suffix("halved_supply"),
|
||||||
@@ -705,6 +746,39 @@ impl Vecs {
|
|||||||
)
|
)
|
||||||
.unwrap()
|
.unwrap()
|
||||||
}),
|
}),
|
||||||
|
height_to_unrealized_profit_relative_to_market_cap: compute_dollars.then(
|
||||||
|
|| {
|
||||||
|
EagerVec::forced_import(
|
||||||
|
db,
|
||||||
|
&suffix("unrealized_profit_relative_to_market_cap"),
|
||||||
|
version + VERSION + Version::ZERO,
|
||||||
|
format,
|
||||||
|
)
|
||||||
|
.unwrap()
|
||||||
|
},
|
||||||
|
),
|
||||||
|
height_to_unrealized_loss_relative_to_market_cap: compute_dollars.then(
|
||||||
|
|| {
|
||||||
|
EagerVec::forced_import(
|
||||||
|
db,
|
||||||
|
&suffix("unrealized_loss_relative_to_market_cap"),
|
||||||
|
version + VERSION + Version::ZERO,
|
||||||
|
format,
|
||||||
|
)
|
||||||
|
.unwrap()
|
||||||
|
},
|
||||||
|
),
|
||||||
|
height_to_negative_unrealized_loss_relative_to_market_cap: compute_dollars.then(
|
||||||
|
|| {
|
||||||
|
EagerVec::forced_import(
|
||||||
|
db,
|
||||||
|
&suffix("negative_unrealized_loss_relative_to_market_cap"),
|
||||||
|
version + VERSION + Version::ZERO,
|
||||||
|
format,
|
||||||
|
)
|
||||||
|
.unwrap()
|
||||||
|
},
|
||||||
|
),
|
||||||
height_to_net_unrealized_profit_and_loss_relative_to_market_cap: compute_dollars.then(
|
height_to_net_unrealized_profit_and_loss_relative_to_market_cap: compute_dollars.then(
|
||||||
|| {
|
|| {
|
||||||
EagerVec::forced_import(
|
EagerVec::forced_import(
|
||||||
@@ -716,6 +790,45 @@ impl Vecs {
|
|||||||
.unwrap()
|
.unwrap()
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
indexes_to_unrealized_profit_relative_to_market_cap: compute_dollars.then(
|
||||||
|
|| {
|
||||||
|
ComputedVecsFromDateIndex::forced_import(
|
||||||
|
db,
|
||||||
|
&suffix("unrealized_profit_relative_to_market_cap"),
|
||||||
|
Source::Compute,
|
||||||
|
version + VERSION + Version::ONE,
|
||||||
|
indexes,
|
||||||
|
VecBuilderOptions::default().add_last(),
|
||||||
|
)
|
||||||
|
.unwrap()
|
||||||
|
},
|
||||||
|
),
|
||||||
|
indexes_to_unrealized_loss_relative_to_market_cap: compute_dollars.then(
|
||||||
|
|| {
|
||||||
|
ComputedVecsFromDateIndex::forced_import(
|
||||||
|
db,
|
||||||
|
&suffix("unrealized_loss_relative_to_market_cap"),
|
||||||
|
Source::Compute,
|
||||||
|
version + VERSION + Version::ONE,
|
||||||
|
indexes,
|
||||||
|
VecBuilderOptions::default().add_last(),
|
||||||
|
)
|
||||||
|
.unwrap()
|
||||||
|
},
|
||||||
|
),
|
||||||
|
indexes_to_negative_unrealized_loss_relative_to_market_cap: compute_dollars.then(
|
||||||
|
|| {
|
||||||
|
ComputedVecsFromDateIndex::forced_import(
|
||||||
|
db,
|
||||||
|
&suffix("negative_unrealized_loss_relative_to_market_cap"),
|
||||||
|
Source::Compute,
|
||||||
|
version + VERSION + Version::ONE,
|
||||||
|
indexes,
|
||||||
|
VecBuilderOptions::default().add_last(),
|
||||||
|
)
|
||||||
|
.unwrap()
|
||||||
|
},
|
||||||
|
),
|
||||||
indexes_to_net_unrealized_profit_and_loss_relative_to_market_cap: compute_dollars.then(
|
indexes_to_net_unrealized_profit_and_loss_relative_to_market_cap: compute_dollars.then(
|
||||||
|| {
|
|| {
|
||||||
ComputedVecsFromDateIndex::forced_import(
|
ComputedVecsFromDateIndex::forced_import(
|
||||||
@@ -2220,6 +2333,18 @@ impl Vecs {
|
|||||||
exit,
|
exit,
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
|
self.dateindex_to_spent_output_profit_ratio_30d_ema
|
||||||
|
.as_mut()
|
||||||
|
.unwrap()
|
||||||
|
.compute_ema(
|
||||||
|
starting_indexes.dateindex,
|
||||||
|
self.dateindex_to_spent_output_profit_ratio
|
||||||
|
.as_ref()
|
||||||
|
.unwrap(),
|
||||||
|
30,
|
||||||
|
exit,
|
||||||
|
)?;
|
||||||
|
|
||||||
self.dateindex_to_sell_side_risk_ratio
|
self.dateindex_to_sell_side_risk_ratio
|
||||||
.as_mut()
|
.as_mut()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
@@ -2248,6 +2373,16 @@ impl Vecs {
|
|||||||
exit,
|
exit,
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
|
self.dateindex_to_sell_side_risk_ratio_30d_ema
|
||||||
|
.as_mut()
|
||||||
|
.unwrap()
|
||||||
|
.compute_ema(
|
||||||
|
starting_indexes.dateindex,
|
||||||
|
self.dateindex_to_sell_side_risk_ratio.as_ref().unwrap(),
|
||||||
|
30,
|
||||||
|
exit,
|
||||||
|
)?;
|
||||||
|
|
||||||
self.indexes_to_supply_in_profit
|
self.indexes_to_supply_in_profit
|
||||||
.as_mut()
|
.as_mut()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
@@ -2369,6 +2504,33 @@ impl Vecs {
|
|||||||
Ok(())
|
Ok(())
|
||||||
},
|
},
|
||||||
)?;
|
)?;
|
||||||
|
self.height_to_unrealized_profit_relative_to_market_cap
|
||||||
|
.as_mut()
|
||||||
|
.unwrap()
|
||||||
|
.compute_percentage(
|
||||||
|
starting_indexes.height,
|
||||||
|
self.height_to_unrealized_profit.as_ref().unwrap(),
|
||||||
|
&market.height_to_marketcap,
|
||||||
|
exit,
|
||||||
|
)?;
|
||||||
|
self.height_to_unrealized_loss_relative_to_market_cap
|
||||||
|
.as_mut()
|
||||||
|
.unwrap()
|
||||||
|
.compute_percentage(
|
||||||
|
starting_indexes.height,
|
||||||
|
self.height_to_unrealized_loss.as_ref().unwrap(),
|
||||||
|
&market.height_to_marketcap,
|
||||||
|
exit,
|
||||||
|
)?;
|
||||||
|
self.height_to_negative_unrealized_loss_relative_to_market_cap
|
||||||
|
.as_mut()
|
||||||
|
.unwrap()
|
||||||
|
.compute_percentage(
|
||||||
|
starting_indexes.height,
|
||||||
|
self.height_to_negative_unrealized_loss.as_ref().unwrap(),
|
||||||
|
&market.height_to_marketcap,
|
||||||
|
exit,
|
||||||
|
)?;
|
||||||
self.height_to_net_unrealized_profit_and_loss_relative_to_market_cap
|
self.height_to_net_unrealized_profit_and_loss_relative_to_market_cap
|
||||||
.as_mut()
|
.as_mut()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
@@ -2380,6 +2542,65 @@ impl Vecs {
|
|||||||
&market.height_to_marketcap,
|
&market.height_to_marketcap,
|
||||||
exit,
|
exit,
|
||||||
)?;
|
)?;
|
||||||
|
self.indexes_to_unrealized_profit_relative_to_market_cap
|
||||||
|
.as_mut()
|
||||||
|
.unwrap()
|
||||||
|
.compute_all(
|
||||||
|
indexer,
|
||||||
|
indexes,
|
||||||
|
starting_indexes,
|
||||||
|
exit,
|
||||||
|
|vec, _, _, starting_indexes, exit| {
|
||||||
|
vec.compute_percentage(
|
||||||
|
starting_indexes.dateindex,
|
||||||
|
self.dateindex_to_unrealized_profit.as_ref().unwrap(),
|
||||||
|
market.indexes_to_marketcap.dateindex.as_ref().unwrap(),
|
||||||
|
exit,
|
||||||
|
)?;
|
||||||
|
Ok(())
|
||||||
|
},
|
||||||
|
)?;
|
||||||
|
self.indexes_to_unrealized_loss_relative_to_market_cap
|
||||||
|
.as_mut()
|
||||||
|
.unwrap()
|
||||||
|
.compute_all(
|
||||||
|
indexer,
|
||||||
|
indexes,
|
||||||
|
starting_indexes,
|
||||||
|
exit,
|
||||||
|
|vec, _, _, starting_indexes, exit| {
|
||||||
|
vec.compute_percentage(
|
||||||
|
starting_indexes.dateindex,
|
||||||
|
self.dateindex_to_unrealized_loss.as_ref().unwrap(),
|
||||||
|
market.indexes_to_marketcap.dateindex.as_ref().unwrap(),
|
||||||
|
exit,
|
||||||
|
)?;
|
||||||
|
Ok(())
|
||||||
|
},
|
||||||
|
)?;
|
||||||
|
self.indexes_to_negative_unrealized_loss_relative_to_market_cap
|
||||||
|
.as_mut()
|
||||||
|
.unwrap()
|
||||||
|
.compute_all(
|
||||||
|
indexer,
|
||||||
|
indexes,
|
||||||
|
starting_indexes,
|
||||||
|
exit,
|
||||||
|
|vec, _, _, starting_indexes, exit| {
|
||||||
|
vec.compute_percentage(
|
||||||
|
starting_indexes.dateindex,
|
||||||
|
self.indexes_to_negative_unrealized_loss
|
||||||
|
.as_ref()
|
||||||
|
.unwrap()
|
||||||
|
.dateindex
|
||||||
|
.as_ref()
|
||||||
|
.unwrap(),
|
||||||
|
market.indexes_to_marketcap.dateindex.as_ref().unwrap(),
|
||||||
|
exit,
|
||||||
|
)?;
|
||||||
|
Ok(())
|
||||||
|
},
|
||||||
|
)?;
|
||||||
self.indexes_to_net_unrealized_profit_and_loss_relative_to_market_cap
|
self.indexes_to_net_unrealized_profit_and_loss_relative_to_market_cap
|
||||||
.as_mut()
|
.as_mut()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
@@ -2822,6 +3043,18 @@ impl Vecs {
|
|||||||
7,
|
7,
|
||||||
exit,
|
exit,
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
|
self.dateindex_to_adjusted_spent_output_profit_ratio_30d_ema
|
||||||
|
.as_mut()
|
||||||
|
.unwrap()
|
||||||
|
.compute_ema(
|
||||||
|
starting_indexes.dateindex,
|
||||||
|
self.dateindex_to_adjusted_spent_output_profit_ratio
|
||||||
|
.as_ref()
|
||||||
|
.unwrap(),
|
||||||
|
30,
|
||||||
|
exit,
|
||||||
|
)?;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2891,12 +3124,18 @@ impl Vecs {
|
|||||||
self.dateindex_to_spent_output_profit_ratio_7d_ema
|
self.dateindex_to_spent_output_profit_ratio_7d_ema
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.map_or(vec![], |v| vec![v as &dyn AnyCollectableVec]),
|
.map_or(vec![], |v| vec![v as &dyn AnyCollectableVec]),
|
||||||
|
self.dateindex_to_spent_output_profit_ratio_30d_ema
|
||||||
|
.as_ref()
|
||||||
|
.map_or(vec![], |v| vec![v as &dyn AnyCollectableVec]),
|
||||||
self.dateindex_to_adjusted_spent_output_profit_ratio
|
self.dateindex_to_adjusted_spent_output_profit_ratio
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.map_or(vec![], |v| vec![v as &dyn AnyCollectableVec]),
|
.map_or(vec![], |v| vec![v as &dyn AnyCollectableVec]),
|
||||||
self.dateindex_to_adjusted_spent_output_profit_ratio_7d_ema
|
self.dateindex_to_adjusted_spent_output_profit_ratio_7d_ema
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.map_or(vec![], |v| vec![v as &dyn AnyCollectableVec]),
|
.map_or(vec![], |v| vec![v as &dyn AnyCollectableVec]),
|
||||||
|
self.dateindex_to_adjusted_spent_output_profit_ratio_30d_ema
|
||||||
|
.as_ref()
|
||||||
|
.map_or(vec![], |v| vec![v as &dyn AnyCollectableVec]),
|
||||||
self.indexes_to_value_destroyed
|
self.indexes_to_value_destroyed
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.map_or(vec![], |v| v.vecs()),
|
.map_or(vec![], |v| v.vecs()),
|
||||||
@@ -2918,6 +3157,9 @@ impl Vecs {
|
|||||||
self.dateindex_to_sell_side_risk_ratio_7d_ema
|
self.dateindex_to_sell_side_risk_ratio_7d_ema
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.map_or(vec![], |v| vec![v]),
|
.map_or(vec![], |v| vec![v]),
|
||||||
|
self.dateindex_to_sell_side_risk_ratio_30d_ema
|
||||||
|
.as_ref()
|
||||||
|
.map_or(vec![], |v| vec![v]),
|
||||||
self.height_to_supply_in_profit
|
self.height_to_supply_in_profit
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.map_or(vec![], |v| vec![v]),
|
.map_or(vec![], |v| vec![v]),
|
||||||
@@ -2988,9 +3230,27 @@ impl Vecs {
|
|||||||
self.indexes_to_net_unrealized_profit_and_loss
|
self.indexes_to_net_unrealized_profit_and_loss
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.map_or(vec![], |v| v.vecs()),
|
.map_or(vec![], |v| v.vecs()),
|
||||||
|
self.height_to_unrealized_profit_relative_to_market_cap
|
||||||
|
.as_ref()
|
||||||
|
.map_or(vec![], |v| vec![v]),
|
||||||
|
self.height_to_unrealized_loss_relative_to_market_cap
|
||||||
|
.as_ref()
|
||||||
|
.map_or(vec![], |v| vec![v]),
|
||||||
|
self.height_to_negative_unrealized_loss_relative_to_market_cap
|
||||||
|
.as_ref()
|
||||||
|
.map_or(vec![], |v| vec![v]),
|
||||||
self.height_to_net_unrealized_profit_and_loss_relative_to_market_cap
|
self.height_to_net_unrealized_profit_and_loss_relative_to_market_cap
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.map_or(vec![], |v| vec![v]),
|
.map_or(vec![], |v| vec![v]),
|
||||||
|
self.indexes_to_unrealized_profit_relative_to_market_cap
|
||||||
|
.as_ref()
|
||||||
|
.map_or(vec![], |v| v.vecs()),
|
||||||
|
self.indexes_to_unrealized_loss_relative_to_market_cap
|
||||||
|
.as_ref()
|
||||||
|
.map_or(vec![], |v| v.vecs()),
|
||||||
|
self.indexes_to_negative_unrealized_loss_relative_to_market_cap
|
||||||
|
.as_ref()
|
||||||
|
.map_or(vec![], |v| v.vecs()),
|
||||||
self.indexes_to_net_unrealized_profit_and_loss_relative_to_market_cap
|
self.indexes_to_net_unrealized_profit_and_loss_relative_to_market_cap
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.map_or(vec![], |v| v.vecs()),
|
.map_or(vec![], |v| v.vecs()),
|
||||||
|
|||||||
@@ -32,8 +32,8 @@ impl Vecs {
|
|||||||
indexes: &indexes::Vecs,
|
indexes: &indexes::Vecs,
|
||||||
price: Option<&price::Vecs>,
|
price: Option<&price::Vecs>,
|
||||||
states_path: Option<&Path>,
|
states_path: Option<&Path>,
|
||||||
|
extended: bool,
|
||||||
compute_relative_to_all: bool,
|
compute_relative_to_all: bool,
|
||||||
ratio_extended: bool,
|
|
||||||
compute_adjusted: bool,
|
compute_adjusted: bool,
|
||||||
) -> Result<Self> {
|
) -> Result<Self> {
|
||||||
let compute_dollars = price.is_some();
|
let compute_dollars = price.is_some();
|
||||||
@@ -56,8 +56,8 @@ impl Vecs {
|
|||||||
version,
|
version,
|
||||||
indexes,
|
indexes,
|
||||||
price,
|
price,
|
||||||
|
extended,
|
||||||
compute_relative_to_all,
|
compute_relative_to_all,
|
||||||
ratio_extended,
|
|
||||||
compute_adjusted,
|
compute_adjusted,
|
||||||
)?,
|
)?,
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -42,8 +42,8 @@ impl Vecs {
|
|||||||
indexes,
|
indexes,
|
||||||
price,
|
price,
|
||||||
None,
|
None,
|
||||||
false,
|
|
||||||
true,
|
true,
|
||||||
|
false,
|
||||||
true,
|
true,
|
||||||
)?,
|
)?,
|
||||||
term: ByTerm {
|
term: ByTerm {
|
||||||
@@ -143,8 +143,8 @@ impl Vecs {
|
|||||||
indexes,
|
indexes,
|
||||||
price,
|
price,
|
||||||
Some(states_path),
|
Some(states_path),
|
||||||
true,
|
|
||||||
false,
|
false,
|
||||||
|
true,
|
||||||
false,
|
false,
|
||||||
)?,
|
)?,
|
||||||
p2pk33: utxo_cohort::Vecs::forced_import(
|
p2pk33: utxo_cohort::Vecs::forced_import(
|
||||||
@@ -155,8 +155,8 @@ impl Vecs {
|
|||||||
indexes,
|
indexes,
|
||||||
price,
|
price,
|
||||||
Some(states_path),
|
Some(states_path),
|
||||||
true,
|
|
||||||
false,
|
false,
|
||||||
|
true,
|
||||||
false,
|
false,
|
||||||
)?,
|
)?,
|
||||||
p2pkh: utxo_cohort::Vecs::forced_import(
|
p2pkh: utxo_cohort::Vecs::forced_import(
|
||||||
@@ -167,8 +167,8 @@ impl Vecs {
|
|||||||
indexes,
|
indexes,
|
||||||
price,
|
price,
|
||||||
Some(states_path),
|
Some(states_path),
|
||||||
true,
|
|
||||||
false,
|
false,
|
||||||
|
true,
|
||||||
false,
|
false,
|
||||||
)?,
|
)?,
|
||||||
p2sh: utxo_cohort::Vecs::forced_import(
|
p2sh: utxo_cohort::Vecs::forced_import(
|
||||||
@@ -179,8 +179,8 @@ impl Vecs {
|
|||||||
indexes,
|
indexes,
|
||||||
price,
|
price,
|
||||||
Some(states_path),
|
Some(states_path),
|
||||||
true,
|
|
||||||
false,
|
false,
|
||||||
|
true,
|
||||||
false,
|
false,
|
||||||
)?,
|
)?,
|
||||||
p2wpkh: utxo_cohort::Vecs::forced_import(
|
p2wpkh: utxo_cohort::Vecs::forced_import(
|
||||||
@@ -191,8 +191,8 @@ impl Vecs {
|
|||||||
indexes,
|
indexes,
|
||||||
price,
|
price,
|
||||||
Some(states_path),
|
Some(states_path),
|
||||||
true,
|
|
||||||
false,
|
false,
|
||||||
|
true,
|
||||||
false,
|
false,
|
||||||
)?,
|
)?,
|
||||||
p2wsh: utxo_cohort::Vecs::forced_import(
|
p2wsh: utxo_cohort::Vecs::forced_import(
|
||||||
@@ -203,8 +203,8 @@ impl Vecs {
|
|||||||
indexes,
|
indexes,
|
||||||
price,
|
price,
|
||||||
Some(states_path),
|
Some(states_path),
|
||||||
true,
|
|
||||||
false,
|
false,
|
||||||
|
true,
|
||||||
false,
|
false,
|
||||||
)?,
|
)?,
|
||||||
p2tr: utxo_cohort::Vecs::forced_import(
|
p2tr: utxo_cohort::Vecs::forced_import(
|
||||||
@@ -215,8 +215,8 @@ impl Vecs {
|
|||||||
indexes,
|
indexes,
|
||||||
price,
|
price,
|
||||||
Some(states_path),
|
Some(states_path),
|
||||||
true,
|
|
||||||
false,
|
false,
|
||||||
|
true,
|
||||||
false,
|
false,
|
||||||
)?,
|
)?,
|
||||||
p2a: utxo_cohort::Vecs::forced_import(
|
p2a: utxo_cohort::Vecs::forced_import(
|
||||||
@@ -227,8 +227,8 @@ impl Vecs {
|
|||||||
indexes,
|
indexes,
|
||||||
price,
|
price,
|
||||||
Some(states_path),
|
Some(states_path),
|
||||||
true,
|
|
||||||
false,
|
false,
|
||||||
|
true,
|
||||||
false,
|
false,
|
||||||
)?,
|
)?,
|
||||||
p2ms: utxo_cohort::Vecs::forced_import(
|
p2ms: utxo_cohort::Vecs::forced_import(
|
||||||
@@ -239,8 +239,8 @@ impl Vecs {
|
|||||||
indexes,
|
indexes,
|
||||||
price,
|
price,
|
||||||
Some(states_path),
|
Some(states_path),
|
||||||
true,
|
|
||||||
false,
|
false,
|
||||||
|
true,
|
||||||
false,
|
false,
|
||||||
)?,
|
)?,
|
||||||
empty: utxo_cohort::Vecs::forced_import(
|
empty: utxo_cohort::Vecs::forced_import(
|
||||||
@@ -251,8 +251,8 @@ impl Vecs {
|
|||||||
indexes,
|
indexes,
|
||||||
price,
|
price,
|
||||||
Some(states_path),
|
Some(states_path),
|
||||||
true,
|
|
||||||
false,
|
false,
|
||||||
|
true,
|
||||||
false,
|
false,
|
||||||
)?,
|
)?,
|
||||||
unknown: utxo_cohort::Vecs::forced_import(
|
unknown: utxo_cohort::Vecs::forced_import(
|
||||||
@@ -263,8 +263,8 @@ impl Vecs {
|
|||||||
indexes,
|
indexes,
|
||||||
price,
|
price,
|
||||||
Some(states_path),
|
Some(states_path),
|
||||||
true,
|
|
||||||
false,
|
false,
|
||||||
|
true,
|
||||||
false,
|
false,
|
||||||
)?,
|
)?,
|
||||||
},
|
},
|
||||||
@@ -955,8 +955,8 @@ impl Vecs {
|
|||||||
indexes,
|
indexes,
|
||||||
price,
|
price,
|
||||||
Some(states_path),
|
Some(states_path),
|
||||||
true,
|
|
||||||
false,
|
false,
|
||||||
|
true,
|
||||||
false,
|
false,
|
||||||
)?,
|
)?,
|
||||||
_1sat_to_10sats: utxo_cohort::Vecs::forced_import(
|
_1sat_to_10sats: utxo_cohort::Vecs::forced_import(
|
||||||
@@ -967,8 +967,8 @@ impl Vecs {
|
|||||||
indexes,
|
indexes,
|
||||||
price,
|
price,
|
||||||
Some(states_path),
|
Some(states_path),
|
||||||
true,
|
|
||||||
false,
|
false,
|
||||||
|
true,
|
||||||
false,
|
false,
|
||||||
)?,
|
)?,
|
||||||
_10sats_to_100sats: utxo_cohort::Vecs::forced_import(
|
_10sats_to_100sats: utxo_cohort::Vecs::forced_import(
|
||||||
@@ -979,8 +979,8 @@ impl Vecs {
|
|||||||
indexes,
|
indexes,
|
||||||
price,
|
price,
|
||||||
Some(states_path),
|
Some(states_path),
|
||||||
true,
|
|
||||||
false,
|
false,
|
||||||
|
true,
|
||||||
false,
|
false,
|
||||||
)?,
|
)?,
|
||||||
_100sats_to_1k_sats: utxo_cohort::Vecs::forced_import(
|
_100sats_to_1k_sats: utxo_cohort::Vecs::forced_import(
|
||||||
@@ -991,8 +991,8 @@ impl Vecs {
|
|||||||
indexes,
|
indexes,
|
||||||
price,
|
price,
|
||||||
Some(states_path),
|
Some(states_path),
|
||||||
true,
|
|
||||||
false,
|
false,
|
||||||
|
true,
|
||||||
false,
|
false,
|
||||||
)?,
|
)?,
|
||||||
_1k_sats_to_10k_sats: utxo_cohort::Vecs::forced_import(
|
_1k_sats_to_10k_sats: utxo_cohort::Vecs::forced_import(
|
||||||
@@ -1003,8 +1003,8 @@ impl Vecs {
|
|||||||
indexes,
|
indexes,
|
||||||
price,
|
price,
|
||||||
Some(states_path),
|
Some(states_path),
|
||||||
true,
|
|
||||||
false,
|
false,
|
||||||
|
true,
|
||||||
false,
|
false,
|
||||||
)?,
|
)?,
|
||||||
_10k_sats_to_100k_sats: utxo_cohort::Vecs::forced_import(
|
_10k_sats_to_100k_sats: utxo_cohort::Vecs::forced_import(
|
||||||
@@ -1015,8 +1015,8 @@ impl Vecs {
|
|||||||
indexes,
|
indexes,
|
||||||
price,
|
price,
|
||||||
Some(states_path),
|
Some(states_path),
|
||||||
true,
|
|
||||||
false,
|
false,
|
||||||
|
true,
|
||||||
false,
|
false,
|
||||||
)?,
|
)?,
|
||||||
_100k_sats_to_1m_sats: utxo_cohort::Vecs::forced_import(
|
_100k_sats_to_1m_sats: utxo_cohort::Vecs::forced_import(
|
||||||
@@ -1027,8 +1027,8 @@ impl Vecs {
|
|||||||
indexes,
|
indexes,
|
||||||
price,
|
price,
|
||||||
Some(states_path),
|
Some(states_path),
|
||||||
true,
|
|
||||||
false,
|
false,
|
||||||
|
true,
|
||||||
false,
|
false,
|
||||||
)?,
|
)?,
|
||||||
_1m_sats_to_10m_sats: utxo_cohort::Vecs::forced_import(
|
_1m_sats_to_10m_sats: utxo_cohort::Vecs::forced_import(
|
||||||
@@ -1039,8 +1039,8 @@ impl Vecs {
|
|||||||
indexes,
|
indexes,
|
||||||
price,
|
price,
|
||||||
Some(states_path),
|
Some(states_path),
|
||||||
true,
|
|
||||||
false,
|
false,
|
||||||
|
true,
|
||||||
false,
|
false,
|
||||||
)?,
|
)?,
|
||||||
_10m_sats_to_1btc: utxo_cohort::Vecs::forced_import(
|
_10m_sats_to_1btc: utxo_cohort::Vecs::forced_import(
|
||||||
@@ -1051,8 +1051,8 @@ impl Vecs {
|
|||||||
indexes,
|
indexes,
|
||||||
price,
|
price,
|
||||||
Some(states_path),
|
Some(states_path),
|
||||||
true,
|
|
||||||
false,
|
false,
|
||||||
|
true,
|
||||||
false,
|
false,
|
||||||
)?,
|
)?,
|
||||||
_1btc_to_10btc: utxo_cohort::Vecs::forced_import(
|
_1btc_to_10btc: utxo_cohort::Vecs::forced_import(
|
||||||
@@ -1063,8 +1063,8 @@ impl Vecs {
|
|||||||
indexes,
|
indexes,
|
||||||
price,
|
price,
|
||||||
Some(states_path),
|
Some(states_path),
|
||||||
true,
|
|
||||||
false,
|
false,
|
||||||
|
true,
|
||||||
false,
|
false,
|
||||||
)?,
|
)?,
|
||||||
_10btc_to_100btc: utxo_cohort::Vecs::forced_import(
|
_10btc_to_100btc: utxo_cohort::Vecs::forced_import(
|
||||||
@@ -1075,8 +1075,8 @@ impl Vecs {
|
|||||||
indexes,
|
indexes,
|
||||||
price,
|
price,
|
||||||
Some(states_path),
|
Some(states_path),
|
||||||
true,
|
|
||||||
false,
|
false,
|
||||||
|
true,
|
||||||
false,
|
false,
|
||||||
)?,
|
)?,
|
||||||
_100btc_to_1k_btc: utxo_cohort::Vecs::forced_import(
|
_100btc_to_1k_btc: utxo_cohort::Vecs::forced_import(
|
||||||
@@ -1087,8 +1087,8 @@ impl Vecs {
|
|||||||
indexes,
|
indexes,
|
||||||
price,
|
price,
|
||||||
Some(states_path),
|
Some(states_path),
|
||||||
true,
|
|
||||||
false,
|
false,
|
||||||
|
true,
|
||||||
false,
|
false,
|
||||||
)?,
|
)?,
|
||||||
_1k_btc_to_10k_btc: utxo_cohort::Vecs::forced_import(
|
_1k_btc_to_10k_btc: utxo_cohort::Vecs::forced_import(
|
||||||
@@ -1099,8 +1099,8 @@ impl Vecs {
|
|||||||
indexes,
|
indexes,
|
||||||
price,
|
price,
|
||||||
Some(states_path),
|
Some(states_path),
|
||||||
true,
|
|
||||||
false,
|
false,
|
||||||
|
true,
|
||||||
false,
|
false,
|
||||||
)?,
|
)?,
|
||||||
_10k_btc_to_100k_btc: utxo_cohort::Vecs::forced_import(
|
_10k_btc_to_100k_btc: utxo_cohort::Vecs::forced_import(
|
||||||
@@ -1111,8 +1111,8 @@ impl Vecs {
|
|||||||
indexes,
|
indexes,
|
||||||
price,
|
price,
|
||||||
Some(states_path),
|
Some(states_path),
|
||||||
true,
|
|
||||||
false,
|
false,
|
||||||
|
true,
|
||||||
false,
|
false,
|
||||||
)?,
|
)?,
|
||||||
_100k_btc_or_more: utxo_cohort::Vecs::forced_import(
|
_100k_btc_or_more: utxo_cohort::Vecs::forced_import(
|
||||||
@@ -1123,8 +1123,8 @@ impl Vecs {
|
|||||||
indexes,
|
indexes,
|
||||||
price,
|
price,
|
||||||
Some(states_path),
|
Some(states_path),
|
||||||
true,
|
|
||||||
false,
|
false,
|
||||||
|
true,
|
||||||
false,
|
false,
|
||||||
)?,
|
)?,
|
||||||
},
|
},
|
||||||
@@ -1137,8 +1137,8 @@ impl Vecs {
|
|||||||
indexes,
|
indexes,
|
||||||
price,
|
price,
|
||||||
None,
|
None,
|
||||||
true,
|
|
||||||
false,
|
false,
|
||||||
|
true,
|
||||||
false,
|
false,
|
||||||
)?,
|
)?,
|
||||||
_100sats: utxo_cohort::Vecs::forced_import(
|
_100sats: utxo_cohort::Vecs::forced_import(
|
||||||
@@ -1149,8 +1149,8 @@ impl Vecs {
|
|||||||
indexes,
|
indexes,
|
||||||
price,
|
price,
|
||||||
None,
|
None,
|
||||||
true,
|
|
||||||
false,
|
false,
|
||||||
|
true,
|
||||||
false,
|
false,
|
||||||
)?,
|
)?,
|
||||||
_1k_sats: utxo_cohort::Vecs::forced_import(
|
_1k_sats: utxo_cohort::Vecs::forced_import(
|
||||||
@@ -1161,8 +1161,8 @@ impl Vecs {
|
|||||||
indexes,
|
indexes,
|
||||||
price,
|
price,
|
||||||
None,
|
None,
|
||||||
true,
|
|
||||||
false,
|
false,
|
||||||
|
true,
|
||||||
false,
|
false,
|
||||||
)?,
|
)?,
|
||||||
_10k_sats: utxo_cohort::Vecs::forced_import(
|
_10k_sats: utxo_cohort::Vecs::forced_import(
|
||||||
@@ -1173,8 +1173,8 @@ impl Vecs {
|
|||||||
indexes,
|
indexes,
|
||||||
price,
|
price,
|
||||||
None,
|
None,
|
||||||
true,
|
|
||||||
false,
|
false,
|
||||||
|
true,
|
||||||
false,
|
false,
|
||||||
)?,
|
)?,
|
||||||
_100k_sats: utxo_cohort::Vecs::forced_import(
|
_100k_sats: utxo_cohort::Vecs::forced_import(
|
||||||
@@ -1185,8 +1185,8 @@ impl Vecs {
|
|||||||
indexes,
|
indexes,
|
||||||
price,
|
price,
|
||||||
None,
|
None,
|
||||||
true,
|
|
||||||
false,
|
false,
|
||||||
|
true,
|
||||||
false,
|
false,
|
||||||
)?,
|
)?,
|
||||||
_1m_sats: utxo_cohort::Vecs::forced_import(
|
_1m_sats: utxo_cohort::Vecs::forced_import(
|
||||||
@@ -1197,8 +1197,8 @@ impl Vecs {
|
|||||||
indexes,
|
indexes,
|
||||||
price,
|
price,
|
||||||
None,
|
None,
|
||||||
true,
|
|
||||||
false,
|
false,
|
||||||
|
true,
|
||||||
false,
|
false,
|
||||||
)?,
|
)?,
|
||||||
_10m_sats: utxo_cohort::Vecs::forced_import(
|
_10m_sats: utxo_cohort::Vecs::forced_import(
|
||||||
@@ -1209,8 +1209,8 @@ impl Vecs {
|
|||||||
indexes,
|
indexes,
|
||||||
price,
|
price,
|
||||||
None,
|
None,
|
||||||
true,
|
|
||||||
false,
|
false,
|
||||||
|
true,
|
||||||
false,
|
false,
|
||||||
)?,
|
)?,
|
||||||
_1btc: utxo_cohort::Vecs::forced_import(
|
_1btc: utxo_cohort::Vecs::forced_import(
|
||||||
@@ -1221,8 +1221,8 @@ impl Vecs {
|
|||||||
indexes,
|
indexes,
|
||||||
price,
|
price,
|
||||||
None,
|
None,
|
||||||
true,
|
|
||||||
false,
|
false,
|
||||||
|
true,
|
||||||
false,
|
false,
|
||||||
)?,
|
)?,
|
||||||
_10btc: utxo_cohort::Vecs::forced_import(
|
_10btc: utxo_cohort::Vecs::forced_import(
|
||||||
@@ -1233,8 +1233,8 @@ impl Vecs {
|
|||||||
indexes,
|
indexes,
|
||||||
price,
|
price,
|
||||||
None,
|
None,
|
||||||
true,
|
|
||||||
false,
|
false,
|
||||||
|
true,
|
||||||
false,
|
false,
|
||||||
)?,
|
)?,
|
||||||
_100btc: utxo_cohort::Vecs::forced_import(
|
_100btc: utxo_cohort::Vecs::forced_import(
|
||||||
@@ -1245,8 +1245,8 @@ impl Vecs {
|
|||||||
indexes,
|
indexes,
|
||||||
price,
|
price,
|
||||||
None,
|
None,
|
||||||
true,
|
|
||||||
false,
|
false,
|
||||||
|
true,
|
||||||
false,
|
false,
|
||||||
)?,
|
)?,
|
||||||
_1k_btc: utxo_cohort::Vecs::forced_import(
|
_1k_btc: utxo_cohort::Vecs::forced_import(
|
||||||
@@ -1257,8 +1257,8 @@ impl Vecs {
|
|||||||
indexes,
|
indexes,
|
||||||
price,
|
price,
|
||||||
None,
|
None,
|
||||||
true,
|
|
||||||
false,
|
false,
|
||||||
|
true,
|
||||||
false,
|
false,
|
||||||
)?,
|
)?,
|
||||||
_10k_btc: utxo_cohort::Vecs::forced_import(
|
_10k_btc: utxo_cohort::Vecs::forced_import(
|
||||||
@@ -1269,8 +1269,8 @@ impl Vecs {
|
|||||||
indexes,
|
indexes,
|
||||||
price,
|
price,
|
||||||
None,
|
None,
|
||||||
true,
|
|
||||||
false,
|
false,
|
||||||
|
true,
|
||||||
false,
|
false,
|
||||||
)?,
|
)?,
|
||||||
_100k_btc: utxo_cohort::Vecs::forced_import(
|
_100k_btc: utxo_cohort::Vecs::forced_import(
|
||||||
@@ -1281,8 +1281,8 @@ impl Vecs {
|
|||||||
indexes,
|
indexes,
|
||||||
price,
|
price,
|
||||||
None,
|
None,
|
||||||
true,
|
|
||||||
false,
|
false,
|
||||||
|
true,
|
||||||
false,
|
false,
|
||||||
)?,
|
)?,
|
||||||
},
|
},
|
||||||
@@ -1295,8 +1295,8 @@ impl Vecs {
|
|||||||
indexes,
|
indexes,
|
||||||
price,
|
price,
|
||||||
None,
|
None,
|
||||||
true,
|
|
||||||
false,
|
false,
|
||||||
|
true,
|
||||||
false,
|
false,
|
||||||
)?,
|
)?,
|
||||||
_10sats: utxo_cohort::Vecs::forced_import(
|
_10sats: utxo_cohort::Vecs::forced_import(
|
||||||
@@ -1307,8 +1307,8 @@ impl Vecs {
|
|||||||
indexes,
|
indexes,
|
||||||
price,
|
price,
|
||||||
None,
|
None,
|
||||||
true,
|
|
||||||
false,
|
false,
|
||||||
|
true,
|
||||||
false,
|
false,
|
||||||
)?,
|
)?,
|
||||||
_100sats: utxo_cohort::Vecs::forced_import(
|
_100sats: utxo_cohort::Vecs::forced_import(
|
||||||
@@ -1319,8 +1319,8 @@ impl Vecs {
|
|||||||
indexes,
|
indexes,
|
||||||
price,
|
price,
|
||||||
None,
|
None,
|
||||||
true,
|
|
||||||
false,
|
false,
|
||||||
|
true,
|
||||||
false,
|
false,
|
||||||
)?,
|
)?,
|
||||||
_1k_sats: utxo_cohort::Vecs::forced_import(
|
_1k_sats: utxo_cohort::Vecs::forced_import(
|
||||||
@@ -1331,8 +1331,8 @@ impl Vecs {
|
|||||||
indexes,
|
indexes,
|
||||||
price,
|
price,
|
||||||
None,
|
None,
|
||||||
true,
|
|
||||||
false,
|
false,
|
||||||
|
true,
|
||||||
false,
|
false,
|
||||||
)?,
|
)?,
|
||||||
_10k_sats: utxo_cohort::Vecs::forced_import(
|
_10k_sats: utxo_cohort::Vecs::forced_import(
|
||||||
@@ -1343,8 +1343,8 @@ impl Vecs {
|
|||||||
indexes,
|
indexes,
|
||||||
price,
|
price,
|
||||||
None,
|
None,
|
||||||
true,
|
|
||||||
false,
|
false,
|
||||||
|
true,
|
||||||
false,
|
false,
|
||||||
)?,
|
)?,
|
||||||
_100k_sats: utxo_cohort::Vecs::forced_import(
|
_100k_sats: utxo_cohort::Vecs::forced_import(
|
||||||
@@ -1355,8 +1355,8 @@ impl Vecs {
|
|||||||
indexes,
|
indexes,
|
||||||
price,
|
price,
|
||||||
None,
|
None,
|
||||||
true,
|
|
||||||
false,
|
false,
|
||||||
|
true,
|
||||||
false,
|
false,
|
||||||
)?,
|
)?,
|
||||||
_1m_sats: utxo_cohort::Vecs::forced_import(
|
_1m_sats: utxo_cohort::Vecs::forced_import(
|
||||||
@@ -1367,8 +1367,8 @@ impl Vecs {
|
|||||||
indexes,
|
indexes,
|
||||||
price,
|
price,
|
||||||
None,
|
None,
|
||||||
true,
|
|
||||||
false,
|
false,
|
||||||
|
true,
|
||||||
false,
|
false,
|
||||||
)?,
|
)?,
|
||||||
_10m_sats: utxo_cohort::Vecs::forced_import(
|
_10m_sats: utxo_cohort::Vecs::forced_import(
|
||||||
@@ -1379,8 +1379,8 @@ impl Vecs {
|
|||||||
indexes,
|
indexes,
|
||||||
price,
|
price,
|
||||||
None,
|
None,
|
||||||
true,
|
|
||||||
false,
|
false,
|
||||||
|
true,
|
||||||
false,
|
false,
|
||||||
)?,
|
)?,
|
||||||
_1btc: utxo_cohort::Vecs::forced_import(
|
_1btc: utxo_cohort::Vecs::forced_import(
|
||||||
@@ -1391,8 +1391,8 @@ impl Vecs {
|
|||||||
indexes,
|
indexes,
|
||||||
price,
|
price,
|
||||||
None,
|
None,
|
||||||
true,
|
|
||||||
false,
|
false,
|
||||||
|
true,
|
||||||
false,
|
false,
|
||||||
)?,
|
)?,
|
||||||
_10btc: utxo_cohort::Vecs::forced_import(
|
_10btc: utxo_cohort::Vecs::forced_import(
|
||||||
@@ -1403,8 +1403,8 @@ impl Vecs {
|
|||||||
indexes,
|
indexes,
|
||||||
price,
|
price,
|
||||||
None,
|
None,
|
||||||
true,
|
|
||||||
false,
|
false,
|
||||||
|
true,
|
||||||
false,
|
false,
|
||||||
)?,
|
)?,
|
||||||
_100btc: utxo_cohort::Vecs::forced_import(
|
_100btc: utxo_cohort::Vecs::forced_import(
|
||||||
@@ -1415,8 +1415,8 @@ impl Vecs {
|
|||||||
indexes,
|
indexes,
|
||||||
price,
|
price,
|
||||||
None,
|
None,
|
||||||
true,
|
|
||||||
false,
|
false,
|
||||||
|
true,
|
||||||
false,
|
false,
|
||||||
)?,
|
)?,
|
||||||
_1k_btc: utxo_cohort::Vecs::forced_import(
|
_1k_btc: utxo_cohort::Vecs::forced_import(
|
||||||
@@ -1427,8 +1427,8 @@ impl Vecs {
|
|||||||
indexes,
|
indexes,
|
||||||
price,
|
price,
|
||||||
None,
|
None,
|
||||||
true,
|
|
||||||
false,
|
false,
|
||||||
|
true,
|
||||||
false,
|
false,
|
||||||
)?,
|
)?,
|
||||||
_10k_btc: utxo_cohort::Vecs::forced_import(
|
_10k_btc: utxo_cohort::Vecs::forced_import(
|
||||||
@@ -1439,8 +1439,8 @@ impl Vecs {
|
|||||||
indexes,
|
indexes,
|
||||||
price,
|
price,
|
||||||
None,
|
None,
|
||||||
true,
|
|
||||||
false,
|
false,
|
||||||
|
true,
|
||||||
false,
|
false,
|
||||||
)?,
|
)?,
|
||||||
},
|
},
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 4.8 KiB |
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 511 B After Width: | Height: | Size: 511 B |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 6.5 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 9.3 KiB After Width: | Height: | Size: 9.3 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 6.5 KiB |
|
Before Width: | Height: | Size: 9.3 KiB After Width: | Height: | Size: 9.3 KiB |
|
Before Width: | Height: | Size: 594 B After Width: | Height: | Size: 594 B |
|
Before Width: | Height: | Size: 562 B After Width: | Height: | Size: 562 B |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
@@ -2,7 +2,7 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<meta name="description" content="Bitcoin with X-ray vision" />
|
<meta name="description" content="Bitcoin transparency, amplified" />
|
||||||
<meta
|
<meta
|
||||||
name="viewport"
|
name="viewport"
|
||||||
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"
|
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"
|
||||||
@@ -449,7 +449,7 @@
|
|||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
font-size: var(--font-size-xl);
|
font-size: var(--font-size-xl);
|
||||||
line-height: var(--line-height-xl);
|
line-height: var(--line-height-xl);
|
||||||
font-weight: 325;
|
font-weight: 350;
|
||||||
}
|
}
|
||||||
|
|
||||||
h3 {
|
h3 {
|
||||||
@@ -1745,7 +1745,9 @@
|
|||||||
<div class="shadow-bottom"></div>
|
<div class="shadow-bottom"></div>
|
||||||
<div id="resize-bar"></div>
|
<div id="resize-bar"></div>
|
||||||
|
|
||||||
<nav id="nav" hidden></nav>
|
<nav id="nav" hidden>
|
||||||
|
<!-- <h4>bitview</h4> -->
|
||||||
|
</nav>
|
||||||
|
|
||||||
<search id="search" hidden>
|
<search id="search" hidden>
|
||||||
<header>
|
<header>
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "Bitcoin Research Kit",
|
"name": "bitview",
|
||||||
"short_name": "₿RK",
|
"short_name": "bitview",
|
||||||
"description": "A better, FOSS, Bitcoin-only, self-hostable Glassnode",
|
"description": "Bitcoin transparency, amplified",
|
||||||
"categories": [
|
"categories": [
|
||||||
"bitcoin",
|
"bitcoin",
|
||||||
"on-chain",
|
"on-chain",
|
||||||
@@ -113,13 +113,15 @@ export function init({
|
|||||||
chartBottomRightCanvas.replaceWith(screenshotButton);
|
chartBottomRightCanvas.replaceWith(screenshotButton);
|
||||||
screenshotButton.addEventListener("click", () => {
|
screenshotButton.addEventListener("click", () => {
|
||||||
packages.modernScreenshot().then(async ({ screenshot }) => {
|
packages.modernScreenshot().then(async ({ screenshot }) => {
|
||||||
elements.body.dataset.screenshot = "true";
|
charts.dataset.screenshot = "true";
|
||||||
charts.append(domain);
|
charts.append(domain);
|
||||||
seriesTypeField.hidden = true;
|
seriesTypeField.hidden = true;
|
||||||
await screenshot(charts);
|
try {
|
||||||
|
await screenshot(charts);
|
||||||
|
} catch {}
|
||||||
charts.removeChild(domain);
|
charts.removeChild(domain);
|
||||||
seriesTypeField.hidden = false;
|
seriesTypeField.hidden = false;
|
||||||
elements.body.dataset.screenshot = "false";
|
charts.dataset.screenshot = "false";
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -24,7 +24,6 @@
|
|||||||
* "Gigabytes" |
|
* "Gigabytes" |
|
||||||
* "Hash" |
|
* "Hash" |
|
||||||
* "Index" |
|
* "Index" |
|
||||||
* "mb" |
|
|
||||||
* "percentage" |
|
* "percentage" |
|
||||||
* "Ratio" |
|
* "Ratio" |
|
||||||
* "Sats" |
|
* "Sats" |
|
||||||
@@ -854,7 +853,11 @@ function createUtils() {
|
|||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
(!unit || thoroughUnitCheck) &&
|
(!unit || thoroughUnitCheck) &&
|
||||||
(id === "txid" || (id.endsWith("bytes") && !id.endsWith("vbytes")))
|
(id === "txid" ||
|
||||||
|
(id.endsWith("bytes") && !id.endsWith("vbytes")) ||
|
||||||
|
id.endsWith("base_size") ||
|
||||||
|
id.endsWith("total_size") ||
|
||||||
|
id.includes("block_size"))
|
||||||
) {
|
) {
|
||||||
if (unit) throw Error(`Unit "${unit}" already assigned "${id}"`);
|
if (unit) throw Error(`Unit "${unit}" already assigned "${id}"`);
|
||||||
unit = "Bytes";
|
unit = "Bytes";
|
||||||
@@ -863,15 +866,6 @@ function createUtils() {
|
|||||||
if (unit) throw Error(`Unit "${unit}" already assigned "${id}"`);
|
if (unit) throw Error(`Unit "${unit}" already assigned "${id}"`);
|
||||||
unit = "sd";
|
unit = "sd";
|
||||||
}
|
}
|
||||||
if (
|
|
||||||
(!unit || thoroughUnitCheck) &&
|
|
||||||
(id.endsWith("_size") ||
|
|
||||||
id.endsWith("_size_sum") ||
|
|
||||||
id.endsWith("_size_cumulative"))
|
|
||||||
) {
|
|
||||||
if (unit) throw Error(`Unit "${unit}" already assigned "${id}"`);
|
|
||||||
unit = "mb";
|
|
||||||
}
|
|
||||||
if (
|
if (
|
||||||
(!unit || thoroughUnitCheck) &&
|
(!unit || thoroughUnitCheck) &&
|
||||||
(id.includes("vsize") || id.includes("vbytes"))
|
(id.includes("vsize") || id.includes("vbytes"))
|
||||||
@@ -1183,7 +1183,7 @@ function createPartialOptions({ env, colors, vecIdToIndexes }) {
|
|||||||
*/
|
*/
|
||||||
function createSumSeries({ key, title = "", color }) {
|
function createSumSeries({ key, title = "", color }) {
|
||||||
return /** @satisfies {AnyFetchedSeriesBlueprint} */ ({
|
return /** @satisfies {AnyFetchedSeriesBlueprint} */ ({
|
||||||
key,
|
key: key in vecIdToIndexes ? key : `${key}_sum`,
|
||||||
title: `Sum ${title}`,
|
title: `Sum ${title}`,
|
||||||
color: color ?? colors.orange,
|
color: color ?? colors.orange,
|
||||||
});
|
});
|
||||||
@@ -1256,14 +1256,23 @@ function createPartialOptions({ env, colors, vecIdToIndexes }) {
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {VecIdAverageBase & CumulativeVecIdBase & VecIdMinBase & VecIdMaxBase & VecId90pBase & VecId75pBase & VecIdMedianBase & VecId25pBase & VecId10pBase} key
|
||||||
|
*/
|
||||||
|
function createSumCumulativeMinMaxPercentilesSeries(key) {
|
||||||
|
return [
|
||||||
|
...createSumCumulativeSeries({ concat: key }),
|
||||||
|
...createMinMaxPercentilesSeries({ concat: key }),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {VecIdAverageBase & CumulativeVecIdBase & VecIdMinBase & VecIdMaxBase & VecId90pBase & VecId75pBase & VecIdMedianBase & VecId25pBase & VecId10pBase} key
|
* @param {VecIdAverageBase & CumulativeVecIdBase & VecIdMinBase & VecIdMaxBase & VecId90pBase & VecId75pBase & VecIdMedianBase & VecId25pBase & VecId10pBase} key
|
||||||
*/
|
*/
|
||||||
function createAverageSumCumulativeMinMaxPercentilesSeries(key) {
|
function createAverageSumCumulativeMinMaxPercentilesSeries(key) {
|
||||||
return [
|
return [
|
||||||
createAverageSeries({ concat: key }),
|
createAverageSeries({ concat: key }),
|
||||||
...createSumCumulativeSeries({ concat: key }),
|
...createSumCumulativeMinMaxPercentilesSeries(key),
|
||||||
...createMinMaxPercentilesSeries({ concat: key }),
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2279,6 +2288,22 @@ function createPartialOptions({ env, colors, vecIdToIndexes }) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
|
...(asoprKey in vecIdToIndexes
|
||||||
|
? [
|
||||||
|
/** @satisfies {FetchedBaselineSeriesBlueprint} */ ({
|
||||||
|
type: "Baseline",
|
||||||
|
key: asoprKey,
|
||||||
|
title: "adjusted",
|
||||||
|
colors: [colors.yellow, colors.fuchsia],
|
||||||
|
defaultActive: false,
|
||||||
|
options: {
|
||||||
|
baseValue: {
|
||||||
|
price: 1,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
]
|
||||||
|
: []),
|
||||||
/** @satisfies {FetchedBaselineSeriesBlueprint} */ ({
|
/** @satisfies {FetchedBaselineSeriesBlueprint} */ ({
|
||||||
type: "Baseline",
|
type: "Baseline",
|
||||||
key: `${soprKey}_7d_ema`,
|
key: `${soprKey}_7d_ema`,
|
||||||
@@ -2295,9 +2320,9 @@ function createPartialOptions({ env, colors, vecIdToIndexes }) {
|
|||||||
? [
|
? [
|
||||||
/** @satisfies {FetchedBaselineSeriesBlueprint} */ ({
|
/** @satisfies {FetchedBaselineSeriesBlueprint} */ ({
|
||||||
type: "Baseline",
|
type: "Baseline",
|
||||||
key: asoprKey,
|
key: `${asoprKey}_7d_ema`,
|
||||||
title: "adjusted",
|
title: "adj. 7d ema",
|
||||||
colors: [colors.avocado, colors.pink],
|
colors: [colors.amber, colors.purple],
|
||||||
defaultActive: false,
|
defaultActive: false,
|
||||||
options: {
|
options: {
|
||||||
baseValue: {
|
baseValue: {
|
||||||
@@ -2305,11 +2330,27 @@ function createPartialOptions({ env, colors, vecIdToIndexes }) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
|
]
|
||||||
|
: []),
|
||||||
|
/** @satisfies {FetchedBaselineSeriesBlueprint} */ ({
|
||||||
|
type: "Baseline",
|
||||||
|
key: `${soprKey}_30d_ema`,
|
||||||
|
title: "30d ema",
|
||||||
|
colors: [colors.avocado, colors.pink],
|
||||||
|
defaultActive: false,
|
||||||
|
options: {
|
||||||
|
baseValue: {
|
||||||
|
price: 1,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
...(asoprKey in vecIdToIndexes
|
||||||
|
? [
|
||||||
/** @satisfies {FetchedBaselineSeriesBlueprint} */ ({
|
/** @satisfies {FetchedBaselineSeriesBlueprint} */ ({
|
||||||
type: "Baseline",
|
type: "Baseline",
|
||||||
key: `${asoprKey}_7d_ema`,
|
key: `${asoprKey}_30d_ema`,
|
||||||
title: "adj. 7d ema",
|
title: "adj. 30d ema",
|
||||||
colors: [colors.yellow, colors.fuchsia],
|
colors: [colors.orange, colors.violet],
|
||||||
defaultActive: false,
|
defaultActive: false,
|
||||||
options: {
|
options: {
|
||||||
baseValue: {
|
baseValue: {
|
||||||
@@ -2577,6 +2618,12 @@ function createPartialOptions({ env, colors, vecIdToIndexes }) {
|
|||||||
color: colors.red,
|
color: colors.red,
|
||||||
defaultActive: false,
|
defaultActive: false,
|
||||||
}),
|
}),
|
||||||
|
createBaseSeries({
|
||||||
|
key: `${fixKey(key)}sell_side_risk_ratio_30d_ema`,
|
||||||
|
name: "30d ema",
|
||||||
|
color: colors.rose,
|
||||||
|
defaultActive: false,
|
||||||
|
}),
|
||||||
])
|
])
|
||||||
: list.flatMap(({ color, name, key }) => [
|
: list.flatMap(({ color, name, key }) => [
|
||||||
createBaseSeries({
|
createBaseSeries({
|
||||||
@@ -2613,10 +2660,30 @@ function createPartialOptions({ env, colors, vecIdToIndexes }) {
|
|||||||
name: "Negative Loss",
|
name: "Negative Loss",
|
||||||
color: colors.red,
|
color: colors.red,
|
||||||
}),
|
}),
|
||||||
|
createBaseSeries({
|
||||||
|
key: `${fixKey(args.key)}unrealized_profit_relative_to_market_cap`,
|
||||||
|
name: "Profit",
|
||||||
|
color: colors.green,
|
||||||
|
}),
|
||||||
|
createBaseSeries({
|
||||||
|
key: `${fixKey(args.key)}unrealized_loss_relative_to_market_cap`,
|
||||||
|
name: "Loss",
|
||||||
|
color: colors.red,
|
||||||
|
defaultActive: false,
|
||||||
|
}),
|
||||||
|
createBaseSeries({
|
||||||
|
key: `${fixKey(args.key)}negative_unrealized_loss_relative_to_market_cap`,
|
||||||
|
name: "Negative Loss",
|
||||||
|
color: colors.red,
|
||||||
|
}),
|
||||||
createPriceLine({
|
createPriceLine({
|
||||||
unit: "USD",
|
unit: "USD",
|
||||||
defaultActive: false,
|
defaultActive: false,
|
||||||
}),
|
}),
|
||||||
|
createPriceLine({
|
||||||
|
unit: "%mcap",
|
||||||
|
defaultActive: false,
|
||||||
|
}),
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
@@ -3270,33 +3337,29 @@ function createPartialOptions({ env, colors, vecIdToIndexes }) {
|
|||||||
bottom: [
|
bottom: [
|
||||||
createBaseSeries({
|
createBaseSeries({
|
||||||
key: "total_size",
|
key: "total_size",
|
||||||
name: "Size",
|
name: "raw",
|
||||||
}),
|
|
||||||
...createSumCumulativeSeries({
|
|
||||||
concat: "block_size",
|
|
||||||
}),
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "Bytes",
|
|
||||||
title: "Block Bytes",
|
|
||||||
bottom: [
|
|
||||||
createBaseSeries({
|
|
||||||
key: "weight",
|
|
||||||
name: "Weight",
|
|
||||||
}),
|
|
||||||
...createSumCumulativeSeries({
|
|
||||||
concat: "block_weight",
|
|
||||||
common: "weight",
|
|
||||||
}),
|
}),
|
||||||
createBaseSeries({
|
createBaseSeries({
|
||||||
key: "vbytes",
|
key: "vbytes",
|
||||||
name: "Vbytes",
|
name: "raw",
|
||||||
}),
|
}),
|
||||||
...createSumCumulativeSeries({
|
createBaseSeries({
|
||||||
concat: "block_vbytes",
|
key: "weight",
|
||||||
common: "Vbytes",
|
name: "raw",
|
||||||
}),
|
}),
|
||||||
|
// createBaseSeries({
|
||||||
|
// key: "weight",
|
||||||
|
// name: "Weight",
|
||||||
|
// }),
|
||||||
|
...createAverageSumCumulativeMinMaxPercentilesSeries(
|
||||||
|
"block_size",
|
||||||
|
),
|
||||||
|
...createAverageSumCumulativeMinMaxPercentilesSeries(
|
||||||
|
"block_weight",
|
||||||
|
),
|
||||||
|
...createAverageSumCumulativeMinMaxPercentilesSeries(
|
||||||
|
"block_vbytes",
|
||||||
|
),
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
@@ -3313,8 +3376,8 @@ function createPartialOptions({ env, colors, vecIdToIndexes }) {
|
|||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Bytes",
|
name: "Size",
|
||||||
title: "Transaction Bytes",
|
title: "Transaction Size",
|
||||||
bottom: [
|
bottom: [
|
||||||
createAverageSeries({ concat: "tx_weight", title: "Weight" }),
|
createAverageSeries({ concat: "tx_weight", title: "Weight" }),
|
||||||
...createMinMaxPercentilesSeries({
|
...createMinMaxPercentilesSeries({
|
||||||
@@ -1,491 +0,0 @@
|
|||||||
declare module 'lean-qr' {
|
|
||||||
interface ImageDataLike {
|
|
||||||
readonly data: Uint8ClampedArray;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface Context2DLike<DataT extends ImageDataLike> {
|
|
||||||
createImageData(width: number, height: number): DataT;
|
|
||||||
putImageData(data: DataT, x: number, y: number): void;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface CanvasLike<DataT extends ImageDataLike> {
|
|
||||||
width: number;
|
|
||||||
height: number;
|
|
||||||
getContext(type: '2d'): Context2DLike<DataT> | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A colour in `[red, green, blue, alpha]` format (all values from 0 to 255).
|
|
||||||
* If alpha is omitted, it is assumed to be 255 (opaque).
|
|
||||||
*/
|
|
||||||
export type RGBA = readonly [number, number, number, number?];
|
|
||||||
|
|
||||||
export interface Bitmap1D {
|
|
||||||
/**
|
|
||||||
* Appends a sequence of bits.
|
|
||||||
*
|
|
||||||
* @param value an integer containing the bits to append (big endian).
|
|
||||||
* @param bits the number of bits to read from `value`. Must be between 1 and 24.
|
|
||||||
*/
|
|
||||||
push(value: number, bits: number): void;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface StringOptions {
|
|
||||||
/** the text to use for modules which are 'on' (typically black) */
|
|
||||||
on?: string;
|
|
||||||
|
|
||||||
/** the text to use for modules which are 'off' (typically white) */
|
|
||||||
off?: string;
|
|
||||||
|
|
||||||
/** the text to use for linefeeds between rows */
|
|
||||||
lf?: string;
|
|
||||||
|
|
||||||
/** the padding to apply on the left and right of the output (populated with 'off' modules) */
|
|
||||||
padX?: number;
|
|
||||||
|
|
||||||
/** the padding to apply on the top and bottom of the output (populated with 'off' modules) */
|
|
||||||
padY?: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ImageDataOptions {
|
|
||||||
/** the colour to use for modules which are 'on' (typically black) */
|
|
||||||
on?: RGBA;
|
|
||||||
|
|
||||||
/** the colour to use for modules which are 'off' (typically white) */
|
|
||||||
off?: RGBA;
|
|
||||||
|
|
||||||
/** the padding to apply on the left and right of the output (filled with 'off') */
|
|
||||||
padX?: number;
|
|
||||||
|
|
||||||
/** the padding to apply on the top and bottom of the output (filled with 'off') */
|
|
||||||
padY?: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface Bitmap2D {
|
|
||||||
/** the width / height of the QR code in modules (excluding any padding) */
|
|
||||||
readonly size: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Read the state of a module from the QR code.
|
|
||||||
*
|
|
||||||
* @param x the x coordinate to read. Can be negative / out of bounds.
|
|
||||||
* @param y the y coordinate to read. Can be negative / out of bounds.
|
|
||||||
* @returns true if the requested module is set (i.e. typically black)
|
|
||||||
*/
|
|
||||||
get(x: number, y: number): boolean;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Generate a string containing the QR code, suitable for displaying in a
|
|
||||||
* terminal environment. Generally, you should customise on and off to use
|
|
||||||
* the ANSI escapes of your target terminal for better rendering.
|
|
||||||
*
|
|
||||||
* @param options optional configuration for the display.
|
|
||||||
*/
|
|
||||||
toString(options?: Readonly<StringOptions>): string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Generate image data containing the QR code, at a scale of 1 pixel per
|
|
||||||
* module. Use this if you need more control than toCanvas allows.
|
|
||||||
*
|
|
||||||
* @param context a context to use for creating the image data.
|
|
||||||
* @param options optional configuration for the display.
|
|
||||||
*/
|
|
||||||
toImageData<DataT extends ImageDataLike>(
|
|
||||||
context: Context2DLike<DataT>,
|
|
||||||
options?: Readonly<ImageDataOptions>,
|
|
||||||
): DataT;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Generate a `data:image/*` URL for the QR code.
|
|
||||||
*
|
|
||||||
* @param options optional configuration for the output.
|
|
||||||
* @returns a string suitable for use as the `src` of an `img` tag.
|
|
||||||
*/
|
|
||||||
toDataURL(
|
|
||||||
options?: Readonly<
|
|
||||||
ImageDataOptions & {
|
|
||||||
type?: `image/${string}`;
|
|
||||||
scale?: number;
|
|
||||||
}
|
|
||||||
>,
|
|
||||||
): string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Populate a given canvas with the QR code, at a scale of 1 pixel per
|
|
||||||
* module. Set image-rendering: pixelated and scale the canvas using CSS
|
|
||||||
* for a large image. Automatically resizes the canvas to fit the QR code
|
|
||||||
* if necessary.
|
|
||||||
*
|
|
||||||
* @param canvas the canvas to populate.
|
|
||||||
* @param options optional configuration for the display.
|
|
||||||
*/
|
|
||||||
toCanvas(
|
|
||||||
canvas: CanvasLike<ImageDataLike>,
|
|
||||||
options?: Readonly<ImageDataOptions>,
|
|
||||||
): void;
|
|
||||||
}
|
|
||||||
|
|
||||||
export type Mask = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7;
|
|
||||||
export type Mode = (data: Bitmap1D, version: number) => void;
|
|
||||||
export interface ModeFactory {
|
|
||||||
(value: string): Mode;
|
|
||||||
/** a function which returns true when given a character which the current mode can represent */
|
|
||||||
test(string: string): boolean;
|
|
||||||
/** a function which returns an estimate of the number of bits required to encode a given value */
|
|
||||||
est(value: string, version: number): number;
|
|
||||||
/** an optional ECI which must be active for this mode to be interpreted correctly by a reader */
|
|
||||||
eci?: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface ModeAutoOptions {
|
|
||||||
/** a list of modes which can be considered when encoding a message */
|
|
||||||
modes?: ReadonlyArray<ModeFactory>;
|
|
||||||
}
|
|
||||||
|
|
||||||
export const mode: Readonly<{
|
|
||||||
/** automatically picks the most optimal combination of modes for the requested message */
|
|
||||||
auto(value: string, options?: Readonly<ModeAutoOptions>): Mode;
|
|
||||||
/** concatenates multiple modes together */
|
|
||||||
multi(...modes: ReadonlyArray<Mode>): Mode;
|
|
||||||
/** sets the Extended Channel Interpretation for the message from this point onwards */
|
|
||||||
eci(id: number): Mode;
|
|
||||||
/** supports `0-9` and stores 3 characters per 10 bits */
|
|
||||||
numeric: ModeFactory;
|
|
||||||
/** supports `0-9A-Z $%*+-./:` and stores 2 characters per 11 bits */
|
|
||||||
alphaNumeric: ModeFactory;
|
|
||||||
/** arbitrary byte data, typically combined with `eci` */
|
|
||||||
bytes(data: Uint8Array | ReadonlyArray<number>): Mode;
|
|
||||||
/** supports 7-bit ASCII and stores 1 character per 8 bits with no ECI */
|
|
||||||
ascii: ModeFactory;
|
|
||||||
/** supports 8-bit ISO-8859-1 and stores 1 character per 8 bits with ECI 3 */
|
|
||||||
iso8859_1: ModeFactory;
|
|
||||||
/** supports double-byte Shift-JIS characters stores 1 character per 13 bits */
|
|
||||||
shift_jis: ModeFactory;
|
|
||||||
/** supports variable length UTF-8 with ECI 26 */
|
|
||||||
utf8: ModeFactory;
|
|
||||||
}>;
|
|
||||||
|
|
||||||
export type Correction = number & { readonly _: unique symbol };
|
|
||||||
export const correction: Readonly<{
|
|
||||||
/** minimum possible correction level (same as L) */
|
|
||||||
min: Correction;
|
|
||||||
/** ~7.5% error tolerance, ~25% data overhead */
|
|
||||||
L: Correction;
|
|
||||||
/** ~15% error tolerance, ~60% data overhead */
|
|
||||||
M: Correction;
|
|
||||||
/** ~22.5% error tolerance, ~120% data overhead */
|
|
||||||
Q: Correction;
|
|
||||||
/** ~30% error tolerance, ~190% data overhead */
|
|
||||||
H: Correction;
|
|
||||||
/** maximum possible correction level (same as H) */
|
|
||||||
max: Correction;
|
|
||||||
}>;
|
|
||||||
|
|
||||||
export interface GenerateOptions extends ModeAutoOptions {
|
|
||||||
/** the minimum correction level to use (higher levels may still be used if the chosen version has space) */
|
|
||||||
minCorrectionLevel?: Correction;
|
|
||||||
/** the maximum correction level to use */
|
|
||||||
maxCorrectionLevel?: Correction;
|
|
||||||
/** the minimum version (size) of code to generate (must be between 1 and 40) */
|
|
||||||
minVersion?: number;
|
|
||||||
/** the maximum version (size) of code to generate (must be between 1 and 40) */
|
|
||||||
maxVersion?: number;
|
|
||||||
/** a mask to use on the QR code (should be left as `null` for ISO compliance but may be changed for artistic effect) */
|
|
||||||
mask?: null | Mask;
|
|
||||||
/** padding bits to use for extra space in the QR code (should be left as the default for ISO compliance but may be changed for artistic effect) */
|
|
||||||
trailer?: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Generate a QR code.
|
|
||||||
*
|
|
||||||
* @param data either a string, or a pre-encoded mode.
|
|
||||||
* @param options optional configuration for the QR code.
|
|
||||||
* @returns the requested QR code.
|
|
||||||
*/
|
|
||||||
export type GenerateFn = (
|
|
||||||
data: Mode | string,
|
|
||||||
options?: Readonly<GenerateOptions>,
|
|
||||||
) => Bitmap2D;
|
|
||||||
interface Generate extends GenerateFn {
|
|
||||||
/**
|
|
||||||
* Creates a scoped `generate` function which considers additional modes
|
|
||||||
* when using auto encoding.
|
|
||||||
*
|
|
||||||
* @param modes the modes to add.
|
|
||||||
* @returns a `generate` function which will additionally consider the
|
|
||||||
* given modes when using auto encoding.
|
|
||||||
*/
|
|
||||||
with(...modes: ReadonlyArray<ModeFactory>): GenerateFn;
|
|
||||||
}
|
|
||||||
export const generate: Generate;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'lean-qr/nano' {
|
|
||||||
import type {
|
|
||||||
Correction,
|
|
||||||
Bitmap2D as FullBitmap2D,
|
|
||||||
GenerateOptions as FullGenerateOptions,
|
|
||||||
} from 'lean-qr';
|
|
||||||
import { correction as fullCorrection } from 'lean-qr';
|
|
||||||
|
|
||||||
export type { Correction };
|
|
||||||
|
|
||||||
export const correction: Pick<typeof fullCorrection, 'L' | 'M' | 'Q' | 'H'>;
|
|
||||||
|
|
||||||
export type Bitmap2D = Pick<FullBitmap2D, 'size' | 'get' | 'toCanvas'>;
|
|
||||||
|
|
||||||
export type GenerateOptions = Pick<
|
|
||||||
FullGenerateOptions,
|
|
||||||
'minCorrectionLevel' | 'minVersion'
|
|
||||||
>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Generate a QR code.
|
|
||||||
*
|
|
||||||
* @param data either a string, or a pre-encoded mode.
|
|
||||||
* @param options optional configuration for the QR code.
|
|
||||||
* @returns the requested QR code.
|
|
||||||
*/
|
|
||||||
export function generate(
|
|
||||||
data: string,
|
|
||||||
options?: Readonly<GenerateOptions>,
|
|
||||||
): Bitmap2D;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'lean-qr/extras/svg' {
|
|
||||||
import type { Bitmap2D as FullBitmap2D } from 'lean-qr';
|
|
||||||
|
|
||||||
type Bitmap2D = Pick<FullBitmap2D, 'size' | 'get'>;
|
|
||||||
|
|
||||||
export interface SVGOptions {
|
|
||||||
/** the colour to use for modules which are 'on' (typically black) */
|
|
||||||
on?: string;
|
|
||||||
/** the colour to use for modules which are 'off' (typically white) */
|
|
||||||
off?: string;
|
|
||||||
/** the padding to apply on the left and right of the output (filled with 'off') */
|
|
||||||
padX?: number;
|
|
||||||
/** the padding to apply on the top and bottom of the output (filled with 'off') */
|
|
||||||
padY?: number;
|
|
||||||
/** a width to apply to the resulting image (overrides `scale`) */
|
|
||||||
width?: number | null;
|
|
||||||
/** a height to apply to the resulting image (overrides `scale`) */
|
|
||||||
height?: number | null;
|
|
||||||
/** a scale to apply to the resulting image (`scale` pixels = 1 module) */
|
|
||||||
scale?: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Generate the raw outline of the QR code for use in an existing SVG.
|
|
||||||
*
|
|
||||||
* @param code the QR code to convert.
|
|
||||||
* @returns a string suitable for passing to the `d` attribute of a `path`.
|
|
||||||
*/
|
|
||||||
export function toSvgPath(code: Bitmap2D): string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Generate an SVG element which can be added to the DOM.
|
|
||||||
*
|
|
||||||
* @param code the QR code to convert.
|
|
||||||
* @param options optional configuration for the display.
|
|
||||||
* @returns an SVG element.
|
|
||||||
*/
|
|
||||||
export function toSvg(
|
|
||||||
code: Bitmap2D,
|
|
||||||
target: Document | SVGElement,
|
|
||||||
options?: Readonly<SVGOptions>,
|
|
||||||
): SVGElement;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Generate an SVG document which can be exported to a file or served from a
|
|
||||||
* web server.
|
|
||||||
*
|
|
||||||
* @param code the QR code to convert.
|
|
||||||
* @param options optional configuration for the display.
|
|
||||||
* @returns an SVG document.
|
|
||||||
*/
|
|
||||||
export function toSvgSource(
|
|
||||||
code: Bitmap2D,
|
|
||||||
options?: Readonly<
|
|
||||||
SVGOptions & {
|
|
||||||
/** `true` to include an XML declaration at the start of the source (for standalone documents which will not be embedded inside another document) */
|
|
||||||
xmlDeclaration?: boolean;
|
|
||||||
}
|
|
||||||
>,
|
|
||||||
): string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Generate a `data:image/svg+xml` URL.
|
|
||||||
*
|
|
||||||
* @param code the QR code to convert.
|
|
||||||
* @param options optional configuration for the display.
|
|
||||||
* @returns a string suitable for use as the `src` of an `img` tag.
|
|
||||||
*/
|
|
||||||
export function toSvgDataURL(
|
|
||||||
code: Bitmap2D,
|
|
||||||
options?: Readonly<SVGOptions>,
|
|
||||||
): string;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'lean-qr/extras/node_export' {
|
|
||||||
import type { RGBA, Bitmap2D as FullBitmap2D } from 'lean-qr';
|
|
||||||
|
|
||||||
type Bitmap2D = Pick<FullBitmap2D, 'size' | 'get'>;
|
|
||||||
|
|
||||||
export interface PNGOptions {
|
|
||||||
/** the colour to use for modules which are 'on' (typically black) */
|
|
||||||
on?: RGBA;
|
|
||||||
/** the colour to use for modules which are 'off' (typically white) */
|
|
||||||
off?: RGBA;
|
|
||||||
/** the padding to apply on the left and right of the output (filled with 'off') */
|
|
||||||
padX?: number;
|
|
||||||
/** the padding to apply on the top and bottom of the output (filled with 'off') */
|
|
||||||
padY?: number;
|
|
||||||
/** a scale to apply to the resulting image (`scale` pixels = 1 module) */
|
|
||||||
scale?: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Generate a PNG document which can be exported to a file or served from a
|
|
||||||
* web server.
|
|
||||||
*
|
|
||||||
* @param code the QR code to convert.
|
|
||||||
* @param options optional configuration for the display.
|
|
||||||
* @returns a PNG document.
|
|
||||||
*/
|
|
||||||
export function toPngBuffer(
|
|
||||||
code: Bitmap2D,
|
|
||||||
options?: Readonly<PNGOptions>,
|
|
||||||
): Uint8Array;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Generate a `data:image/png` URL.
|
|
||||||
*
|
|
||||||
* @param code the QR code to convert.
|
|
||||||
* @param options optional configuration for the display.
|
|
||||||
* @returns a string suitable for use as the `src` of an `img` tag.
|
|
||||||
*/
|
|
||||||
export function toPngDataURL(
|
|
||||||
code: Bitmap2D,
|
|
||||||
options?: Readonly<PNGOptions>,
|
|
||||||
): string;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'lean-qr/extras/react' {
|
|
||||||
import type {
|
|
||||||
Bitmap2D as FullBitmap2D,
|
|
||||||
GenerateOptions,
|
|
||||||
ImageDataOptions,
|
|
||||||
} from 'lean-qr';
|
|
||||||
import type {
|
|
||||||
SVGOptions,
|
|
||||||
toSvgDataURL as toSvgDataURLFn,
|
|
||||||
} from 'lean-qr/extras/svg';
|
|
||||||
|
|
||||||
export interface AsyncFramework<T> {
|
|
||||||
createElement: (
|
|
||||||
type: 'canvas',
|
|
||||||
props: {
|
|
||||||
ref: any;
|
|
||||||
style: { imageRendering: 'pixelated' };
|
|
||||||
className: string;
|
|
||||||
},
|
|
||||||
) => T;
|
|
||||||
useRef<T>(initialValue: T | null): { readonly current: T | null };
|
|
||||||
useEffect(fn: () => void | (() => void), deps: unknown[]): void;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface QRComponentProps {
|
|
||||||
content: string;
|
|
||||||
className?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AsyncQRComponentProps
|
|
||||||
extends ImageDataOptions,
|
|
||||||
GenerateOptions,
|
|
||||||
QRComponentProps {}
|
|
||||||
|
|
||||||
export type AsyncQRComponent<T> = (
|
|
||||||
props: Readonly<AsyncQRComponentProps>,
|
|
||||||
) => T;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Generate an asynchronous QR component (rendering to a `canvas`).
|
|
||||||
* You should call this just once, in the global scope.
|
|
||||||
*
|
|
||||||
* This is not suitable for server-side rendering (use `makeSyncComponent`
|
|
||||||
* instead).
|
|
||||||
*
|
|
||||||
* @param framework the framework to use (e.g. `React`).
|
|
||||||
* @param generate the `generate` function to use
|
|
||||||
* (from `lean-qr` or `lean-qr/nano`).
|
|
||||||
* @param defaultProps optional default properties to apply when the
|
|
||||||
* component is used (overridden by properties set on use).
|
|
||||||
* @returns a component which can be rendered elsewhere.
|
|
||||||
*/
|
|
||||||
export function makeAsyncComponent<T>(
|
|
||||||
framework: Readonly<AsyncFramework<T>>,
|
|
||||||
generate: (
|
|
||||||
data: string,
|
|
||||||
options?: Readonly<GenerateOptions>,
|
|
||||||
) => Pick<FullBitmap2D, 'toCanvas'>,
|
|
||||||
defaultProps?: Readonly<Partial<AsyncQRComponentProps>>,
|
|
||||||
): AsyncQRComponent<T>;
|
|
||||||
|
|
||||||
export interface SyncFramework<T> {
|
|
||||||
createElement: (
|
|
||||||
type: 'img',
|
|
||||||
props: {
|
|
||||||
src: string;
|
|
||||||
style: { imageRendering: 'pixelated' };
|
|
||||||
className: string;
|
|
||||||
},
|
|
||||||
) => T;
|
|
||||||
useMemo<T>(fn: () => T, deps: unknown[]): T;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface SyncQRComponentProps
|
|
||||||
extends SVGOptions,
|
|
||||||
GenerateOptions,
|
|
||||||
QRComponentProps {}
|
|
||||||
|
|
||||||
export type SyncQRComponent<T> = (props: Readonly<SyncQRComponentProps>) => T;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Generate a synchronous QR component (rendering to an SVG).
|
|
||||||
* You should call this just once, in the global scope.
|
|
||||||
*
|
|
||||||
* This is best suited for server-side rendering (prefer
|
|
||||||
* `makeAsyncComponent` if you only need client-side rendering).
|
|
||||||
*
|
|
||||||
* @param framework the framework to use (e.g. `React`).
|
|
||||||
* @param generate the `generate` function to use
|
|
||||||
* (from `lean-qr` or `lean-qr/nano`).
|
|
||||||
* @param toSvgDataURL the `toSvgDataURL` function to use
|
|
||||||
* (from `lean-qr/extras/svg`).
|
|
||||||
* @param defaultProps optional default properties to apply when the
|
|
||||||
* component is used (overridden by properties set on use).
|
|
||||||
* @returns a component which can be rendered elsewhere.
|
|
||||||
*/
|
|
||||||
export function makeSyncComponent<T>(
|
|
||||||
framework: Readonly<SyncFramework<T>>,
|
|
||||||
generate: (
|
|
||||||
data: string,
|
|
||||||
options?: Readonly<GenerateOptions>,
|
|
||||||
) => Pick<FullBitmap2D, 'size' | 'get'>,
|
|
||||||
toSvgDataURL: typeof toSvgDataURLFn,
|
|
||||||
defaultProps?: Readonly<Partial<SyncQRComponentProps>>,
|
|
||||||
): SyncQRComponent<T>;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module 'lean-qr/extras/errors' {
|
|
||||||
/**
|
|
||||||
* Convert an error into a human-readable message. This is intended for use
|
|
||||||
* with Lean QR errors, but will return somewhat meaningful messages for
|
|
||||||
* other errors too.
|
|
||||||
*
|
|
||||||
* @param error the error to convert.
|
|
||||||
* @returns a human-readable message explaining the error.
|
|
||||||
*/
|
|
||||||
export function readError(error: unknown): string;
|
|
||||||
}
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
import { Computation, Queue } from "./core/index.js";
|
|
||||||
import type { Effect } from "./core/index.js";
|
|
||||||
export declare class CollectionQueue extends Queue {
|
|
||||||
_collectionType: number;
|
|
||||||
_nodes: Set<Effect>;
|
|
||||||
_disabled: Computation<boolean>;
|
|
||||||
constructor(type: number);
|
|
||||||
run(type: number): void;
|
|
||||||
notify(node: Effect, type: number, flags: number): boolean;
|
|
||||||
}
|
|
||||||
export declare enum BoundaryMode {
|
|
||||||
VISIBLE = "visible",
|
|
||||||
HIDDEN = "hidden"
|
|
||||||
}
|
|
||||||
export declare function createBoundary<T>(fn: () => T, condition: () => BoundaryMode): () => T | undefined;
|
|
||||||
export declare function createSuspense(fn: () => any, fallback: () => any): () => any;
|
|
||||||
export declare function createErrorBoundary<U>(fn: () => any, fallback: (error: unknown, reset: () => void) => U): () => any;
|
|
||||||
export declare function flatten(children: any, options?: {
|
|
||||||
skipNonRendered?: boolean;
|
|
||||||
doNotUnwrap?: boolean;
|
|
||||||
}): any;
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
/**
|
|
||||||
* See https://dev.to/modderme123/super-charging-fine-grained-reactive-performance-47ph
|
|
||||||
* State clean corresponds to a node where all the sources are fully up to date
|
|
||||||
* State check corresponds to a node where some sources (including grandparents) may have changed
|
|
||||||
* State dirty corresponds to a node where the direct parents of a node has changed
|
|
||||||
*/
|
|
||||||
export declare const STATE_CLEAN = 0;
|
|
||||||
export declare const STATE_CHECK = 1;
|
|
||||||
export declare const STATE_DIRTY = 2;
|
|
||||||
export declare const STATE_DISPOSED = 3;
|
|
||||||
export declare const EFFECT_PURE = 0;
|
|
||||||
export declare const EFFECT_RENDER = 1;
|
|
||||||
export declare const EFFECT_USER = 2;
|
|
||||||
export declare const SUPPORTS_PROXY: boolean;
|
|
||||||
@@ -1,157 +0,0 @@
|
|||||||
/**
|
|
||||||
* Nodes for constructing a graph of reactive values and reactive computations.
|
|
||||||
*
|
|
||||||
* - The graph is acyclic.
|
|
||||||
* - The user inputs new values into the graph by calling .write() on one more computation nodes.
|
|
||||||
* - The user retrieves computed results from the graph by calling .read() on one or more computation nodes.
|
|
||||||
* - The library is responsible for running any necessary computations so that .read() is up to date
|
|
||||||
* with all prior .write() calls anywhere in the graph.
|
|
||||||
* - We call the input nodes 'roots' and the output nodes 'leaves' of the graph here.
|
|
||||||
* - Changes flow from roots to leaves. It would be effective but inefficient to immediately
|
|
||||||
* propagate all changes from a root through the graph to descendant leaves. Instead, we defer
|
|
||||||
* change most change propagation computation until a leaf is accessed. This allows us to
|
|
||||||
* coalesce computations and skip altogether recalculating unused sections of the graph.
|
|
||||||
* - Each computation node tracks its sources and its observers (observers are other
|
|
||||||
* elements that have this node as a source). Source and observer links are updated automatically
|
|
||||||
* as observer computations re-evaluate and call get() on their sources.
|
|
||||||
* - Each node stores a cache state (clean/check/dirty) to support the change propagation algorithm:
|
|
||||||
*
|
|
||||||
* In general, execution proceeds in three passes:
|
|
||||||
*
|
|
||||||
* 1. write() propagates changes down the graph to the leaves
|
|
||||||
* direct children are marked as dirty and their deeper descendants marked as check
|
|
||||||
* (no computations are evaluated)
|
|
||||||
* 2. read() requests that parent nodes updateIfNecessary(), which proceeds recursively up the tree
|
|
||||||
* to decide whether the node is clean (parents unchanged) or dirty (parents changed)
|
|
||||||
* 3. updateIfNecessary() evaluates the computation if the node is dirty (the computations are
|
|
||||||
* executed in root to leaf order)
|
|
||||||
*/
|
|
||||||
import { type Flags } from "./flags.js";
|
|
||||||
import { Owner } from "./owner.js";
|
|
||||||
export interface SignalOptions<T> {
|
|
||||||
id?: string;
|
|
||||||
name?: string;
|
|
||||||
equals?: ((prev: T, next: T) => boolean) | false;
|
|
||||||
pureWrite?: boolean;
|
|
||||||
unobserved?: () => void;
|
|
||||||
}
|
|
||||||
interface SourceType {
|
|
||||||
_observers: ObserverType[] | null;
|
|
||||||
_unobserved?: () => void;
|
|
||||||
_updateIfNecessary: () => void;
|
|
||||||
_stateFlags: Flags;
|
|
||||||
_time: number;
|
|
||||||
}
|
|
||||||
interface ObserverType {
|
|
||||||
_sources: SourceType[] | null;
|
|
||||||
_notify: (state: number, skipQueue?: boolean) => void;
|
|
||||||
_handlerMask: Flags;
|
|
||||||
_notifyFlags: (mask: Flags, newFlags: Flags) => void;
|
|
||||||
_time: number;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Returns the current observer.
|
|
||||||
*/
|
|
||||||
export declare function getObserver(): Computation | null;
|
|
||||||
export declare const UNCHANGED: unique symbol;
|
|
||||||
export type UNCHANGED = typeof UNCHANGED;
|
|
||||||
export declare class Computation<T = any> extends Owner implements SourceType, ObserverType {
|
|
||||||
_sources: SourceType[] | null;
|
|
||||||
_observers: ObserverType[] | null;
|
|
||||||
_value: T | undefined;
|
|
||||||
_error: unknown;
|
|
||||||
_compute: null | ((p?: T) => T);
|
|
||||||
_name: string | undefined;
|
|
||||||
_equals: false | ((a: T, b: T) => boolean);
|
|
||||||
_unobserved: (() => void) | undefined;
|
|
||||||
_pureWrite: boolean;
|
|
||||||
/** Whether the computation is an error or has ancestors that are unresolved */
|
|
||||||
_stateFlags: number;
|
|
||||||
/** Which flags raised by sources are handled, vs. being passed through. */
|
|
||||||
_handlerMask: number;
|
|
||||||
_time: number;
|
|
||||||
_forceNotify: boolean;
|
|
||||||
constructor(initialValue: T | undefined, compute: null | ((p?: T) => T), options?: SignalOptions<T>);
|
|
||||||
_read(): T;
|
|
||||||
/**
|
|
||||||
* Return the current value of this computation
|
|
||||||
* Automatically re-executes the surrounding computation when the value changes
|
|
||||||
*/
|
|
||||||
read(): T;
|
|
||||||
/**
|
|
||||||
* Return the current value of this computation
|
|
||||||
* Automatically re-executes the surrounding computation when the value changes
|
|
||||||
*
|
|
||||||
* If the computation has any unresolved ancestors, this function waits for the value to resolve
|
|
||||||
* before continuing
|
|
||||||
*/
|
|
||||||
wait(): T;
|
|
||||||
/** Update the computation with a new value. */
|
|
||||||
write(value: T | ((currentValue: T) => T) | UNCHANGED, flags?: number, raw?: boolean): T;
|
|
||||||
/**
|
|
||||||
* Set the current node's state, and recursively mark all of this node's observers as STATE_CHECK
|
|
||||||
*/
|
|
||||||
_notify(state: number, skipQueue?: boolean): void;
|
|
||||||
/**
|
|
||||||
* Notify the computation that one of its sources has changed flags.
|
|
||||||
*
|
|
||||||
* @param mask A bitmask for which flag(s) were changed.
|
|
||||||
* @param newFlags The source's new flags, masked to just the changed ones.
|
|
||||||
*/
|
|
||||||
_notifyFlags(mask: Flags, newFlags: Flags): void;
|
|
||||||
_setError(error: unknown): void;
|
|
||||||
/**
|
|
||||||
* This is the core part of the reactivity system, which makes sure that the values are updated
|
|
||||||
* before they are read. We've also adapted it to return the loading state of the computation,
|
|
||||||
* so that we can propagate that to the computation's observers.
|
|
||||||
*
|
|
||||||
* This function will ensure that the value and states we read from the computation are up to date
|
|
||||||
*/
|
|
||||||
_updateIfNecessary(): void;
|
|
||||||
/**
|
|
||||||
* Remove ourselves from the owner graph and the computation graph
|
|
||||||
*/
|
|
||||||
_disposeNode(): void;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Reruns a computation's _compute function, producing a new value and keeping track of dependencies.
|
|
||||||
*
|
|
||||||
* It handles the updating of sources and observers, disposal of previous executions,
|
|
||||||
* and error handling if the _compute function throws. It also sets the node as loading
|
|
||||||
* if it reads any parents that are currently loading.
|
|
||||||
*/
|
|
||||||
export declare function update<T>(node: Computation<T>): void;
|
|
||||||
export declare function isEqual<T>(a: T, b: T): boolean;
|
|
||||||
/**
|
|
||||||
* Returns the current value stored inside the given compute function without triggering any
|
|
||||||
* dependencies. Use `untrack` if you want to also disable owner tracking.
|
|
||||||
*/
|
|
||||||
export declare function untrack<T>(fn: () => T): T;
|
|
||||||
/**
|
|
||||||
* Returns true if the given functinon contains signals that have been updated since the last time
|
|
||||||
* the parent computation was run.
|
|
||||||
*/
|
|
||||||
export declare function hasUpdated(fn: () => any): boolean;
|
|
||||||
/**
|
|
||||||
* Returns an accessor that is true if the given function contains async signals that are out of date.
|
|
||||||
*/
|
|
||||||
export declare function isPending(fn: () => any): boolean;
|
|
||||||
export declare function isPending(fn: () => any, loadingValue: boolean): boolean;
|
|
||||||
/**
|
|
||||||
* Attempts to resolve value of expression synchronously returning the last resolved value for any async computation.
|
|
||||||
*/
|
|
||||||
export declare function latest<T>(fn: () => T): T;
|
|
||||||
export declare function latest<T, U>(fn: () => T, fallback: U): T | U;
|
|
||||||
/**
|
|
||||||
* Runs the given function in the given observer.
|
|
||||||
*
|
|
||||||
* Warning: Usually there are simpler ways of modeling a problem that avoid using this function
|
|
||||||
*/
|
|
||||||
export declare function runWithObserver<T>(observer: Computation, run: () => T): T | undefined;
|
|
||||||
/**
|
|
||||||
* A convenient wrapper that calls `compute` with the `owner` and `observer` and is guaranteed
|
|
||||||
* to reset the global context after the computation is finished even if an error is thrown.
|
|
||||||
*/
|
|
||||||
export declare function compute<T>(owner: Owner | null, fn: (val: T) => T, observer: Computation<T>): T;
|
|
||||||
export declare function compute<T>(owner: Owner | null, fn: (val: undefined) => T, observer: null): T;
|
|
||||||
export {};
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
import { EFFECT_RENDER, EFFECT_USER } from "./constants.js";
|
|
||||||
import { Computation, type SignalOptions } from "./core.js";
|
|
||||||
/**
|
|
||||||
* Effects are the leaf nodes of our reactive graph. When their sources change, they are
|
|
||||||
* automatically added to the queue of effects to re-execute, which will cause them to fetch their
|
|
||||||
* sources and recompute
|
|
||||||
*/
|
|
||||||
export declare class Effect<T = any> extends Computation<T> {
|
|
||||||
_effect: (val: T, prev: T | undefined) => void | (() => void);
|
|
||||||
_onerror: ((err: unknown, cleanup: () => void) => void) | undefined;
|
|
||||||
_cleanup: (() => void) | undefined;
|
|
||||||
_modified: boolean;
|
|
||||||
_prevValue: T | undefined;
|
|
||||||
_type: typeof EFFECT_RENDER | typeof EFFECT_USER;
|
|
||||||
constructor(initialValue: T, compute: (val?: T) => T, effect: (val: T, prev: T | undefined) => void | (() => void), error?: (err: unknown) => void | (() => void), options?: SignalOptions<T> & {
|
|
||||||
render?: boolean;
|
|
||||||
defer?: boolean;
|
|
||||||
});
|
|
||||||
write(value: T, flags?: number): T;
|
|
||||||
_notify(state: number, skipQueue?: boolean): void;
|
|
||||||
_setError(error: unknown): void;
|
|
||||||
_disposeNode(): void;
|
|
||||||
_run(type: number): void;
|
|
||||||
}
|
|
||||||
export declare class EagerComputation<T = any> extends Computation<T> {
|
|
||||||
constructor(initialValue: T, compute: () => T, options?: SignalOptions<T> & {
|
|
||||||
defer?: boolean;
|
|
||||||
});
|
|
||||||
_notify(state: number, skipQueue?: boolean): void;
|
|
||||||
_run(): void;
|
|
||||||
}
|
|
||||||
export declare class FirewallComputation extends Computation {
|
|
||||||
firewall: boolean;
|
|
||||||
constructor(compute: () => void);
|
|
||||||
_notify(state: number, skipQueue?: boolean): void;
|
|
||||||
_run(): void;
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
export declare class NotReadyError extends Error {
|
|
||||||
}
|
|
||||||
export declare class NoOwnerError extends Error {
|
|
||||||
constructor();
|
|
||||||
}
|
|
||||||
export declare class ContextNotFoundError extends Error {
|
|
||||||
constructor();
|
|
||||||
}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
export type Flags = number;
|
|
||||||
export declare const ERROR_OFFSET = 0;
|
|
||||||
export declare const ERROR_BIT: number;
|
|
||||||
export declare const ERROR: unique symbol;
|
|
||||||
export declare const LOADING_OFFSET = 1;
|
|
||||||
export declare const LOADING_BIT: number;
|
|
||||||
export declare const LOADING: unique symbol;
|
|
||||||
export declare const UNINITIALIZED_OFFSET = 2;
|
|
||||||
export declare const UNINITIALIZED_BIT: number;
|
|
||||||
export declare const UNINITIALIZED: unique symbol;
|
|
||||||
export declare const DEFAULT_FLAGS: number;
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
export { ContextNotFoundError, NoOwnerError, NotReadyError } from "./error.js";
|
|
||||||
export { Owner, createContext, getContext, setContext, hasContext, getOwner, onCleanup, type Context, type ContextRecord, type Disposable } from "./owner.js";
|
|
||||||
export { Computation, getObserver, isEqual, untrack, hasUpdated, isPending, latest, UNCHANGED, compute, runWithObserver, type SignalOptions } from "./core.js";
|
|
||||||
export { Effect, EagerComputation } from "./effect.js";
|
|
||||||
export { flush, Queue, incrementClock, getClock, type IQueue } from "./scheduler.js";
|
|
||||||
export * from "./constants.js";
|
|
||||||
export * from "./flags.js";
|
|
||||||
@@ -1,95 +0,0 @@
|
|||||||
/**
|
|
||||||
* Owner tracking is used to enable nested tracking scopes with automatic cleanup.
|
|
||||||
* We also use owners to also keep track of which error handling context we are in.
|
|
||||||
*
|
|
||||||
* If you write the following
|
|
||||||
*
|
|
||||||
* const a = createOwner(() => {
|
|
||||||
* const b = createOwner(() => {});
|
|
||||||
*
|
|
||||||
* const c = createOwner(() => {
|
|
||||||
* const d = createOwner(() => {});
|
|
||||||
* });
|
|
||||||
*
|
|
||||||
* const e = createOwner(() => {});
|
|
||||||
* });
|
|
||||||
*
|
|
||||||
* The owner tree will look like this:
|
|
||||||
*
|
|
||||||
* a
|
|
||||||
* /|\
|
|
||||||
* b-c-e
|
|
||||||
* |
|
|
||||||
* d
|
|
||||||
*
|
|
||||||
* Following the _nextSibling pointers of each owner will first give you its children, and then its siblings (in reverse).
|
|
||||||
* a -> e -> c -> d -> b
|
|
||||||
*
|
|
||||||
* Note that the owner tree is largely orthogonal to the reactivity tree, and is much closer to the component tree.
|
|
||||||
*/
|
|
||||||
import { type IQueue } from "./scheduler.js";
|
|
||||||
export type ContextRecord = Record<string | symbol, unknown>;
|
|
||||||
export interface Disposable {
|
|
||||||
(): void;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Returns the currently executing parent owner.
|
|
||||||
*/
|
|
||||||
export declare function getOwner(): Owner | null;
|
|
||||||
export declare function setOwner(owner: Owner | null): Owner | null;
|
|
||||||
export declare class Owner {
|
|
||||||
_parent: Owner | null;
|
|
||||||
_nextSibling: Owner | null;
|
|
||||||
_prevSibling: Owner | null;
|
|
||||||
_state: number;
|
|
||||||
_disposal: Disposable | Disposable[] | null;
|
|
||||||
_context: ContextRecord;
|
|
||||||
_queue: IQueue;
|
|
||||||
_childCount: number;
|
|
||||||
id: string | null;
|
|
||||||
constructor(id?: string | null, skipAppend?: boolean);
|
|
||||||
append(child: Owner): void;
|
|
||||||
dispose(this: Owner, self?: boolean): void;
|
|
||||||
_disposeNode(): void;
|
|
||||||
emptyDisposal(): void;
|
|
||||||
getNextChildId(): string;
|
|
||||||
}
|
|
||||||
export interface Context<T> {
|
|
||||||
readonly id: symbol;
|
|
||||||
readonly defaultValue: T | undefined;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Context provides a form of dependency injection. It is used to save from needing to pass
|
|
||||||
* data as props through intermediate components. This function creates a new context object
|
|
||||||
* that can be used with `getContext` and `setContext`.
|
|
||||||
*
|
|
||||||
* A default value can be provided here which will be used when a specific value is not provided
|
|
||||||
* via a `setContext` call.
|
|
||||||
*/
|
|
||||||
export declare function createContext<T>(defaultValue?: T, description?: string): Context<T>;
|
|
||||||
/**
|
|
||||||
* Attempts to get a context value for the given key.
|
|
||||||
*
|
|
||||||
* @throws `NoOwnerError` if there's no owner at the time of call.
|
|
||||||
* @throws `ContextNotFoundError` if a context value has not been set yet.
|
|
||||||
*/
|
|
||||||
export declare function getContext<T>(context: Context<T>, owner?: Owner | null): T;
|
|
||||||
/**
|
|
||||||
* Attempts to set a context value on the parent scope with the given key.
|
|
||||||
*
|
|
||||||
* @throws `NoOwnerError` if there's no owner at the time of call.
|
|
||||||
*/
|
|
||||||
export declare function setContext<T>(context: Context<T>, value?: T, owner?: Owner | null): void;
|
|
||||||
/**
|
|
||||||
* Whether the given context is currently defined.
|
|
||||||
*/
|
|
||||||
export declare function hasContext(context: Context<any>, owner?: Owner | null): boolean;
|
|
||||||
/**
|
|
||||||
* Runs an effect once before the reactive scope is disposed
|
|
||||||
* @param fn an effect that should run only once on cleanup
|
|
||||||
*
|
|
||||||
* @returns the same {@link fn} function that was passed in
|
|
||||||
*
|
|
||||||
* @description https://docs.solidjs.com/reference/lifecycle/on-cleanup
|
|
||||||
*/
|
|
||||||
export declare function onCleanup(fn: Disposable): Disposable;
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
export declare function getClock(): number;
|
|
||||||
export declare function incrementClock(): void;
|
|
||||||
type QueueCallback = (type: number) => void;
|
|
||||||
export interface IQueue {
|
|
||||||
enqueue(type: number, fn: QueueCallback): void;
|
|
||||||
run(type: number): boolean | void;
|
|
||||||
flush(): void;
|
|
||||||
addChild(child: IQueue): void;
|
|
||||||
removeChild(child: IQueue): void;
|
|
||||||
created: number;
|
|
||||||
notify(...args: any[]): boolean;
|
|
||||||
_parent: IQueue | null;
|
|
||||||
}
|
|
||||||
export declare class Queue implements IQueue {
|
|
||||||
_parent: IQueue | null;
|
|
||||||
_running: boolean;
|
|
||||||
_queues: [QueueCallback[], QueueCallback[]];
|
|
||||||
_children: IQueue[];
|
|
||||||
created: number;
|
|
||||||
enqueue(type: number, fn: QueueCallback): void;
|
|
||||||
run(type: number): void;
|
|
||||||
flush(): void;
|
|
||||||
addChild(child: IQueue): void;
|
|
||||||
removeChild(child: IQueue): void;
|
|
||||||
notify(...args: any[]): boolean;
|
|
||||||
}
|
|
||||||
export declare const globalQueue: Queue;
|
|
||||||
/**
|
|
||||||
* By default, changes are batched on the microtask queue which is an async process. You can flush
|
|
||||||
* the queue synchronously to get the latest updates by calling `flush()`.
|
|
||||||
*/
|
|
||||||
export declare function flush(): void;
|
|
||||||
export {};
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
export { Computation, ContextNotFoundError, NoOwnerError, NotReadyError, Owner, Queue, createContext, flush, getContext, setContext, hasContext, getOwner, onCleanup, getObserver, isEqual, untrack, hasUpdated, isPending, latest, runWithObserver, SUPPORTS_PROXY } from "./core/index.js";
|
|
||||||
export type { SignalOptions, Context, ContextRecord, Disposable, IQueue } from "./core/index.js";
|
|
||||||
export { mapArray, repeat, type Maybe } from "./map.js";
|
|
||||||
export * from "./signals.js";
|
|
||||||
export * from "./store/index.js";
|
|
||||||
export { createSuspense, createErrorBoundary, createBoundary, flatten, type BoundaryMode } from "./boundaries.js";
|
|
||||||