global: sats version of all prices

This commit is contained in:
nym21
2026-01-26 15:04:45 +01:00
parent f066fcda32
commit 3d01822d27
53 changed files with 2843 additions and 1688 deletions

View File

@@ -2,6 +2,44 @@
import { Unit } from "../utils/units.js";
// ============================================================================
// Price helper for top pane (auto-expands to USD + sats)
// ============================================================================
/**
* Create a price series for the top pane (auto-expands to USD + sats versions)
* @param {Object} args
* @param {AnyPricePattern} args.metric - Price pattern with dollars and sats
* @param {string} args.name
* @param {string} [args.key]
* @param {LineStyle} [args.style]
* @param {Color} [args.color]
* @param {boolean} [args.defaultActive]
* @param {LineSeriesPartialOptions} [args.options]
* @returns {FetchedPriceSeriesBlueprint}
*/
export function price({
metric,
name,
key,
style,
color,
defaultActive,
options,
}) {
return {
metric,
title: name,
key,
color,
defaultActive,
options: {
lineStyle: style,
...options,
},
};
}
// ============================================================================
// Shared percentile helper
// ============================================================================