computer + kibo: part 10

This commit is contained in:
nym21
2025-04-11 19:21:35 +02:00
parent f32b6daa51
commit 1c75ea046c
11 changed files with 374 additions and 101 deletions
+2 -2
View File
@@ -767,13 +767,13 @@ function createUtils() {
return numberToUSFormat(value, 0);
} else if (absoluteValue < 1_000_000) {
return `${numberToUSFormat(value / 1_000, 1)}K`;
} else if (absoluteValue >= 9_000_000_000_000_000) {
} else if (absoluteValue >= 900_000_000_000_000_000) {
return "Inf.";
}
const log = Math.floor(Math.log10(absoluteValue) - 6);
const suffices = ["M", "B", "T", "Q"];
const suffices = ["M", "B", "T", "P", "E"];
const letterIndex = Math.floor(log / 3);
const letter = suffices[letterIndex];
+29 -1
View File
@@ -14,6 +14,7 @@
* "Percentage" |
* "Ratio" |
* "Satoshis" |
* "sat/vB" |
* "Seconds" |
* "Transactions" |
* "US Dollars" |
@@ -869,6 +870,16 @@ function createPartialOptions(colors) {
title: "Transaction Count",
key: "tx-count",
}),
createBaseSumTotal({
name: "Fee",
title: "Transaction Fee",
key: "fee",
}),
createBaseAverageMinMaxPercentiles({
name: "Feerate",
title: "Transaction Fee Rate",
key: "feerate",
}),
{
name: "Version",
tree: [
@@ -899,6 +910,11 @@ function createPartialOptions(colors) {
title: "Transaction Input Count",
key: "input-count",
}),
createBaseSumTotal({
name: "Value",
title: "Transaction Input Value",
key: "input-value",
}),
],
},
{
@@ -909,6 +925,11 @@ function createPartialOptions(colors) {
title: "Transaction Output Count",
key: "output-count",
}),
createBaseSumTotal({
name: "Value",
title: "Transaction Output Value",
key: "output-value",
}),
],
},
],
@@ -1265,7 +1286,14 @@ export function initOptions({
if (key) {
if (key.includes("-interval")) {
anyPartial.unit = "Seconds";
} else if (key.startsWith("sats-")) {
} else if (key.includes("feerate")) {
anyPartial.unit = "sat/vB";
} else if (
key.startsWith("sats-") ||
key.includes("input-value") ||
key.includes("output-value") ||
key.includes("fee")
) {
anyPartial.unit = "Satoshis";
} else if (key.includes("count")) {
anyPartial.unit = "Count";
@@ -87,6 +87,17 @@ export function createVecIdToIndexes() {
decadeindex: [Yearindex, Decadeindex],
difficulty: [Height],
difficultyepoch: [Height, Difficultyepoch],
fee: [Txindex],
"fee-sum": [Dateindex, Height, Weekindex, Monthindex, Quarterindex, Yearindex, Decadeindex, Difficultyepoch],
feerate: [Txindex],
"feerate-10p": [Height],
"feerate-25p": [Height],
"feerate-75p": [Height],
"feerate-90p": [Height],
"feerate-average": [Dateindex, Height, Weekindex, Monthindex, Quarterindex, Yearindex, Decadeindex, Difficultyepoch],
"feerate-max": [Dateindex, Height, Weekindex, Monthindex, Quarterindex, Yearindex, Decadeindex, Difficultyepoch],
"feerate-median": [Height],
"feerate-min": [Dateindex, Height, Weekindex, Monthindex, Quarterindex, Yearindex, Decadeindex, Difficultyepoch],
"first-addressindex": [Height],
"first-dateindex": [Weekindex, Monthindex],
"first-emptyindex": [Height],
@@ -115,6 +126,8 @@ export function createVecIdToIndexes() {
"high-in-cents": [Dateindex, Height],
"input-count": [Txindex],
"input-count-sum": [Dateindex, Height, Weekindex, Monthindex, Quarterindex, Yearindex, Decadeindex, Difficultyepoch],
"input-value": [Txindex],
"input-value-sum": [Dateindex, Height, Weekindex, Monthindex, Quarterindex, Yearindex, Decadeindex, Difficultyepoch],
"is-coinbase": [Txindex],
"is-explicitly-rbf": [Txindex],
"last-dateindex": [Weekindex, Monthindex],
@@ -134,6 +147,8 @@ export function createVecIdToIndexes() {
"open-in-cents": [Dateindex, Height],
"output-count": [Txindex],
"output-count-sum": [Dateindex, Height, Weekindex, Monthindex, Quarterindex, Yearindex, Decadeindex, Difficultyepoch],
"output-value": [Txindex],
"output-value-sum": [Dateindex, Height, Weekindex, Monthindex, Quarterindex, Yearindex, Decadeindex, Difficultyepoch],
p2pk33addressbytes: [P2PK33index],
p2pk65addressbytes: [P2PK65index],
p2pkhaddressbytes: [P2PKHindex],
@@ -149,8 +164,11 @@ export function createVecIdToIndexes() {
"total-block-size": [Dateindex, Height, Weekindex, Monthindex, Quarterindex, Yearindex, Decadeindex, Difficultyepoch],
"total-block-vbytes": [Dateindex, Height, Weekindex, Monthindex, Quarterindex, Yearindex, Decadeindex, Difficultyepoch],
"total-block-weight": [Dateindex, Height, Weekindex, Monthindex, Quarterindex, Yearindex, Decadeindex, Difficultyepoch],
"total-fee": [Dateindex, Height, Weekindex, Monthindex, Quarterindex, Yearindex, Decadeindex, Difficultyepoch],
"total-input-count": [Dateindex, Height, Weekindex, Monthindex, Quarterindex, Yearindex, Decadeindex, Difficultyepoch],
"total-input-value": [Dateindex, Height, Weekindex, Monthindex, Quarterindex, Yearindex, Decadeindex, Difficultyepoch],
"total-output-count": [Dateindex, Height, Weekindex, Monthindex, Quarterindex, Yearindex, Decadeindex, Difficultyepoch],
"total-output-value": [Dateindex, Height, Weekindex, Monthindex, Quarterindex, Yearindex, Decadeindex, Difficultyepoch],
"total-size": [Txindex],
"total-tx-count": [Dateindex, Height, Weekindex, Monthindex, Quarterindex, Yearindex, Decadeindex, Difficultyepoch],
"total-tx-v1": [Dateindex, Height, Weekindex, Monthindex, Quarterindex, Yearindex, Decadeindex, Difficultyepoch],
@@ -168,7 +186,9 @@ export function createVecIdToIndexes() {
txoutindex: [Txinindex],
txversion: [Txindex],
value: [Txinindex, Txoutindex],
vsize: [Txindex],
weekindex: [Dateindex, Weekindex],
weight: [Txindex],
yearindex: [Monthindex, Yearindex],
}
}